public class MarshObjectConvertor extends Resource implements MarshObjectConvertorResource
ResourcePool
only.Modifier and Type | Class and Description |
---|---|
protected static class |
MarshObjectConvertor.MarshObjectConvertorFactory |
Constructor and Description |
---|
MarshObjectConvertor() |
MarshObjectConvertor(IMemoryAwareResourcePool resourcePool) |
MarshObjectConvertor(IMemoryAwareResourcePool resourcePool,
ObjectInputStreamFactory objectInputStreamFactory) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Cleans the resource of its contents so it can be returned to the pool.
|
Object |
fromBinary(byte[] data) |
static IResourceFactory<MarshObjectConvertor> |
getFactory() |
protected ObjectInputStream |
getObjectInputStream(InputStream is)
Wrap given InputStream with ObjectInputStream
|
protected ObjectOutputStream |
getObjectOutputStream(OutputStream os)
Wrap given OutputStream with ObjectInputStream
|
long |
getUsedMemory() |
protected byte[] |
serializeToByteArray(Object o) |
byte[] |
toBinary(Object o) |
acquire, isAcquired, isFromPool, release, setAcquired, setFromPool
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquire, isAcquired, isFromPool, release, setAcquired, setFromPool
public MarshObjectConvertor()
public MarshObjectConvertor(IMemoryAwareResourcePool resourcePool)
public MarshObjectConvertor(IMemoryAwareResourcePool resourcePool, ObjectInputStreamFactory objectInputStreamFactory)
public byte[] toBinary(Object o) throws IOException
toBinary
in interface IMarshObjectConvertor
IOException
protected byte[] serializeToByteArray(Object o) throws IOException
IOException
public Object fromBinary(byte[] data) throws IOException, ClassNotFoundException
fromBinary
in interface IMarshObjectConvertor
IOException
ClassNotFoundException
public void clear()
IResource
You may use the
IResource.isFromPool()
indication to decide of a special action before returning a resource to
the pool, or discard any actions on resources not returning to the pool.
clear
in interface IResource
clear
in class Resource
IResource.release()
protected ObjectInputStream getObjectInputStream(InputStream is) throws IOException
IOException
protected ObjectOutputStream getObjectOutputStream(OutputStream os) throws IOException
IOException
public static IResourceFactory<MarshObjectConvertor> getFactory()
public long getUsedMemory()
getUsedMemory
in interface IMemoryAwareResource
Copyright © GigaSpaces.