public class PlaceRegistry extends Object implements Lifecycle.ShutdownComponent
| Modifier and Type | Class and Description |
|---|---|
static interface |
PlaceRegistry.PreStartupHook
Used in conjunction with
createPlace(PlaceConfig,PreStartupHook). |
| Constructor and Description |
|---|
PlaceRegistry(Lifecycle cycle)
Creates and initializes the place registry.
|
| Modifier and Type | Method and Description |
|---|---|
PlaceManager |
createPlace(PlaceConfig config)
Creates and registers a new place manager with no delegates.
|
PlaceManager |
createPlace(PlaceConfig config,
List<PlaceManagerDelegate> delegates)
Creates and registers a new place manager along with the place object to be managed.
|
PlaceManager |
createPlace(PlaceConfig config,
PlaceRegistry.PreStartupHook hook)
Don't use this method, see
createPlace(PlaceConfig). |
Iterator<PlaceManager> |
enumeratePlaceManagers()
Returns an enumeration of all of the registered place managers.
|
Iterator<PlaceObject> |
enumeratePlaces()
Returns an enumeration of all of the registered place objects.
|
PlaceManager |
getPlaceManager(int placeOid)
Returns the place manager associated with the specified place object id or null if no such
place exists.
|
void |
shutdown() |
@Inject public PlaceRegistry(Lifecycle cycle)
public PlaceManager getPlaceManager(int placeOid)
public PlaceManager createPlace(PlaceConfig config) throws InstantiationException, InvocationException
InstantiationExceptionInvocationExceptioncreatePlace(PlaceConfig,List)public PlaceManager createPlace(PlaceConfig config, List<PlaceManagerDelegate> delegates) throws InstantiationException, InvocationException
config - the configuration object for the place to be created. The PlaceManager
derived class that should be instantiated to manage the place will be determined from the
config object.delegates - a list of PlaceManagerDelegate instances to be registered with the
manager prior to it being initialized and started up. Note: these delegates will
have dependencies injected into them prior to registering them with the manager.PlaceManager.startup(com.threerings.crowd.data.PlaceObject).InstantiationException - thrown if an error occurs trying to instantiate and
initialize the place manager.InvocationException - thrown if the place manager returns failure from the call to
PlaceManager.checkPermissions(). The error string returned by that call will be
provided as in the exception.public PlaceManager createPlace(PlaceConfig config, PlaceRegistry.PreStartupHook hook) throws InstantiationException, InvocationException
createPlace(PlaceConfig).hook - an optional pre-startup hook that allows a place manager to be configured prior
to having PlaceManager.startup(com.threerings.crowd.data.PlaceObject) called. This mainly exists because it used to be
possible to do such things. Try not to use this in new code.InstantiationExceptionInvocationExceptionpublic Iterator<PlaceObject> enumeratePlaces()
public Iterator<PlaceManager> enumeratePlaceManagers()
public void shutdown()
shutdown in interface Lifecycle.ShutdownComponentCopyright © 2015. All rights reserved.