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
-
-
Constructor Summary
Constructors Constructor Description GlobalMarshaller()
GlobalMarshaller(org.infinispan.commons.marshall.Marshaller external)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> org.infinispan.commons.marshall.Externalizer<T>
findExternalizerFor(Object obj)
void
finishObjectInput(ObjectInput oi)
void
finishObjectOutput(ObjectOutput oo)
org.infinispan.commons.marshall.BufferSizePredictor
getBufferSizePredictor(Object o)
boolean
isMarshallable(Object o)
org.infinispan.commons.dataconversion.MediaType
mediaType()
Object
objectFromByteBuffer(byte[] buf)
Object
objectFromByteBuffer(byte[] bytes, int offset, int len)
Object
objectFromInputStream(InputStream is)
Object
objectFromObjectStream(ObjectInput in)
org.infinispan.commons.io.ByteBuffer
objectToBuffer(Object o)
byte[]
objectToByteBuffer(Object obj)
byte[]
objectToByteBuffer(Object obj, int estimatedSize)
void
objectToObjectStream(Object obj, ObjectOutput out)
void
start()
org.infinispan.commons.marshall.Marshaller
startDefaultExternalMarshaller(GlobalConfiguration globalCfg)
ObjectInput
startObjectInput(InputStream is, boolean isReentrant)
ObjectOutput
startObjectOutput(OutputStream os, boolean isReentrant, int estimatedSize)
void
stop()
void
stopDefaultExternalMarshaller()
-
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
startDefaultExternalMarshaller
public org.infinispan.commons.marshall.Marshaller startDefaultExternalMarshaller(GlobalConfiguration globalCfg)
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
stopDefaultExternalMarshaller
public void stopDefaultExternalMarshaller()
-
objectToByteBuffer
public byte[] objectToByteBuffer(Object obj) throws IOException, InterruptedException
- Specified by:
objectToByteBuffer
in interfaceorg.infinispan.commons.marshall.Marshaller
- Throws:
IOException
InterruptedException
-
objectFromByteBuffer
public Object objectFromByteBuffer(byte[] buf) throws IOException, ClassNotFoundException
- Specified by:
objectFromByteBuffer
in interfaceorg.infinispan.commons.marshall.Marshaller
- Throws:
IOException
ClassNotFoundException
-
startObjectOutput
public ObjectOutput startObjectOutput(OutputStream os, boolean isReentrant, int estimatedSize) throws IOException
- Specified by:
startObjectOutput
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
- Throws:
IOException
-
objectToObjectStream
public void objectToObjectStream(Object obj, ObjectOutput out) throws IOException
- Specified by:
objectToObjectStream
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
- Throws:
IOException
-
finishObjectOutput
public void finishObjectOutput(ObjectOutput oo)
- Specified by:
finishObjectOutput
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
objectFromByteBuffer
public Object objectFromByteBuffer(byte[] bytes, int offset, int len) throws IOException, ClassNotFoundException
- Specified by:
objectFromByteBuffer
in interfaceorg.infinispan.commons.marshall.Marshaller
- Throws:
IOException
ClassNotFoundException
-
objectFromInputStream
public Object objectFromInputStream(InputStream is) throws IOException, ClassNotFoundException
- Specified by:
objectFromInputStream
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
- Throws:
IOException
ClassNotFoundException
-
isMarshallable
public boolean isMarshallable(Object o) throws Exception
- Specified by:
isMarshallable
in interfaceorg.infinispan.commons.marshall.Marshaller
- Throws:
Exception
-
getBufferSizePredictor
public org.infinispan.commons.marshall.BufferSizePredictor getBufferSizePredictor(Object o)
- Specified by:
getBufferSizePredictor
in interfaceorg.infinispan.commons.marshall.Marshaller
-
mediaType
public org.infinispan.commons.dataconversion.MediaType mediaType()
- Specified by:
mediaType
in interfaceorg.infinispan.commons.marshall.Marshaller
-
objectToBuffer
public org.infinispan.commons.io.ByteBuffer objectToBuffer(Object o) throws IOException, InterruptedException
- Specified by:
objectToBuffer
in interfaceorg.infinispan.commons.marshall.Marshaller
- Throws:
IOException
InterruptedException
-
objectToByteBuffer
public byte[] objectToByteBuffer(Object obj, int estimatedSize) throws IOException, InterruptedException
- Specified by:
objectToByteBuffer
in interfaceorg.infinispan.commons.marshall.Marshaller
- Throws:
IOException
InterruptedException
-
startObjectInput
public ObjectInput startObjectInput(InputStream is, boolean isReentrant)
- Specified by:
startObjectInput
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
finishObjectInput
public void finishObjectInput(ObjectInput oi)
- Specified by:
finishObjectInput
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
objectFromObjectStream
public Object objectFromObjectStream(ObjectInput in)
- Specified by:
objectFromObjectStream
in interfaceorg.infinispan.commons.marshall.StreamingMarshaller
-
findExternalizerFor
public <T> org.infinispan.commons.marshall.Externalizer<T> findExternalizerFor(Object obj)
-
-