com.threerings.crowd.server
Class PlaceManagerDelegate

java.lang.Object
  extended by com.threerings.crowd.server.PlaceManagerDelegate

public class PlaceManagerDelegate
extends Object

Provides an extensible mechanism for encapsulating delegated functionality that works with the place services.

Thanks to Java's lack of multiple inheritance, it will likely become necessary to factor certain services that might be used by a variety of PlaceManager derived classes into delegate classes because they do not fit into the single inheritance hierarchy that makes sense for a particular application. To facilitate this process, this delegate class is provided which the standard place manager can be made to call out to for all of the standard methods.


Field Summary
protected  InvocationManager _invmgr
          A reference to our invocation manager.
protected  RootDObjectManager _omgr
          A reference to our distributed object manager.
protected  PlaceManager _plmgr
          A reference to the manager for which we are delegating.
 
Constructor Summary
PlaceManagerDelegate()
           
 
Method Summary
protected
<T extends InvocationMarshaller<?>>
T
addDispatcher(InvocationDispatcher<T> disp)
          Registers an invocation dispatcher and notes the registration such that it will be automatically cleared when our parent manager shuts down.
protected
<T extends InvocationMarshaller<?>>
T
addProvider(InvocationProvider prov, Class<T> mclass)
          Registers an invocation provider and notes the registration such that it will be automatically cleared when our parent manager shuts down.
 void bodyEntered(int bodyOid)
          Called when a body enters the place.
 void bodyLeft(int bodyOid)
          Called when a body leaves the place.
 void bodyUpdated(OccupantInfo info)
          Called when a body occupant info is updated.
 void didInit(PlaceConfig config)
          Called when the place manager is initialized.
 void didShutdown()
          Called when the place manager is shut down.
 void didStartup(PlaceObject plobj)
          Called when the place manager is started up.
 void init(PlaceManager plmgr, RootDObjectManager omgr, InvocationManager invmgr)
          Called by the place manager when this delegate is registered with it.
 void placeBecameEmpty()
          Called when the last body leaves the place.
 String where()
          Invokes PlaceManager.where().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_plmgr

protected PlaceManager _plmgr
A reference to the manager for which we are delegating.


_omgr

protected RootDObjectManager _omgr
A reference to our distributed object manager.


_invmgr

protected InvocationManager _invmgr
A reference to our invocation manager.

Constructor Detail

PlaceManagerDelegate

public PlaceManagerDelegate()
Method Detail

init

public void init(PlaceManager plmgr,
                 RootDObjectManager omgr,
                 InvocationManager invmgr)
Called by the place manager when this delegate is registered with it. This will happen before any calls to didInit(com.threerings.crowd.data.PlaceConfig), etc.


didInit

public void didInit(PlaceConfig config)
Called when the place manager is initialized.


didStartup

public void didStartup(PlaceObject plobj)
Called when the place manager is started up.


didShutdown

public void didShutdown()
Called when the place manager is shut down.


bodyEntered

public void bodyEntered(int bodyOid)
Called when a body enters the place.


bodyLeft

public void bodyLeft(int bodyOid)
Called when a body leaves the place.


bodyUpdated

public void bodyUpdated(OccupantInfo info)
Called when a body occupant info is updated.


placeBecameEmpty

public void placeBecameEmpty()
Called when the last body leaves the place.


where

public String where()
Invokes PlaceManager.where().


addProvider

protected <T extends InvocationMarshaller<?>> T addProvider(InvocationProvider prov,
                                                            Class<T> mclass)
Registers an invocation provider and notes the registration such that it will be automatically cleared when our parent manager shuts down.


addDispatcher

protected <T extends InvocationMarshaller<?>> T addDispatcher(InvocationDispatcher<T> disp)
Registers an invocation dispatcher and notes the registration such that it will be automatically cleared when our parent manager shuts down.