com.threerings.nexus.distrib
Class NexusObject

java.lang.Object
  extended by com.threerings.nexus.distrib.NexusObject
All Implemented Interfaces:
NexusService.ObjectResponse, Streamable

public abstract class NexusObject
extends Object
implements Streamable, NexusService.ObjectResponse

The basis for all distributed information sharing in Nexus.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.nexus.io.Streamable
Streamable.Input, Streamable.Output
 
Field Summary
 react.Signal<Throwable> onLost
          A signal that is emitted if the subscription to this object is lost due to the object being destroyed or due to the connection to the server that hosts this object being lost.
 
Constructor Summary
NexusObject()
           
 
Method Summary
 Address<?> getAddress()
          Returns the address of this object.
 int getId()
          Returns this object's Nexus id.
 NexusObject[] getObjects()
          Returns the objects contained within this response object.
 void readContents(Streamable.Input in)
          Reads the contents of this object from the supplied input.
 void writeContents(Streamable.Output out)
          Writes the contents of this object to the supplied output.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onLost

public final react.Signal<Throwable> onLost
A signal that is emitted if the subscription to this object is lost due to the object being destroyed or due to the connection to the server that hosts this object being lost. The exception delivered to the signal will be null if the object was destroyed or the cause of the networking failure if an object is lost due to loss of network connection. This signal will never be emitted on the hosting server, only on a subscribing client.

Constructor Detail

NexusObject

public NexusObject()
Method Detail

getId

public int getId()
Returns this object's Nexus id. Only valid after the object has been registered with Nexus.


getAddress

public Address<?> getAddress()
Returns the address of this object.


readContents

public void readContents(Streamable.Input in)
Reads the contents of this object from the supplied input.


writeContents

public void writeContents(Streamable.Output out)
Writes the contents of this object to the supplied output.


getObjects

public NexusObject[] getObjects()
Description copied from interface: NexusService.ObjectResponse
Returns the objects contained within this response object.

Specified by:
getObjects in interface NexusService.ObjectResponse


Copyright © 2013. All Rights Reserved.