Package org.apache.ignite.marshaller.jdk
Class JdkMarshallerImpl
- java.lang.Object
-
- org.apache.ignite.marshaller.AbstractMarshaller
-
- org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller
-
- org.apache.ignite.marshaller.jdk.JdkMarshallerImpl
-
- All Implemented Interfaces:
JdkMarshaller,Marshaller
public class JdkMarshallerImpl extends AbstractNodeNameAwareMarshaller implements JdkMarshaller
Implementation ofMarshallerbased on JDK serialization mechanism.Configuration
Mandatory
This marshaller has no mandatory configuration parameters.Java Example
JdkMarshallerneeds to be explicitly configured to override default binary marshaller - seeIgniteBinary.JdkMarshaller marshaller = new JdkMarshaller(); IgniteConfiguration cfg = new IgniteConfiguration(); // Override default marshaller. cfg.setMarshaller(marshaller); // Starts grid. G.start(cfg);
Spring Example
JdkMarshaller can be configured from Spring XML configuration file:<bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration" singleton="true"> ... <property name="marshaller"> <bean class="org.apache.ignite.marshaller.MarshallersFactory"/> </property> ... </bean>
For information about Spring framework visit www.springframework.org
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.marshaller.AbstractMarshaller
ctx, DFLT_BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description JdkMarshallerImpl()Default constructor.JdkMarshallerImpl(@Nullable IgnitePredicate<String> clsFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]marshal0(@Nullable Object obj)protected voidmarshal0(@Nullable Object obj, OutputStream out)voidonUndeploy(ClassLoader ldr)StringtoString()protected <T> Tunmarshal0(byte[] arr, @Nullable ClassLoader clsLdr)protected <T> Tunmarshal0(InputStream in, @Nullable ClassLoader clsLdr)-
Methods inherited from class org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller
marshal, marshal, nodeName, unmarshal, unmarshal
-
Methods inherited from class org.apache.ignite.marshaller.AbstractMarshaller
getContext, setContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.marshaller.Marshaller
marshal, marshal, nodeName, setContext, unmarshal, unmarshal
-
-
-
-
Constructor Detail
-
JdkMarshallerImpl
public JdkMarshallerImpl()
Default constructor. Use this constructor with caution. It creates a JdkMarshaller instance that has class filtering DISABLED. Therefore, if it will be used on the server side to unmarshal user data received from the network, it may lead to security breaches.
-
JdkMarshallerImpl
public JdkMarshallerImpl(@Nullable @Nullable IgnitePredicate<String> clsFilter)- Parameters:
clsFilter- Class name filter.
-
-
Method Detail
-
marshal0
protected void marshal0(@Nullable @Nullable Object obj, OutputStream out) throws IgniteCheckedException- Specified by:
marshal0in classAbstractNodeNameAwareMarshaller- Throws:
IgniteCheckedException
-
marshal0
protected byte[] marshal0(@Nullable @Nullable Object obj) throws IgniteCheckedException- Specified by:
marshal0in classAbstractNodeNameAwareMarshaller- Throws:
IgniteCheckedException
-
unmarshal0
protected <T> T unmarshal0(InputStream in, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedException
- Specified by:
unmarshal0in classAbstractNodeNameAwareMarshaller- Throws:
IgniteCheckedException
-
unmarshal0
protected <T> T unmarshal0(byte[] arr, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedException- Specified by:
unmarshal0in classAbstractNodeNameAwareMarshaller- Throws:
IgniteCheckedException
-
onUndeploy
public void onUndeploy(ClassLoader ldr)
- Specified by:
onUndeployin interfaceMarshaller
-
-