Package org.infinispan.marshall.core
Class GlobalMarshaller
- java.lang.Object
-
- org.infinispan.marshall.core.GlobalMarshaller
-
- All Implemented Interfaces:
org.infinispan.commons.marshall.Marshaller,org.infinispan.commons.marshall.StreamingMarshaller
public class GlobalMarshaller extends Object implements org.infinispan.commons.marshall.StreamingMarshaller
A globally-scoped marshaller. This is needed so that the transport layer can unmarshall requests even before it's known which cache's marshaller can do the job.- Since:
- 5.0
- Author:
- Galder ZamarreƱo
-
-
Field Summary
Fields Modifier and Type Field Description static intID_ANNOTATEDstatic intID_EXTERNALstatic intID_INTERNALstatic intID_NULLstatic intID_PRIMITIVEstatic intID_UNKNOWNstatic intNOT_FOUND
-
Constructor Summary
Constructors Constructor Description GlobalMarshaller()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> org.infinispan.commons.marshall.Externalizer<T>findExternalizerFor(Object obj)voidfinishObjectInput(ObjectInput oi)voidfinishObjectOutput(ObjectOutput oo)org.infinispan.commons.marshall.BufferSizePredictorgetBufferSizePredictor(Object o)static org.infinispan.commons.marshall.AdvancedExternalizergetExternalExternalizer(GlobalMarshaller gm, Class<?> clazz)static org.infinispan.commons.marshall.AdvancedExternalizergetInteralExternalizer(GlobalMarshaller gm, Class<?> clazz)PersistenceMarshallergetPersistenceMarshaller()booleanisMarshallable(Object o)org.infinispan.commons.dataconversion.MediaTypemediaType()ObjectobjectFromByteBuffer(byte[] buf)ObjectobjectFromByteBuffer(byte[] bytes, int offset, int len)ObjectobjectFromInputStream(InputStream is)ObjectobjectFromObjectStream(ObjectInput in)org.infinispan.commons.io.ByteBufferobjectToBuffer(Object o)byte[]objectToByteBuffer(Object obj)byte[]objectToByteBuffer(Object obj, int estimatedSize)voidobjectToObjectStream(Object obj, ObjectOutput out)static ObjectreadObjectFromObjectInput(GlobalMarshaller gm, ObjectInput in)voidstart()ObjectInputstartObjectInput(InputStream is, boolean isReentrant)ObjectOutputstartObjectOutput(OutputStream os, boolean isReentrant, int estimatedSize)voidstop()static voidwriteExternalClean(Object obj, org.infinispan.commons.marshall.AdvancedExternalizer ext, ObjectOutput out)static voidwriteInternalClean(Object obj, org.infinispan.commons.marshall.AdvancedExternalizer ext, ObjectOutput out)static voidwriteUnknown(org.infinispan.commons.marshall.Marshaller marshaller, Object obj, ObjectOutput out)
-
-
-
Field Detail
-
NOT_FOUND
public static final int NOT_FOUND
- See Also:
- Constant Field Values
-
ID_NULL
public static final int ID_NULL
- See Also:
- Constant Field Values
-
ID_PRIMITIVE
public static final int ID_PRIMITIVE
- See Also:
- Constant Field Values
-
ID_INTERNAL
public static final int ID_INTERNAL
- See Also:
- Constant Field Values
-
ID_EXTERNAL
public static final int ID_EXTERNAL
- See Also:
- Constant Field Values
-
ID_ANNOTATED
public static final int ID_ANNOTATED
- See Also:
- Constant Field Values
-
ID_UNKNOWN
public static final int ID_UNKNOWN
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceorg.infinispan.commons.marshall.Marshaller- Specified by:
startin interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
stop
public void stop()
- Specified by:
stopin interfaceorg.infinispan.commons.marshall.Marshaller- Specified by:
stopin interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
getPersistenceMarshaller
public PersistenceMarshaller getPersistenceMarshaller()
-
objectToByteBuffer
public byte[] objectToByteBuffer(Object obj) throws IOException, InterruptedException
- Specified by:
objectToByteBufferin interfaceorg.infinispan.commons.marshall.Marshaller- Throws:
IOExceptionInterruptedException
-
objectFromByteBuffer
public Object objectFromByteBuffer(byte[] buf) throws IOException, ClassNotFoundException
- Specified by:
objectFromByteBufferin interfaceorg.infinispan.commons.marshall.Marshaller- Throws:
IOExceptionClassNotFoundException
-
startObjectOutput
public ObjectOutput startObjectOutput(OutputStream os, boolean isReentrant, int estimatedSize) throws IOException
- Specified by:
startObjectOutputin interfaceorg.infinispan.commons.marshall.StreamingMarshaller- Throws:
IOException
-
objectToObjectStream
public void objectToObjectStream(Object obj, ObjectOutput out) throws IOException
- Specified by:
objectToObjectStreamin interfaceorg.infinispan.commons.marshall.StreamingMarshaller- Throws:
IOException
-
finishObjectOutput
public void finishObjectOutput(ObjectOutput oo)
- Specified by:
finishObjectOutputin interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
objectFromByteBuffer
public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException
- Specified by:
objectFromByteBufferin interfaceorg.infinispan.commons.marshall.Marshaller- Throws:
IOExceptionClassNotFoundException
-
objectFromInputStream
public Object objectFromInputStream(InputStream is) throws IOException, ClassNotFoundException
- Specified by:
objectFromInputStreamin interfaceorg.infinispan.commons.marshall.StreamingMarshaller- Throws:
IOExceptionClassNotFoundException
-
isMarshallable
public boolean isMarshallable(Object o) throws Exception
- Specified by:
isMarshallablein interfaceorg.infinispan.commons.marshall.Marshaller- Throws:
Exception
-
getBufferSizePredictor
public org.infinispan.commons.marshall.BufferSizePredictor getBufferSizePredictor(Object o)
- Specified by:
getBufferSizePredictorin interfaceorg.infinispan.commons.marshall.Marshaller
-
mediaType
public org.infinispan.commons.dataconversion.MediaType mediaType()
- Specified by:
mediaTypein interfaceorg.infinispan.commons.marshall.Marshaller
-
objectToBuffer
public org.infinispan.commons.io.ByteBuffer objectToBuffer(Object o) throws IOException, InterruptedException
- Specified by:
objectToBufferin interfaceorg.infinispan.commons.marshall.Marshaller- Throws:
IOExceptionInterruptedException
-
objectToByteBuffer
public byte[] objectToByteBuffer(Object obj, int estimatedSize) throws IOException, InterruptedException
- Specified by:
objectToByteBufferin interfaceorg.infinispan.commons.marshall.Marshaller- Throws:
IOExceptionInterruptedException
-
startObjectInput
public ObjectInput startObjectInput(InputStream is, boolean isReentrant)
- Specified by:
startObjectInputin interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
finishObjectInput
public void finishObjectInput(ObjectInput oi)
- Specified by:
finishObjectInputin interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
objectFromObjectStream
public Object objectFromObjectStream(ObjectInput in)
- Specified by:
objectFromObjectStreamin interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
findExternalizerFor
public <T> org.infinispan.commons.marshall.Externalizer<T> findExternalizerFor(Object obj)
-
getInteralExternalizer
public static org.infinispan.commons.marshall.AdvancedExternalizer getInteralExternalizer(GlobalMarshaller gm, Class<?> clazz)
-
getExternalExternalizer
public static org.infinispan.commons.marshall.AdvancedExternalizer getExternalExternalizer(GlobalMarshaller gm, Class<?> clazz)
-
readObjectFromObjectInput
public static Object readObjectFromObjectInput(GlobalMarshaller gm, ObjectInput in) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
writeUnknown
public static void writeUnknown(org.infinispan.commons.marshall.Marshaller marshaller, Object obj, ObjectOutput out) throws IOException- Throws:
IOException
-
writeInternalClean
public static void writeInternalClean(Object obj, org.infinispan.commons.marshall.AdvancedExternalizer ext, ObjectOutput out)
-
writeExternalClean
public static void writeExternalClean(Object obj, org.infinispan.commons.marshall.AdvancedExternalizer ext, ObjectOutput out)
-
-