|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.m2mi.Handle
edu.rit.m2mi.Unihandle
public class Unihandle
Class Unihandle is the base class for all M2MI unihandle objects. An actual unihandle class is a synthesized subclass of class Unihandle which implements the handle's target interface(s). Calling a target interface method on a unihandle object causes M2MI invocations to be performed on the target object to which the unihandle refers, namely, the object attached when the unihandle was created.
While instances of class Unihandle can be constructed, this is intended only for use during object serialization. When a synthesized unihandle is serialized into an object output stream, the synthesized unihandle replaces itself in the stream with an instance of class Unihandle containing the same EOID and target interface list. When an instance of class Unihandle is deserialized from an object input stream, the unihandle synthesizes the proper subclass, creates an instance of the synthesized subclass containing the same EOID and target interface list, and replaces itself with the subclass instance. In this way unihandle objects can be transported across the network without needing to transport the synthesized subclasses.
Field Summary |
---|
Fields inherited from class edu.rit.m2mi.Handle |
---|
myEoid, myInvocationFactory, myTargetInterface |
Constructor Summary | |
---|---|
Unihandle()
Construct a new unihandle. |
|
Unihandle(Eoid theEoid,
Class theTargetInterface)
Construct a new unihandle with the given EOID and target interface. |
Method Summary | |
---|---|
void |
attach(Object theObject)
Attach the given object to this unihandle. |
void |
detach()
Detach the target object from this unihandle. |
boolean |
equals(Object theObject)
Determine if this unihandle is equal to the given object. |
int |
hashCode()
Returns a hash code for this unihandle. |
boolean |
invokes(Object theObject)
Determine if a method invocation on this unihandle will be executed by the given object. |
Iterator |
iterator()
Obtain an iterator for visiting the objects associated with this unihandle. |
void |
readExternal(ObjectInput theObjectInput)
Read this unihandle from the given object input stream. |
String |
toString()
Returns a string version of this unihandle. |
void |
writeExternal(ObjectOutput theObjectOutput)
Write this unihandle to the given object output stream. |
Methods inherited from class edu.rit.m2mi.Handle |
---|
getEoid, getInterface, getInterfaceName, isExportedEoid, isExportedInterface, iteratorEoid, iteratorInterface, setEoid, setInvocationFactory, setTargetInterface |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Unihandle()
public Unihandle(Eoid theEoid, Class theTargetInterface)
theEoid
- EOID.theTargetInterface
- Target interface list.Method Detail |
---|
public boolean invokes(Object theObject)
invokes
in class Handle
theObject
- Object to test.
IllegalStateException
- (unchecked exception) Thrown if the M2MI layer is not initialized.public Iterator iterator()
iterator
in class Handle
public void attach(Object theObject)
theObject
- Object.
IllegalStateException
- (unchecked exception) Thrown if the M2MI layer is not initialized.
Thrown if this unihandle is not attached to an object exported in the
M2MI layer of the executing process.
NullPointerException
- (unchecked exception) Thrown if theObject is null.
ClassCastException
- (unchecked exception) Thrown if neither theObject's class
nor any of its superclasses implements this unihandle's target
interface.
ExportException
- (unchecked exception) Thrown if there was a problem exporting the
object.public void detach()
IllegalStateException
- (unchecked exception) Thrown if the M2MI layer is not initialized.
Thrown if this unihandle is not attached to an object exported in the
M2MI layer of the executing process.
ExportException
- (unchecked exception) Thrown if there was a problem unexporting the
object.public void writeExternal(ObjectOutput theObjectOutput) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class Handle
theObjectOutput
- Object output stream.
IOException
- Thrown if an I/O error occurred.public void readExternal(ObjectInput theObjectInput) throws ClassNotFoundException, IOException
readExternal
in interface Externalizable
readExternal
in class Handle
theObjectInput
- Object input stream.
ClassNotFoundException
- Thrown if the class for an object being deserialized cannot be found.
IOException
- Thrown if an I/O error occurred.public boolean equals(Object theObject)
equals
in class Object
theObject
- Object to test.
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |