Package org.jcsp.net.dynamic
Class DynamicClassLoaderMessage
- java.lang.Object
-
- org.jcsp.net.dynamic.DynamicClassLoaderMessage
-
- All Implemented Interfaces:
java.io.Serializable
class DynamicClassLoaderMessage extends java.lang.Object implements java.io.SerializableWraps an object when it is being sent over a channel by theDataSerializationFilterso that it includes aNetChannelLocationreferring 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 Classes Modifier and Type Class Description private classDynamicClassLoaderMessage.AdvancedInputStreamFactoryFactory for creating instances ofAdvancedObjectInputStreambound to a given class manager.private classDynamicClassLoaderMessage.AdvancedObjectInputStreamThis allows a custom ClassLoader to be used to resolve the object being deserialized.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderToUseThe class loader to use when deserializing the object.private NetChannelLocationclassSourceChannelLocThe location of the request channel of the sender's JFTP process.private longcreateTimeCreation timestamp.private SerializedDataserializedDataThe serialized form of the user object being sent.
-
Constructor Summary
Constructors Constructor Description DynamicClassLoaderMessage(java.lang.Object data, NetChannelLocation classSourceChannelLoc)Creates a newDynamicClassLoaderMessageencapsulating the given object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(ClassManager cm)Public accessor to deserialize and retrieve the object using the specifiedClassManager.voidsetClassLoader(java.lang.ClassLoader classLoader)Sets the class loader to use when deserializing the object.java.lang.StringtoString()Diagnostic string identifying the message by timestamp.
-
-
-
Field Detail
-
createTime
private long createTime
Creation timestamp.
-
classLoaderToUse
private transient java.lang.ClassLoader 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
private final NetChannelLocation classSourceChannelLoc
The location of the request channel of the sender's JFTP process.
-
serializedData
private SerializedData serializedData
The serialized form of the user object being sent.
-
-
Constructor Detail
-
DynamicClassLoaderMessage
public DynamicClassLoaderMessage(java.lang.Object data, NetChannelLocation classSourceChannelLoc) throws java.io.NotSerializableException, java.io.IOExceptionCreates a newDynamicClassLoaderMessageencapsulating the given object.- Parameters:
data- the actual user object being sent.classSourceChannelLoc- the request channel of the JFTP process.- Throws:
java.io.NotSerializableExceptionjava.io.IOException
-
-
Method Detail
-
toString
public java.lang.String toString()
Diagnostic string identifying the message by timestamp.- Overrides:
toStringin classjava.lang.Object
-
get
public java.lang.Object get(ClassManager cm) throws java.lang.ClassNotFoundException, java.io.IOException
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:
java.lang.ClassNotFoundExceptionjava.io.IOException
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader to use when deserializing the object.- Parameters:
classLoader- the new class loader.
-
-