Package org.jcsp.net.dynamic
Class DeserializeChannelFilter
- java.lang.Object
-
- org.jcsp.net.dynamic.DeserializeChannelFilter
-
- All Implemented Interfaces:
Filter
class DeserializeChannelFilter extends java.lang.Object implements Filter
This class is used in the dynamic class loading mechanism. Instances of the class extractMessageobjects fromSerializedMessageobjects. Dynamic class loading can be enabled by using the constructor which takes aClassManager. If dynamic class loading is enabled and aDynamicClassLoaderMessageis filtered, theClassManagerobject is supplied to the Message object and the underlying message extracted. Any classes that need loading from the remote Node are requested and loaded as necessary.
-
-
Field Summary
Fields Modifier and Type Field Description private ClassManagercmThe class manger to use for classes dynamically received.private booleandynamicSet to true if dynamic class loading is enabled.
-
Constructor Summary
Constructors Constructor Description DeserializeChannelFilter()Constructs a newDeserializeChannelFilterwith dynamic loading disabled.DeserializeChannelFilter(ClassManager cm)Constructs a newDeserializeChannelFilterwith a reference to a class manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectfilter(java.lang.Object object)This method takes an object and substitutes it for another object based upon the following rules: If the object is an instance of theDynamicClassLoaderMessageclass and dynamic class loading is enabled, then the filter will return the object returned by the supplied object's get method.
-
-
-
Field Detail
-
cm
private ClassManager cm
The class manger to use for classes dynamically received.
-
dynamic
private boolean dynamic
Set to true if dynamic class loading is enabled. If false, no filtering rules are applied.
-
-
Constructor Detail
-
DeserializeChannelFilter
DeserializeChannelFilter(ClassManager cm)
Constructs a newDeserializeChannelFilterwith a reference to a class manager.- Parameters:
cm- the class manager to use for received classes.
-
DeserializeChannelFilter
DeserializeChannelFilter()
Constructs a newDeserializeChannelFilterwith dynamic loading disabled.
-
-
Method Detail
-
filter
public java.lang.Object filter(java.lang.Object object)
This method takes an object and substitutes it for another object based upon the following rules: If the object is an instance of theDynamicClassLoaderMessageclass and dynamic class loading is enabled, then the filter will return the object returned by the supplied object's get method. AClassManagerwill be supplied to the method. If the object is an instance of theSerializedMessageclass then the object's get method will be called. The message being held by theSerializedMessagewill be deserialized but classes will not be dynamically loaded. If the object is not aSerializedMessageobject, then the object itself will be returned without modification.
-
-