|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.m2mi.Invocation
public abstract class Invocation
Class Invocation is the abstract base class for all invocation objects in M2MI.
When a method is invoked on a handle, the handle creates an invocation object of the proper kind and hands the invocation object off to the M2MI Layer. The invocation object contains the following information:
Eoid
-- either a wildcard value for an omnihandle invocation,
or a specific value for a multihandle or unihandle invocation.
MethodDescriptor
-- gives the target interface name, target
method name, and argument types.
MethodInvoker
-- gives the argument values.
The M2MI Layer uses the invocation object to find all the locally-exported target objects that need to perform the invocation, and to actually do the invocations on those target objects. The M2MI Layer also broadcasts the invocation object by sending it in an M2MP message -- an M2MI invocation message is just a message prefix followed by a serialized invocation object. When some other process's M2MI Layer receives an M2MI invocation message, the M2MI Layer deserializes the invocation object, then uses the invocation object to actually do the invocations.
Subclasses of class Invocation define the behavior for these two aspects:
Note: Class Invocation is multiple thread safe.
Field Summary | |
---|---|
protected Eoid |
myEoid
Exported object identifier. |
protected MethodDescriptor |
myMethodDescriptor
Method descriptor. |
protected MethodInvoker |
myMethodInvoker
Method invoker. |
protected Iterator |
myTargetObjects
Iterator for visiting all the target objects. |
Constructor Summary | |
---|---|
Invocation()
Construct a new invocation object. |
|
Invocation(Eoid theEoid,
MethodDescriptor theMethodDescriptor,
MethodInvoker theMethodInvoker)
Construct a new invocation object with the given EOID, method descriptor, and method invoker. |
Method Summary | |
---|---|
protected abstract byte[] |
getMessagePrefix()
Obtain the M2MP message prefix corresponding to this invocation object. |
protected abstract Iterator |
getTargetObjects()
Determine the target objects that this invocation object will invoke. |
void |
invoke(Object theTargetObject)
Perform the invocation specified by this invocation object's method invoker on the given target object. |
Object |
nextTargetObject()
Obtain the next target object that this invocation will invoke. |
abstract void |
processFromHandle()
Process this invocation, assuming it was created as a result of calling a method on a handle. |
abstract void |
processFromMessage()
Process this invocation, assuming it was created from an incoming M2MI message. |
void |
readExternal(ObjectInput theObjectInput)
Read this invocation object from the given object input stream. |
String |
toString()
Returns a string version of this invocation object. |
void |
writeExternal(ObjectOutput theObjectOutput)
Write this invocation object to the given object output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Eoid myEoid
protected MethodDescriptor myMethodDescriptor
protected MethodInvoker myMethodInvoker
protected Iterator myTargetObjects
Constructor Detail |
---|
public Invocation()
public Invocation(Eoid theEoid, MethodDescriptor theMethodDescriptor, MethodInvoker theMethodInvoker)
theEoid
- EOID.theMethodDescriptor
- Method descriptor.theMethodInvoker
- Method invoker.
NullPointerException
- (unchecked exception) Thrown if any argument is null.Method Detail |
---|
public void writeExternal(ObjectOutput theObjectOutput) throws IOException
writeExternal
in interface Externalizable
theObjectOutput
- Object output stream.
IOException
- Thrown if an I/O error occurred.public void readExternal(ObjectInput theObjectInput) throws ClassNotFoundException, IOException
readExternal
in interface Externalizable
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 abstract void processFromHandle()
InvocationException
- (unchecked exception) Thrown if there was a problem processing the
invocation.public abstract void processFromMessage()
InvocationException
- (unchecked exception) Thrown if there was a problem processing the
invocation.public Object nextTargetObject()
public void invoke(Object theTargetObject)
theTargetObject
- Target object.
NullPointerException
- (unchecked exception) Thrown if theTargetObject is null.
ClassCastException
- (unchecked exception) Thrown if theTargetObject is not an
instance of this invocation object's target interface.public String toString()
toString
in class Object
protected abstract byte[] getMessagePrefix()
protected abstract Iterator getTargetObjects()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |