Class MarshObjectConvertor
java.lang.Object
com.j_spaces.kernel.pool.Resource
com.gigaspaces.internal.io.MarshObjectConvertor
- All Implemented Interfaces:
IMarshObjectConvertor, MarshObjectConvertorResource, IMemoryAwareResource, IResource
Notice! this implementation is not Thread safe and should be use in conjuction with
ResourcePool only.- Since:
- 4.1
- Author:
- Guy Korland
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Constructor Summary
ConstructorsConstructorDescriptionMarshObjectConvertor(IMemoryAwareResourcePool resourcePool) MarshObjectConvertor(IMemoryAwareResourcePool resourcePool, ObjectInputStreamFactory objectInputStreamFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Cleans the resource of its contents so it can be returned to the pool.fromBinary(byte[] data) static IResourceFactory<MarshObjectConvertor> protected ObjectInputStreamWrap given InputStream with ObjectInputStreamprotected ObjectOutputStreamWrap given OutputStream with ObjectInputStreamlongprotected byte[]byte[]Methods inherited from class Resource
acquire, isAcquired, isFromPool, release, setAcquired, setFromPoolMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IResource
acquire, isAcquired, isFromPool, release, setAcquired, setFromPool
-
Constructor Details
-
MarshObjectConvertor
public MarshObjectConvertor() -
MarshObjectConvertor
-
MarshObjectConvertor
public MarshObjectConvertor(IMemoryAwareResourcePool resourcePool, ObjectInputStreamFactory objectInputStreamFactory)
-
-
Method Details
-
toBinary
- Specified by:
toBinaryin interfaceIMarshObjectConvertor- Throws:
IOException
-
serializeToByteArray
- Throws:
IOException
-
fromBinary
- Specified by:
fromBinaryin interfaceIMarshObjectConvertor- Throws:
IOExceptionClassNotFoundException
-
clear
public void clear()Description copied from interface:IResourceCleans the resource of its contents so it can be returned to the pool.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. -
getObjectInputStream
Wrap given InputStream with ObjectInputStream- Throws:
IOException
-
getObjectOutputStream
Wrap given OutputStream with ObjectInputStream- Throws:
IOException
-
getFactory
- Returns:
-
getUsedMemory
public long getUsedMemory()- Specified by:
getUsedMemoryin interfaceIMemoryAwareResource
-