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(ISmartLengthBasedCacheCallback cacheCallback) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Cleans the resource of its contents so it can be returned to the pool.
|
static IResourceFactory<MarshObjectConvertor> |
getFactory() |
MarshObject |
getMarshObject(Object o)
Convert Object to MarshObject
|
Object |
getObject(byte[] bytes) |
Object |
getObject(MarshObject marsh)
Convert MarshObject to Object
|
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) |
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(ISmartLengthBasedCacheCallback cacheCallback)
public MarshObject getMarshObject(Object o) throws IOException
IMarshObjectConvertor
getMarshObject
in interface IMarshObjectConvertor
o
- Original objectIOException
protected byte[] serializeToByteArray(Object o) throws IOException
IOException
public Object getObject(MarshObject marsh) throws IOException, ClassNotFoundException
IMarshObjectConvertor
getObject
in interface IMarshObjectConvertor
marsh
- MarshObject to convertIOException
ClassNotFoundException
public Object getObject(byte[] bytes) throws IOException, ClassNotFoundException
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.