Package org.apache.ignite.marshaller.jdk
Class JdkMarshaller
- java.lang.Object
- 
- org.apache.ignite.marshaller.AbstractMarshaller
- 
- org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller
- 
- org.apache.ignite.marshaller.jdk.JdkMarshaller
 
 
 
- 
- All Implemented Interfaces:
- Marshaller
 
 public class JdkMarshaller extends AbstractNodeNameAwareMarshaller Implementation ofMarshallerbased on JDK serialization mechanism.ConfigurationMandatoryThis marshaller has no mandatory configuration parameters.Java ExampleJdkMarshallerneeds 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 ExampleJdkMarshaller 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.jdk.JdkMarshaller"/> </property> ... </bean>  
 For information about Spring framework visit www.springframework.org
- 
- 
Field Summary- 
Fields inherited from class org.apache.ignite.marshaller.AbstractMarshallerctx, DFLT_BUFFER_SIZE
 
- 
 - 
Constructor SummaryConstructors Constructor Description JdkMarshaller()Default constructor.JdkMarshaller(IgnitePredicate<String> clsFilter)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]marshal0(@Nullable Object obj)Marshals object to byte array.protected voidmarshal0(@Nullable Object obj, OutputStream out)Marshals object to the output stream.voidonUndeploy(ClassLoader ldr)Undeployment callback invoked when class loader is being undeployed.StringtoString()protected <T> Tunmarshal0(byte[] arr, @Nullable ClassLoader clsLdr)Unmarshals object from byte array using given class loader.protected <T> Tunmarshal0(InputStream in, @Nullable ClassLoader clsLdr)Unmarshals object from the input stream using given class loader.- 
Methods inherited from class org.apache.ignite.marshaller.AbstractNodeNameAwareMarshallermarshal, marshal, nodeName, unmarshal, unmarshal
 - 
Methods inherited from class org.apache.ignite.marshaller.AbstractMarshallergetContext, setContext
 
- 
 
- 
- 
- 
Constructor Detail- 
JdkMarshallerpublic JdkMarshaller() 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.
 - 
JdkMarshallerpublic JdkMarshaller(IgnitePredicate<String> clsFilter) - Parameters:
- clsFilter- Class name filter.
 
 
- 
 - 
Method Detail- 
marshal0protected void marshal0(@Nullable @Nullable Object obj, OutputStream out) throws IgniteCheckedExceptionMarshals object to the output stream. This method should not close given output stream.- Specified by:
- marshal0in class- AbstractNodeNameAwareMarshaller
- Parameters:
- obj- Object to marshal.- nullobject will be marshaled to binary- nullrepresentation.
- out- Output stream to marshal into.
- Throws:
- IgniteCheckedException- If marshalling failed.
 
 - 
marshal0protected byte[] marshal0(@Nullable @Nullable Object obj) throws IgniteCheckedExceptionMarshals object to byte array.- Specified by:
- marshal0in class- AbstractNodeNameAwareMarshaller
- Parameters:
- obj- Object to marshal.- nullobject will be marshaled to binary- nullrepresentation.
- Returns:
- Byte array.
- Throws:
- IgniteCheckedException- If marshalling failed.
 
 - 
unmarshal0protected <T> T unmarshal0(InputStream in, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedException Unmarshals object from the input stream using given class loader. This method should not close given input stream.- Specified by:
- unmarshal0in class- AbstractNodeNameAwareMarshaller
- Type Parameters:
- T- Type of unmarshalled object.
- Parameters:
- in- Input stream.
- clsLdr- If not- nullthen given class loader will be used for unmarshal object.
- Returns:
- Unmarshalled object.
- Throws:
- IgniteCheckedException- If unmarshalling failed.
 
 - 
unmarshal0protected <T> T unmarshal0(byte[] arr, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedExceptionUnmarshals object from byte array using given class loader.- Specified by:
- unmarshal0in class- AbstractNodeNameAwareMarshaller
- Type Parameters:
- T- Type of unmarshalled object.
- Parameters:
- arr- Byte array.
- clsLdr- If not- nullthen given class loader will be used for unmarshal object.
- Returns:
- Unmarshalled object.
- Throws:
- IgniteCheckedException- If unmarshalling failed.
 
 - 
onUndeploypublic void onUndeploy(ClassLoader ldr) Undeployment callback invoked when class loader is being undeployed. Some marshallers may want to clean their internal state that uses the undeployed class loader somehow.- Specified by:
- onUndeployin class- AbstractMarshaller
- Parameters:
- ldr- Class loader being undeployed.
 
 
- 
 
-