com.threerings.presents.server
Class TimeBaseProvider

java.lang.Object
  extended by com.threerings.presents.server.TimeBaseProvider
All Implemented Interfaces:
InvocationCodes, TimeBaseCodes, InvocationProvider

public class TimeBaseProvider
extends Object
implements InvocationProvider, TimeBaseCodes

Provides the server-side of the time base services. The time base services provide a means by which delta times can be sent over the network which are expanded based on a shared base time into full time stamps.


Field Summary
protected static InvocationManager _invmgr
          The invocation manager with which we interoperate.
protected static RootDObjectManager _omgr
          The distributed object manager with which we interoperate.
protected static HashMap<String,TimeBaseObject> _timeBases
          Used to keep track of our time base objects.
 
Fields inherited from interface com.threerings.presents.data.TimeBaseCodes
NO_SUCH_TIME_BASE
 
Fields inherited from interface com.threerings.presents.data.InvocationCodes
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR
 
Constructor Summary
TimeBaseProvider()
           
 
Method Summary
static TimeBaseObject createTimeBase(String timeBase)
          Creates a time base object which can subsequently be fetched by the client and used to send delta times.
static TimeBaseObject getTimeBase(String timeBase)
          Returns the named timebase object, or null if no time base object has been created with that name.
 void getTimeOid(ClientObject source, String timeBase, TimeBaseService.GotTimeBaseListener listener)
          Processes a request from a client to fetch the oid of the specified time object.
static void init(InvocationManager invmgr, RootDObjectManager omgr)
          Registers the time provider with the appropriate managers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_timeBases

protected static HashMap<String,TimeBaseObject> _timeBases
Used to keep track of our time base objects.


_invmgr

protected static InvocationManager _invmgr
The invocation manager with which we interoperate.


_omgr

protected static RootDObjectManager _omgr
The distributed object manager with which we interoperate.

Constructor Detail

TimeBaseProvider

public TimeBaseProvider()
Method Detail

init

public static void init(InvocationManager invmgr,
                        RootDObjectManager omgr)
Registers the time provider with the appropriate managers. Called by the presents server at startup.


createTimeBase

public static TimeBaseObject createTimeBase(String timeBase)
Creates a time base object which can subsequently be fetched by the client and used to send delta times.

Parameters:
timeBase - the name of the time base to create.
Returns:
the created and registered time base object.

getTimeBase

public static TimeBaseObject getTimeBase(String timeBase)
Returns the named timebase object, or null if no time base object has been created with that name.


getTimeOid

public void getTimeOid(ClientObject source,
                       String timeBase,
                       TimeBaseService.GotTimeBaseListener listener)
                throws InvocationException
Processes a request from a client to fetch the oid of the specified time object.

Throws:
InvocationException