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 classFactory for creating instances ofAdvancedObjectInputStreambound to a given class manager.private classThis allows a custom ClassLoader to be used to resolve the object being deserialized. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ClassLoaderThe class loader to use when deserializing the object.private final NetChannelLocationThe location of the request channel of the sender's JFTP process.private longCreation timestamp.private SerializedDataThe serialized form of the user object being sent. -
Constructor Summary
ConstructorsConstructorDescriptionDynamicClassLoaderMessage(Object data, NetChannelLocation classSourceChannelLoc) Creates a newDynamicClassLoaderMessageencapsulating the given object. -
Method Summary
Modifier and TypeMethodDescriptionget(ClassManager cm) Public accessor to deserialize and retrieve the object using the specifiedClassManager.voidsetClassLoader(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 newDynamicClassLoaderMessageencapsulating the given object.- Parameters:
data- the actual user object being sent.classSourceChannelLoc- the request channel of the JFTP process.- Throws:
NotSerializableExceptionIOException
-
-
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:
ClassNotFoundExceptionIOException
-
setClassLoader
Sets the class loader to use when deserializing the object.- Parameters:
classLoader- the new class loader.
-