Package org.jcsp.net.dynamic
Class DynamicClassLoaderMessage
java.lang.Object
org.jcsp.net.dynamic.DynamicClassLoaderMessage
- All Implemented Interfaces:
Serializable
Wraps an object when it is being sent over a channel by the
DataSerializationFilter
so
that it includes a NetChannelLocation
referring to the JFTP request channel to service
requests for the class's binary image if it is not held at the receiving end.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Factory for creating instances ofAdvancedObjectInputStream
bound to a given class manager.private class
This allows a custom ClassLoader to be used to resolve the object being deserialized. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassLoader
The class loader to use when deserializing the object.private final NetChannelLocation
The location of the request channel of the sender's JFTP process.private long
Creation timestamp.private SerializedData
The serialized form of the user object being sent. -
Constructor Summary
ConstructorsConstructorDescriptionDynamicClassLoaderMessage
(Object data, NetChannelLocation classSourceChannelLoc) Creates a newDynamicClassLoaderMessage
encapsulating the given object. -
Method Summary
Modifier and TypeMethodDescriptionget
(ClassManager cm) Public accessor to deserialize and retrieve the object using the specifiedClassManager
.void
setClassLoader
(ClassLoader classLoader) Sets the class loader to use when deserializing the object.toString()
Diagnostic string identifying the message by timestamp.
-
Field Details
-
createTime
private long createTimeCreation timestamp. -
classLoaderToUse
The class loader to use when deserializing the object. This is not sent as part of the message - it is for use by methods invoked by the receiver. -
classSourceChannelLoc
The location of the request channel of the sender's JFTP process. -
serializedData
The serialized form of the user object being sent.
-
-
Constructor Details
-
DynamicClassLoaderMessage
public DynamicClassLoaderMessage(Object data, NetChannelLocation classSourceChannelLoc) throws NotSerializableException, IOException Creates a newDynamicClassLoaderMessage
encapsulating the given object.- Parameters:
data
- the actual user object being sent.classSourceChannelLoc
- the request channel of the JFTP process.- Throws:
NotSerializableException
IOException
-
-
Method Details
-
toString
Diagnostic string identifying the message by timestamp. -
get
Public accessor to deserialize and retrieve the object using the specifiedClassManager
.- Parameters:
cm
- the class manager to use.- Returns:
- the user object passed in this message.
- Throws:
ClassNotFoundException
IOException
-
setClassLoader
Sets the class loader to use when deserializing the object.- Parameters:
classLoader
- the new class loader.
-