com.threerings.presents.dobj
Class InvocationRequestEvent

java.lang.Object
  extended by com.threerings.presents.dobj.DEvent
      extended by com.threerings.presents.dobj.InvocationRequestEvent
All Implemented Interfaces:
Streamable

public class InvocationRequestEvent
extends DEvent

Used to dispatch an invocation request from the client to the server.

See Also:
DObjectManager.postEvent(com.threerings.presents.dobj.DEvent)

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
protected  Object[] _args
          The arguments to the method being invoked.
protected  int _invCode
          The code identifying which invocation provider to which this request is directed.
protected  byte _methodId
          The id of the method being invoked.
 
Fields inherited from class com.threerings.presents.dobj.DEvent
_actualTransport, _soid, _toid, _transport, eventId, UNSET_OLD_ENTRY, UNSET_OLD_VALUE
 
Constructor Summary
InvocationRequestEvent(int targetOid, int invCode, int methodId, Object[] args)
          Constructs a new invocation request event on the specified target object with the supplied code, method and arguments.
 
Method Summary
 boolean applyToObject(DObject target)
          Applies the attribute modifications represented by this event to the specified target object.
 Object[] getArgs()
          Returns the arguments associated with this request.
 int getInvCode()
          Returns the invocation code associated with this request.
 int getMethodId()
          Returns the id of the method associated with this request.
protected  void notifyListener(Object listener)
          Events with associated listener interfaces should implement this function and notify the supplied listener if it implements their event listening interface.
protected  void toString(StringBuilder buf)
          This should be overridden by derived classes (which should be sure to call super.toString()) to append the derived class specific event information to the string buffer.
 
Methods inherited from class com.threerings.presents.dobj.DEvent
alreadyApplied, getActualTransport, getSourceOid, getTargetOid, getTransport, isPrivate, noteActualTransport, setSourceOid, setTargetOid, setTransport, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_invCode

protected int _invCode
The code identifying which invocation provider to which this request is directed.


_methodId

protected byte _methodId
The id of the method being invoked.


_args

protected Object[] _args
The arguments to the method being invoked.

Constructor Detail

InvocationRequestEvent

public InvocationRequestEvent(int targetOid,
                              int invCode,
                              int methodId,
                              Object[] args)
Constructs a new invocation request event on the specified target object with the supplied code, method and arguments.

Parameters:
targetOid - the object id of the object on which the event is to be dispatched.
invCode - the invocation provider identification code.
methodId - the id of the method to be invoked.
args - the arguments for the method. This array should contain only values of valid distributed object types.
Method Detail

getInvCode

public int getInvCode()
Returns the invocation code associated with this request.


getMethodId

public int getMethodId()
Returns the id of the method associated with this request.


getArgs

public Object[] getArgs()
Returns the arguments associated with this request.


applyToObject

public boolean applyToObject(DObject target)
                      throws ObjectAccessException
Description copied from class: DEvent
Applies the attribute modifications represented by this event to the specified target object. This is called by the distributed object manager in the course of dispatching events and should not be called directly.

Specified by:
applyToObject in class DEvent
Returns:
true if the object manager should go on to notify the object's listeners of this event, false if the event should be treated silently and the listeners should not be notified.
Throws:
ObjectAccessException - thrown if there is any problem applying the event to the object (invalid attribute, etc.).

notifyListener

protected void notifyListener(Object listener)
Description copied from class: DEvent
Events with associated listener interfaces should implement this function and notify the supplied listener if it implements their event listening interface. For example, the AttributeChangedEvent will notify listeners that implement AttributeChangeListener.

Overrides:
notifyListener in class DEvent

toString

protected void toString(StringBuilder buf)
Description copied from class: DEvent
This should be overridden by derived classes (which should be sure to call super.toString()) to append the derived class specific event information to the string buffer.

Overrides:
toString in class DEvent