Class AbstractJBossMarshaller
- java.lang.Object
-
- org.infinispan.commons.marshall.AbstractMarshaller
-
- org.infinispan.jboss.marshalling.commons.AbstractJBossMarshaller
-
- All Implemented Interfaces:
Marshaller,StreamingMarshaller
- Direct Known Subclasses:
GenericJBossMarshaller
@Deprecated public abstract class AbstractJBossMarshaller extends AbstractMarshaller implements StreamingMarshaller
Deprecated.since 11.0. To be removed in 14.0 ISPN-11947.Common parent for both embedded and standalone JBoss Marshalling-based marshallers.- Since:
- 5.0
- Author:
- Galder ZamarreƱo, Sanne Grinovero, Dan Berindei
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractJBossMarshaller.DebuggingExceptionListenerDeprecated.
-
Field Summary
Fields Modifier and Type Field Description protected org.jboss.marshalling.MarshallingConfigurationbaseCfgDeprecated.protected static intDEF_CLASS_COUNTDeprecated.protected static intDEF_INSTANCE_COUNTDeprecated.protected static JBossMarshallerFactoryfactoryDeprecated.protected static org.infinispan.commons.logging.LoglogDeprecated.-
Fields inherited from class org.infinispan.commons.marshall.AbstractMarshaller
marshallableTypeHints
-
-
Constructor Summary
Constructors Constructor Description AbstractJBossMarshaller()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidfinishObjectInput(ObjectInput oi)Deprecated.Finish using the given ObjectInput.voidfinishObjectOutput(ObjectOutput oo)Deprecated.Finish using the given ObjectOutput.booleanisMarshallable(Object o)Deprecated.A method that checks whether the given object is marshallable as per the rules of this marshaller.protected booleanisMarshallableCandidate(Object o)Deprecated.org.infinispan.commons.dataconversion.MediaTypemediaType()Deprecated.ObjectobjectFromByteBuffer(byte[] buf, int offset, int length)Deprecated.Unmarshalls an object from a specific portion of a byte array.ObjectobjectFromObjectStream(ObjectInput in)Deprecated.Unmarshalls an object from anObjectInputprotected ByteBufferobjectToBuffer(Object o, int estimatedSize)Deprecated.This is a convenience method for converting an object into aByteBufferwhich takes an estimated size as parameter.voidobjectToObjectStream(Object obj, ObjectOutput out)Deprecated.Marshalls an object to a givenObjectOutputvoidstart()Deprecated.Perform any initialization required before the marshaller is used.ObjectInputstartObjectInput(InputStream is, boolean isReentrant)Deprecated.Create and open a new ObjectInput for the given input stream.ObjectOutputstartObjectOutput(OutputStream os, boolean isReentrant, int estimatedSize)Deprecated.Create and open an ObjectOutput instance for the given output stream.voidstop()Deprecated.Stop the marshaller.-
Methods inherited from class org.infinispan.commons.marshall.AbstractMarshaller
getBufferSizePredictor, objectFromByteBuffer, objectFromInputStream, objectToBuffer, objectToByteBuffer, objectToByteBuffer
-
Methods inherited from interface org.infinispan.commons.marshall.Marshaller
getBufferSizePredictor, initialize, objectFromByteBuffer, objectToBuffer, objectToByteBuffer, objectToByteBuffer
-
Methods inherited from interface org.infinispan.commons.marshall.StreamingMarshaller
objectFromInputStream
-
-
-
-
Field Detail
-
log
protected static final org.infinispan.commons.logging.Log log
Deprecated.
-
factory
protected static final JBossMarshallerFactory factory
Deprecated.
-
DEF_INSTANCE_COUNT
protected static final int DEF_INSTANCE_COUNT
Deprecated.- See Also:
- Constant Field Values
-
DEF_CLASS_COUNT
protected static final int DEF_CLASS_COUNT
Deprecated.- See Also:
- Constant Field Values
-
baseCfg
protected final org.jboss.marshalling.MarshallingConfiguration baseCfg
Deprecated.
-
-
Method Detail
-
objectToObjectStream
public final void objectToObjectStream(Object obj, ObjectOutput out) throws IOException
Deprecated.Description copied from interface:StreamingMarshallerMarshalls an object to a givenObjectOutput- Specified by:
objectToObjectStreamin interfaceStreamingMarshaller- Parameters:
obj- object to marshallout- stream to marshall to- Throws:
IOException
-
objectToBuffer
protected final ByteBuffer objectToBuffer(Object o, int estimatedSize) throws IOException
Deprecated.Description copied from class:AbstractMarshallerThis is a convenience method for converting an object into aByteBufferwhich takes an estimated size as parameter. AByteBufferallows direct access to the byte array with minimal array copying- Specified by:
objectToBufferin classAbstractMarshaller- Parameters:
o- object to marshallestimatedSize- an estimate of how large the resulting byte array may be- Throws:
IOException
-
startObjectOutput
public final ObjectOutput startObjectOutput(OutputStream os, boolean isReentrant, int estimatedSize) throws IOException
Deprecated.Description copied from interface:StreamingMarshallerCreate and open an ObjectOutput instance for the given output stream. This method should be used for opening data outputs when multiple objectToObjectStream() calls will be made before the stream is closed by calling finishObjectOutput().
This method also takes a boolean that represents whether this particular call to startObjectOutput() is reentrant or not. A call to startObjectOutput() should be marked reentrant whenever a 2nd or more calls to this method are made without having called finishObjectOutput() first.
To potentially speed up calling startObjectOutput multiple times in a non-reentrant way, i.e. startObjectOutput/finishObjectOutput...startObjectOutput/finishObjectOutput...etc, which is is the most common case, the StreamingMarshaller implementation could potentially use some mechanisms to speed up this startObjectOutput call.
On the other hand, when a call is reentrant, i.e. startObjectOutput/startObjectOutput(reentrant)...finishObjectOutput/finishObjectOutput, the StreamingMarshaller implementation might treat it differently. An example of reentrancy would be marshalling of MarshalledValue. When sending or storing a MarshalledValue, a call to startObjectOutput() would occur so that the stream is open and following, a 2nd call could occur so that MarshalledValue's raw byte array version is calculated and sent across. This enables storing as binary on the receiver side which is performance gain. The StreamingMarshaller implementation could decide that it needs a separate ObjectOutput or similar for the 2nd call since it's aim is only to get the raw byte array version and the close finish with it.
- Specified by:
startObjectOutputin interfaceStreamingMarshaller- Parameters:
os- output streamisReentrant- whether the call is reentrant or not.estimatedSize- estimated size in bytes of the output. Only meant as a possible performance optimization.- Returns:
- ObjectOutput to write to
- Throws:
IOException
-
finishObjectOutput
public final void finishObjectOutput(ObjectOutput oo)
Deprecated.Description copied from interface:StreamingMarshallerFinish using the given ObjectOutput. After opening a ObjectOutput and calling objectToObjectStream() multiple times, use this method to flush the data and close if necessary- Specified by:
finishObjectOutputin interfaceStreamingMarshaller- Parameters:
oo- data output that finished using
-
objectFromByteBuffer
public final Object objectFromByteBuffer(byte[] buf, int offset, int length) throws IOException, ClassNotFoundException
Deprecated.Description copied from interface:MarshallerUnmarshalls an object from a specific portion of a byte array.- Specified by:
objectFromByteBufferin interfaceMarshaller- Parameters:
buf- byte array containing the binary representation of an object. Must not be null.offset- point in buffer to start readinglength- number of bytes to consider- Returns:
- an object
- Throws:
IOException- if unmarshalling cannot complete due to some I/O errorClassNotFoundException- if the class of the object trying to unmarshall is unknown
-
startObjectInput
public final ObjectInput startObjectInput(InputStream is, boolean isReentrant) throws IOException
Deprecated.Description copied from interface:StreamingMarshallerCreate and open a new ObjectInput for the given input stream. This method should be used for opening data inputs when multiple objectFromObjectStream() calls will be made before the stream is closed.
This method also takes a boolean that represents whether this particular call to startObjectInput() is reentrant or not. A call to startObjectInput() should be marked reentrant whenever a 2nd or more calls to this method are made without having called finishObjectInput() first.
To potentially speed up calling startObjectInput multiple times in a non-reentrant way, i.e. startObjectInput/finishObjectInput...startObjectInput/finishObjectInput...etc, which is is the most common case, the StreamingMarshaller implementation could potentially use some mechanisms to speed up this startObjectInput call.
- Specified by:
startObjectInputin interfaceStreamingMarshaller- Parameters:
is- input streamisReentrant- whether the call is reentrant or not.- Returns:
- ObjectInput to read from
- Throws:
IOException
-
objectFromObjectStream
public final Object objectFromObjectStream(ObjectInput in) throws IOException, ClassNotFoundException
Deprecated.Description copied from interface:StreamingMarshallerUnmarshalls an object from anObjectInput- Specified by:
objectFromObjectStreamin interfaceStreamingMarshaller- Parameters:
in- stream to unmarshall from- Throws:
IOException- if unmarshalling cannot complete due to some I/O errorClassNotFoundException- if the class of the object trying to unmarshall is unknown
-
finishObjectInput
public final void finishObjectInput(ObjectInput oi)
Deprecated.Description copied from interface:StreamingMarshallerFinish using the given ObjectInput. After opening a ObjectInput and calling objectFromObjectStream() multiple times, use this method to flush the data and close if necessary- Specified by:
finishObjectInputin interfaceStreamingMarshaller- Parameters:
oi- data input that finished using
-
isMarshallable
public boolean isMarshallable(Object o) throws Exception
Deprecated.Description copied from interface:MarshallerA method that checks whether the given object is marshallable as per the rules of this marshaller.- Specified by:
isMarshallablein interfaceMarshaller- Parameters:
o- object to verify whether it's marshallable or not- Returns:
- true if the object is marshallable, otherwise false
- Throws:
Exception- if while checking whether the object was serializable or not, an exception arose
-
start
public void start()
Deprecated.Description copied from interface:MarshallerPerform any initialization required before the marshaller is used.- Specified by:
startin interfaceMarshaller- Specified by:
startin interfaceStreamingMarshaller
-
stop
public void stop()
Deprecated.Description copied from interface:StreamingMarshallerStop the marshaller. Implementations of this method should clear up any cached data, or close any resources while marshalling/unmarshalling that have not been already closed.- Specified by:
stopin interfaceMarshaller- Specified by:
stopin interfaceStreamingMarshaller
-
isMarshallableCandidate
protected boolean isMarshallableCandidate(Object o)
Deprecated.
-
mediaType
public org.infinispan.commons.dataconversion.MediaType mediaType()
Deprecated.- Specified by:
mediaTypein interfaceMarshaller- Returns:
- the
MediaTypeassociated with the content produced by the marshaller
-
-