edu.rit.m2mi
Class UniInvocation

java.lang.Object
  extended by edu.rit.m2mi.Invocation
      extended by edu.rit.m2mi.UniInvocation
All Implemented Interfaces:
Externalizable, Serializable

public class UniInvocation
extends Invocation

Class UniInvocation provides an invocation object for a unihandle invocation in M2MI.

Note: Class UniInvocation is multiple thread safe.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.rit.m2mi.Invocation
myEoid, myMethodDescriptor, myMethodInvoker, myTargetObjects
 
Constructor Summary
UniInvocation()
          Construct a new unihandle invocation object.
UniInvocation(Eoid theEoid, MethodDescriptor theMethodDescriptor, MethodInvoker theMethodInvoker)
          Construct a new unihandle invocation object with the given EOID, method descriptor, and method invoker.
 
Method Summary
protected  byte[] getMessagePrefix()
          Obtain the M2MP message prefix corresponding to this unihandle invocation object.
protected  Iterator getTargetObjects()
          Determine the target objects that this unihandle invocation object will invoke.
 void processFromHandle()
          Process this unihandle invocation, assuming it was created as a result of calling a method on a unihandle.
 void processFromMessage()
          Process this unihandle invocation, assuming it was created from an incoming M2MI message.
 void readExternal(ObjectInput theObjectInput)
          Read this unihandle invocation object from the given object input stream.
 void writeExternal(ObjectOutput theObjectOutput)
          Write this unihandle invocation object to the given object output stream.
 
Methods inherited from class edu.rit.m2mi.Invocation
invoke, nextTargetObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniInvocation

public UniInvocation()
Construct a new unihandle invocation object. The invocation object's EOID, method descriptor, and method invoker are initialized to null. Their values must be filled in by calling the readExternal() method.


UniInvocation

public UniInvocation(Eoid theEoid,
                     MethodDescriptor theMethodDescriptor,
                     MethodInvoker theMethodInvoker)
Construct a new unihandle invocation object with the given EOID, method descriptor, and method invoker.

Parameters:
theEoid - EOID.
theMethodDescriptor - Method descriptor.
theMethodInvoker - Method invoker.
Throws:
NullPointerException - (unchecked exception) Thrown if any argument is null.
Method Detail

writeExternal

public void writeExternal(ObjectOutput theObjectOutput)
                   throws IOException
Write this unihandle invocation object to the given object output stream.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class Invocation
Parameters:
theObjectOutput - Object output stream.
Throws:
IOException - Thrown if an I/O error occurred.

readExternal

public void readExternal(ObjectInput theObjectInput)
                  throws ClassNotFoundException,
                         IOException
Read this unihandle invocation object from the given object input stream. It assumes the stream was written by writeExternal().

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class Invocation
Parameters:
theObjectInput - Object input stream.
Throws:
ClassNotFoundException - Thrown if the class for an object being deserialized cannot be found.
IOException - Thrown if an I/O error occurred.

processFromHandle

public void processFromHandle()
Process this unihandle invocation, assuming it was created as a result of calling a method on a unihandle. This method goes to the M2MI Layer to broadcast this invocation in an outgoing M2MI message if necessary, and to invoke any target objects exported in the M2MI Layer if necessary.

Specified by:
processFromHandle in class Invocation
Throws:
InvocationException - (unchecked exception) Thrown if there was a problem processing the invocation.

processFromMessage

public void processFromMessage()
Process this unihandle invocation, assuming it was created from an incoming M2MI message. This method goes to the M2MI Layer to invoke any

Specified by:
processFromMessage in class Invocation
Throws:
InvocationException - (unchecked exception) Thrown if there was a problem processing the invocation. target objects exported in the M2MI Layer.

getMessagePrefix

protected byte[] getMessagePrefix()
Obtain the M2MP message prefix corresponding to this unihandle invocation object. This method goes to the M2MI Layer to determine the appropriate message prefix.

Specified by:
getMessagePrefix in class Invocation
Returns:
Message prefix.

getTargetObjects

protected Iterator getTargetObjects()
Determine the target objects that this unihandle invocation object will invoke. This method goes to the M2MI Layer to determine the appropriate target objects.

Specified by:
getTargetObjects in class Invocation
Returns:
Iterator for visiting all the target objects.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.