edu.rit.m2mi
Class OmniInvocation

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

public class OmniInvocation
extends Invocation

Class OmniInvocation provides an invocation object for an omnihandle invocation in M2MI.

Note: Class OmniInvocation is multiple thread safe.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.rit.m2mi.Invocation
myEoid, myMethodDescriptor, myMethodInvoker, myTargetObjects
 
Constructor Summary
OmniInvocation()
          Construct a new omnihandle invocation object.
OmniInvocation(Eoid theEoid, MethodDescriptor theMethodDescriptor, MethodInvoker theMethodInvoker)
          Construct a new omnihandle invocation object with the given EOID, method descriptor, and method invoker.
 
Method Summary
protected  byte[] getMessagePrefix()
          Obtain the M2MP message prefix corresponding to this omnihandle invocation object.
protected  Iterator getTargetObjects()
          Determine the target objects that this omnihandle invocation object will invoke.
 void processFromHandle()
          Process this omnihandle invocation, assuming it was created as a result of calling a method on an omnihandle.
 void processFromMessage()
          Process this omnihandle invocation, assuming it was created from an incoming M2MI message.
 void readExternal(ObjectInput theObjectInput)
          Read this omnihandle invocation object from the given object input stream.
 void writeExternal(ObjectOutput theObjectOutput)
          Write this omnihandle 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

OmniInvocation

public OmniInvocation()
Construct a new omnihandle 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.


OmniInvocation

public OmniInvocation(Eoid theEoid,
                      MethodDescriptor theMethodDescriptor,
                      MethodInvoker theMethodInvoker)
Construct a new omnihandle 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 omnihandle 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 omnihandle 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 omnihandle invocation, assuming it was created as a result of calling a method on an omnihandle. 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 omnihandle invocation, assuming it was created from an incoming M2MI message. This method goes to the M2MI Layer to invoke any target objects exported in the M2MI Layer.

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

getMessagePrefix

protected byte[] getMessagePrefix()
Obtain the M2MP message prefix corresponding to this omnihandle 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 omnihandle 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.