Package org.jcsp.net.dynamic
Class DeserializeChannelFilter
java.lang.Object
org.jcsp.net.dynamic.DeserializeChannelFilter
- All Implemented Interfaces:
Filter
This class is used in the dynamic class loading mechanism.
Instances of the class extract
Message
objects from SerializedMessage
objects.
Dynamic class loading can be enabled by using the constructor which takes a ClassManager
.
If dynamic class loading is enabled and a DynamicClassLoaderMessage
is filtered, the ClassManager
object 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
FieldsModifier and TypeFieldDescriptionprivate ClassManager
The class manger to use for classes dynamically received.private boolean
Set to true if dynamic class loading is enabled. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newDeserializeChannelFilter
with dynamic loading disabled.Constructs a newDeserializeChannelFilter
with a reference to a class manager. -
Method Summary
Modifier and TypeMethodDescriptionThis method takes an object and substitutes it for another object based upon the following rules: If the object is an instance of theDynamicClassLoaderMessage
class and dynamic class loading is enabled, then the filter will return the object returned by the supplied object's get method.
-
Field Details
-
cm
The class manger to use for classes dynamically received. -
dynamic
private boolean dynamicSet to true if dynamic class loading is enabled. If false, no filtering rules are applied.
-
-
Constructor Details
-
DeserializeChannelFilter
DeserializeChannelFilter(ClassManager cm) Constructs a newDeserializeChannelFilter
with a reference to a class manager.- Parameters:
cm
- the class manager to use for received classes.
-
DeserializeChannelFilter
DeserializeChannelFilter()Constructs a newDeserializeChannelFilter
with dynamic loading disabled.
-
-
Method Details
-
filter
This method takes an object and substitutes it for another object based upon the following rules: If the object is an instance of theDynamicClassLoaderMessage
class and dynamic class loading is enabled, then the filter will return the object returned by the supplied object's get method. AClassManager
will be supplied to the method. If the object is an instance of theSerializedMessage
class then the object's get method will be called. The message being held by theSerializedMessage
will be deserialized but classes will not be dynamically loaded. If the object is not aSerializedMessage
object, then the object itself will be returned without modification.
-