mChaRM.multichannel
Class mChaRMMethodCall

java.lang.Object
  |
  +--mChaRM.multichannel.mChaRMMethodCall
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, uka.transport.Transportable

public class mChaRMMethodCall
extends java.lang.Object
implements uka.transport.Transportable

See Also:
Serialized Form

Field Summary
protected static int _SIZE
           
 
Constructor Summary
  mChaRMMethodCall(java.lang.String s, java.lang.String[] rs, java.lang.String m, java.lang.Object rv)
           
  mChaRMMethodCall(java.lang.String s, java.lang.String[] rs, java.lang.String m, java.lang.Object[] args)
           
  mChaRMMethodCall(uka.transport.UnmarshalStream _stream)
          Used by uka.transport.UnmarshalStream to unmarshal the object
protected mChaRMMethodCall(uka.transport.UnmarshalStream _stream, int _size)
           
 
Method Summary
 java.lang.Object[] actualArguments()
          returns the actual arguments used in the trapped call.
 java.lang.Object deepClone(uka.transport.DeepClone _helper)
           
protected  void deepCloneReferences(uka.transport.DeepClone _helper)
          Clone all references to other objects.
 java.lang.String getMethodName()
          returns the name of the method called.
 java.lang.Object getReturnValue()
          gets the return value of the related method call.
 boolean hasArgs()
          wonders about wheather the embodied call has or not arguments.
 void insertArgument(int position, java.lang.Object value)
          inserts a new argument at the specified position in the call.
 java.lang.Object inspectArgument(int position)
          returns the actual value of a specified argument.
 void marshal(uka.transport.MarshalStream _stream)
          Called directly by uka.transport.MarshalStream
protected  void marshalPrimitives(byte[] _buffer, int _pos)
           
protected  void marshalReferences(uka.transport.MarshalStream _stream)
           
 java.lang.Object modifyArgument(int position, java.lang.Object newValue)
          changes the value of a specified argument and returns the original value of such an argument.
 void printmChaRMMethodCall()
          prints the embodied method call.
 java.lang.String[] receivers()
          returns an array containing the name of the reecivers involved in the call.
 java.lang.Object removeArgument(int position)
          removes the specified argument from the embodied call.
 java.lang.String sender()
          returns the name of the sender of the message.
 java.lang.String setMethodName(java.lang.String m)
          changes the name of the method called.
 java.lang.Object setReturnValue(java.lang.Object val)
          substitutes the return value of a method call.
 void unmarshalReferences(uka.transport.UnmarshalStream _stream)
          Method of interface Transportable, it must be declared public.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_SIZE

protected static final int _SIZE
Constructor Detail

mChaRMMethodCall

public mChaRMMethodCall(java.lang.String s,
                        java.lang.String[] rs,
                        java.lang.String m,
                        java.lang.Object[] args)

mChaRMMethodCall

public mChaRMMethodCall(java.lang.String s,
                        java.lang.String[] rs,
                        java.lang.String m,
                        java.lang.Object rv)

mChaRMMethodCall

public mChaRMMethodCall(uka.transport.UnmarshalStream _stream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Used by uka.transport.UnmarshalStream to unmarshal the object

mChaRMMethodCall

protected mChaRMMethodCall(uka.transport.UnmarshalStream _stream,
                           int _size)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Method Detail

sender

public java.lang.String sender()
returns the name of the sender of the message.
It only supplies a String representative of the sender but it is simple to retrieve a reference of the sender, using the methods supplied by the multi-channel.
Returns:
the name of the sender.

receivers

public java.lang.String[] receivers()
returns an array containing the name of the reecivers involved in the call.
It only supplies a String representative of each receiver but it is simple to retrieve a reference of the real receiver, using the methods supplied by the multi-channel.
Returns:
an array of receiver's names.

getMethodName

public java.lang.String getMethodName()
returns the name of the method called.
Returns:
the name of the method called.

setMethodName

public java.lang.String setMethodName(java.lang.String m)
changes the name of the method called.
Parameters:
m - the name of the method to be used.
Returns:
the name of the method originally called.

actualArguments

public java.lang.Object[] actualArguments()
returns the actual arguments used in the trapped call.
Returns:
an array of Object representing the arguments of the call.

inspectArgument

public java.lang.Object inspectArgument(int position)
                                 throws ReferenceToNonExistentArgumentException
returns the actual value of a specified argument.
Parameters:
position - the position in the call of the argument we want to inspect.
Returns:
an Object containing the value of the inspected argument.
Throws:
ReferenceToNonExistentArgumentException - thrown when position exceeds (both the lower and the upper bound) the number of arguments of the call.

modifyArgument

public java.lang.Object modifyArgument(int position,
                                       java.lang.Object newValue)
                                throws ReferenceToNonExistentArgumentException
changes the value of a specified argument and returns the original value of such an argument.
Parameters:
position - the position in the call of the argument we want to modify.
newValue - the new value for the specified argument.
Returns:
an Object containing the original value of the modified argument.
Throws:
ReferenceToNonExistentArgumentException - thrown when position exceeds (both the lower and the upper bound) the number of arguments of the call.

insertArgument

public void insertArgument(int position,
                           java.lang.Object value)
inserts a new argument at the specified position in the call.
Parameters:
position - the position in the call that will have the argument we want to insert.
value - the value of the new argument.

removeArgument

public java.lang.Object removeArgument(int position)
                                throws ReferenceToNonExistentArgumentException
removes the specified argument from the embodied call.
Parameters:
position - the position in the call of the argument we want to remove.
Returns:
an Object containing the value of the removed argument.
Throws:
ReferenceToNonExistentArgumentException - thrown when position exceeds (both the lower and the upper bound) the number of arguments of the call.

printmChaRMMethodCall

public void printmChaRMMethodCall()
prints the embodied method call.

hasArgs

public boolean hasArgs()
wonders about wheather the embodied call has or not arguments.
Returns:
true if has arguments false otherwise.

setReturnValue

public java.lang.Object setReturnValue(java.lang.Object val)
substitutes the return value of a method call.
Parameters:
val - is the new value.
Returns:
returns the current value.

getReturnValue

public java.lang.Object getReturnValue()
gets the return value of the related method call.
Returns:
returns the current return value.

unmarshalReferences

public void unmarshalReferences(uka.transport.UnmarshalStream _stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
Method of interface Transportable, it must be declared public. It is called from within UnmarshalStream after creating the object and assigning a stream reference to it.
Specified by:
unmarshalReferences in interface uka.transport.Transportable

marshal

public void marshal(uka.transport.MarshalStream _stream)
             throws java.io.IOException
Called directly by uka.transport.MarshalStream
Specified by:
marshal in interface uka.transport.Transportable

marshalPrimitives

protected void marshalPrimitives(byte[] _buffer,
                                 int _pos)
                          throws java.io.IOException

marshalReferences

protected void marshalReferences(uka.transport.MarshalStream _stream)
                          throws java.io.IOException

deepClone

public final java.lang.Object deepClone(uka.transport.DeepClone _helper)
                                 throws java.lang.CloneNotSupportedException
Specified by:
deepClone in interface uka.transport.Transportable

deepCloneReferences

protected void deepCloneReferences(uka.transport.DeepClone _helper)
                            throws java.lang.CloneNotSupportedException
Clone all references to other objects. Use the DeepClone to resolve cycles