public class JdkMarshaller extends AbstractNodeNameAwareMarshaller
Marshaller
based on JDK serialization mechanism.
JdkMarshaller
needs to be explicitly configured to override default binary marshaller -
see IgniteBinary
.
JdkMarshaller marshaller = new JdkMarshaller(); IgniteConfiguration cfg = new IgniteConfiguration(); // Override default marshaller. cfg.setMarshaller(marshaller); // Starts grid. G.start(cfg);
<bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" singleton="true"> ... <property name="marshaller"> <bean class="org.apache.ignite.marshaller.jdk.JdkMarshaller"/> </property> ... </bean>
For information about Spring framework visit www.springframework.org
Modifier and Type | Field and Description |
---|---|
static JdkMarshaller |
DEFAULT
Default instance.
|
ctx, DFLT_BUFFER_SIZE
Constructor and Description |
---|
JdkMarshaller()
Default constructor.
|
JdkMarshaller(IgnitePredicate<String> clsFilter) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
marshal0(@Nullable Object obj)
Marshals object to byte array.
|
protected void |
marshal0(@Nullable Object obj,
OutputStream out)
Marshals object to the output stream.
|
void |
onUndeploy(ClassLoader ldr)
Undeployment callback invoked when class loader is being undeployed.
|
String |
toString() |
protected <T> T |
unmarshal0(byte[] arr,
@Nullable ClassLoader clsLdr)
Unmarshals object from byte array using given class loader.
|
protected <T> T |
unmarshal0(InputStream in,
@Nullable ClassLoader clsLdr)
Unmarshals object from the input stream using given class loader.
|
marshal, marshal, nodeName, unmarshal, unmarshal
getContext, setContext
public static final JdkMarshaller DEFAULT
public JdkMarshaller()
public JdkMarshaller(IgnitePredicate<String> clsFilter)
clsFilter
- Class name filter.protected void marshal0(@Nullable @Nullable Object obj, OutputStream out) throws IgniteCheckedException
marshal0
in class AbstractNodeNameAwareMarshaller
obj
- Object to marshal. null
object will be marshaled to binary null
representation.out
- Output stream to marshal into.IgniteCheckedException
- If marshalling failed.protected byte[] marshal0(@Nullable @Nullable Object obj) throws IgniteCheckedException
marshal0
in class AbstractNodeNameAwareMarshaller
obj
- Object to marshal. null
object will be marshaled to binary null
representation.IgniteCheckedException
- If marshalling failed.protected <T> T unmarshal0(InputStream in, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedException
unmarshal0
in class AbstractNodeNameAwareMarshaller
T
- Type of unmarshalled object.in
- Input stream.clsLdr
- If not null
then given class loader will be used for unmarshal object.IgniteCheckedException
- If unmarshalling failed.protected <T> T unmarshal0(byte[] arr, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedException
unmarshal0
in class AbstractNodeNameAwareMarshaller
T
- Type of unmarshalled object.arr
- Byte array.clsLdr
- If not null
then given class loader will be used for unmarshal object.IgniteCheckedException
- If unmarshalling failed.public void onUndeploy(ClassLoader ldr)
onUndeploy
in class AbstractMarshaller
ldr
- Class loader being undeployed.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024