|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GridMarshaller
GridMarshaller allows to marshal or unmarshal objects in grid. It provides
serialization/deserialization mechanism for all instances that are sent across networks
or are otherwise serialized.
Gridgain provides the following GridMarshaller implementations:
Below are examples of marshaller configuration, usage, and injection into tasks, jobs, and SPI's.
GridMarshaller can be explicitely configured in code.
GridJbossMarshaller marshaller = new GridJbossMarshaller(); GridConfigurationAdapter cfg = new GridConfigurationAdapter(); // Override marshaller. cfg.setMarshaller(marshaller); // Starts grid. G.start(cfg);
<bean id="grid.custom.cfg" class="org.gridgain.grid.GridConfigurationAdapter" singleton="true">
...
<property name="marshaller">
<bean class="org.gridgain.grid.marshaller.jboss.GridJBossMarshaller"/>
</property>
...
</bean>
For information about Spring framework visit www.springframework.org
public class MyGridJob implements GridJob {
...
@GridMarshallerResource
private GridMarshaller marshaller;
public Serializable execute() {
// Use marshaller to serialize/deserialize any object.
...
}
}
or
public class MyGridJob implements GridJob {
...
private GridMarshaller marshaller;
...
@GridMarshallerResource
public void setMarshaller(GridMarshaller marshaller) {
this.marshaller = marshaller;
}
...
}
| Wiki | |
| Forum |

| Method Summary | ||
|---|---|---|
void |
marshal(Object obj,
OutputStream out)
Marshals object to the output stream. |
|
|
unmarshal(InputStream in,
ClassLoader clsLdr)
Unmarshalls object from the output stream using given class loader. |
|
| Method Detail |
|---|
void marshal(@Nullable
Object obj,
OutputStream out)
throws GridException
GridException - If marshalling failed.obj - Object to marshal.out - Output stream to marshal into.<T> T unmarshal(InputStream in, @Nullable ClassLoader clsLdr) throws GridException
GridException - If unmarshalling failed.T - Type of unmarshalled object.in - Input stream.clsLdr - Class loader to use.
|
GridGain 3.6.0e
Enterprise Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
|
GridGain - Real Time Big Data
|
|
|