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.Serializable
Wraps an object when it is being sent over a channel by theDataSerializationFilter
so that it includes aNetChannelLocation
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 Classes Modifier and Type Class Description private class
DynamicClassLoaderMessage.AdvancedInputStreamFactory
Factory for creating instances ofAdvancedObjectInputStream
bound to a given class manager.private class
DynamicClassLoaderMessage.AdvancedObjectInputStream
This allows a custom ClassLoader to be used to resolve the object being deserialized.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoader
classLoaderToUse
The class loader to use when deserializing the object.private NetChannelLocation
classSourceChannelLoc
The location of the request channel of the sender's JFTP process.private long
createTime
Creation timestamp.private SerializedData
serializedData
The serialized form of the user object being sent.
-
Constructor Summary
Constructors Constructor Description DynamicClassLoaderMessage(java.lang.Object data, NetChannelLocation classSourceChannelLoc)
Creates a newDynamicClassLoaderMessage
encapsulating the given object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get(ClassManager cm)
Public accessor to deserialize and retrieve the object using the specifiedClassManager
.void
setClassLoader(java.lang.ClassLoader classLoader)
Sets the class loader to use when deserializing the object.java.lang.String
toString()
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.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:
java.io.NotSerializableException
java.io.IOException
-
-
Method Detail
-
toString
public java.lang.String toString()
Diagnostic string identifying the message by timestamp.- Overrides:
toString
in 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.ClassNotFoundException
java.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.
-
-