com.threerings.presents.data
Class InvocationMarshaller<T extends ClientObject>

java.lang.Object
  extended by com.threerings.presents.data.InvocationMarshaller<T>
All Implemented Interfaces:
Streamable, InvocationService<T>
Direct Known Subclasses:
AdminMarshaller, BodyMarshaller, BureauMarshaller, ChannelSpeakMarshaller, ChatMarshaller, CrowdPeerMarshaller, LocationMarshaller, PeerMarshaller, RegistrationMarshaller, SpeakMarshaller, TimeBaseMarshaller

public class InvocationMarshaller<T extends ClientObject>
extends Object
implements Streamable, InvocationService<T>

Provides a base from which all invocation service marshallers extend. Handles functionality common to all marshallers.


Nested Class Summary
static class InvocationMarshaller.ConfirmMarshaller
          Defines a marshaller for the standard InvocationService.ConfirmListener.
static class InvocationMarshaller.ListenerMarshaller
          Provides a base from which invocation listener marshallers extend.
static class InvocationMarshaller.ResultMarshaller
          Defines a marshaller for the standard InvocationService.ResultListener.
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Nested classes/interfaces inherited from interface com.threerings.presents.client.InvocationService
InvocationService.ConfirmListener, InvocationService.InvocationListener, InvocationService.ResultListener
 
Field Summary
protected  int _invCode
          The invocation service code assigned to this service when it was registered on the server.
protected  InvocationDirector _invdir
          A reference to the invocation director with whom we interoperate.
protected  int _invOid
          The oid of the invocation object, where invocation service requests are sent.
 
Constructor Summary
InvocationMarshaller()
           
 
Method Summary
 int getInvocationCode()
          Returns the code assigned to this marshaller.
 void init(int invOid, int invCode, InvocationDirector invDir)
          Initializes this invocation marshaller instance with the requisite information to allow it to operate in the wide world.
 void readObject(ObjectInputStream in)
          A custom reader method for Streamable.
protected  void sendRequest(Client client, int methodId, Object[] args)
          Deprecated. use client-argument-free version.
protected  void sendRequest(Client client, int methodId, Object[] args, Transport transport)
          Deprecated. use client-argument-free version.
protected  void sendRequest(int methodId, Object[] args)
          Called by generated invocation marshaller code; packages up and sends the specified invocation service request.
protected  void sendRequest(int methodId, Object[] args, Transport transport)
          Called by generated invocation marshaller code; packages up and sends the specified invocation service request.
 void setInvocationOid(int invOid)
          Sets the invocation oid to which this marshaller should send its invocation service requests.
static void setNoResponse(InvocationService.InvocationListener listener)
          A convenience method to indicate that the listener is not going to be responded-to, and that this is ok.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_invOid

protected int _invOid
The oid of the invocation object, where invocation service requests are sent.


_invCode

protected int _invCode
The invocation service code assigned to this service when it was registered on the server.


_invdir

protected transient InvocationDirector _invdir
A reference to the invocation director with whom we interoperate. This is initialized in readObject(com.threerings.io.ObjectInputStream) when we're read in from the network.

Constructor Detail

InvocationMarshaller

public InvocationMarshaller()
Method Detail

init

public void init(int invOid,
                 int invCode,
                 InvocationDirector invDir)
Initializes this invocation marshaller instance with the requisite information to allow it to operate in the wide world. This is called by the invocation manager when an invocation provider is registered and should not be called otherwise.


setInvocationOid

public void setInvocationOid(int invOid)
Sets the invocation oid to which this marshaller should send its invocation service requests. This is called by the invocation manager in certain initialization circumstances.


getInvocationCode

public int getInvocationCode()
Returns the code assigned to this marshaller.


setNoResponse

public static void setNoResponse(InvocationService.InvocationListener listener)
A convenience method to indicate that the listener is not going to be responded-to, and that this is ok.


readObject

public void readObject(ObjectInputStream in)
                throws IOException,
                       ClassNotFoundException
A custom reader method for Streamable.

Throws:
IOException
ClassNotFoundException

toString

public String toString()
Overrides:
toString in class Object

sendRequest

protected void sendRequest(int methodId,
                           Object[] args)
Called by generated invocation marshaller code; packages up and sends the specified invocation service request.


sendRequest

protected void sendRequest(int methodId,
                           Object[] args,
                           Transport transport)
Called by generated invocation marshaller code; packages up and sends the specified invocation service request.


sendRequest

@Deprecated
protected void sendRequest(Client client,
                                      int methodId,
                                      Object[] args)
Deprecated. use client-argument-free version.


sendRequest

@Deprecated
protected void sendRequest(Client client,
                                      int methodId,
                                      Object[] args,
                                      Transport transport)
Deprecated. use client-argument-free version.