|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.whirled.server.SceneRegistry
public class SceneRegistry
The scene registry is responsible for the management of all scenes. It handles interaction with the scene repository and ensures that scenes are loaded into memory when needed and flushed from memory when not needed.
The scene repository also takes care of bridging from the blocking, synchronous world of the scene repository to the non-blocking asynchronous world of the distributed object event queue. Thus its interfaces for accessing scenes are structured so as to not block the dobjmgr thread while waiting for scenes to be read from or written to the repository.
Note: All access to the scene registry should take place from the dobjmgr thread.
| Nested Class Summary | |
|---|---|
static interface |
SceneRegistry.ConfigFactory
Used to create PlaceConfig instances for scenes. |
static interface |
SceneRegistry.ResolutionListener
Because scenes must be loaded from the scene repository and this must not be done on the dobjmgr thread, the interface for resolving scenes requires that the entity that wishes for a scene to be resolved implement this callback interface so that it can be notified when a scene has been loaded and initialized. |
| Field Summary |
|---|
| Fields inherited from interface com.threerings.whirled.data.SceneCodes |
|---|
SCENE_UPDATE, WHIRLED_GROUP |
| Fields inherited from interface com.threerings.crowd.data.LocationCodes |
|---|
ALREADY_THERE, MOVE_IN_PROGRESS, NO_SUCH_PLACE |
| Fields inherited from interface com.threerings.presents.data.InvocationCodes |
|---|
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR |
| Constructor Summary | |
|---|---|
SceneRegistry(com.threerings.presents.server.InvocationManager invmgr)
Constructs a scene registry. |
|
| Method Summary | |
|---|---|
SceneManager |
getSceneManager(int sceneId)
Fetches the scene manager associated with the specified scene. |
SceneRepository |
getSceneRepository()
Returns a reference to the scene repository in use by this registry. |
void |
leaveOccupiedScene(com.threerings.crowd.data.BodyObject source)
Ejects the specified body from their current scene and zone. |
void |
moveBody(com.threerings.crowd.data.BodyObject source,
int sceneId)
Ejects the specified body from their current scene and sends them a request to move to the specified new scene. |
void |
moveTo(com.threerings.presents.data.ClientObject caller,
int sceneId,
int sceneVer,
SceneService.SceneMoveListener listener)
Handles a SceneService.moveTo(int, int, com.threerings.whirled.client.SceneService.SceneMoveListener) request. |
void |
resolveScene(int sceneId,
SceneRegistry.ResolutionListener target)
Requests that the specified scene be resolved, which means loaded into the server and initialized if the scene is not currently active. |
String |
where(int sceneId)
Returns SceneManager.where() for the specified scene or null:sceneId if
no scene manager exists for that scene. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public SceneRegistry(com.threerings.presents.server.InvocationManager invmgr)
| Method Detail |
|---|
public SceneManager getSceneManager(int sceneId)
public SceneRepository getSceneRepository()
public String where(int sceneId)
SceneManager.where() for the specified scene or null:sceneId if
no scene manager exists for that scene.
public void resolveScene(int sceneId,
SceneRegistry.ResolutionListener target)
resolveScene(int, com.threerings.whirled.server.SceneRegistry.ResolutionListener) returns).
sceneId - the id of the scene to resolve.target - a reference to a callback instance that will be notified when the scene has
been resolved (which may be immediately if the scene is already active).
public void moveTo(com.threerings.presents.data.ClientObject caller,
int sceneId,
int sceneVer,
SceneService.SceneMoveListener listener)
SceneProviderSceneService.moveTo(int, int, com.threerings.whirled.client.SceneService.SceneMoveListener) request.
moveTo in interface SceneProvider
public void moveBody(com.threerings.crowd.data.BodyObject source,
int sceneId)
LocationProvider.moveTo(com.threerings.presents.data.ClientObject, int, com.threerings.crowd.client.LocationService.MoveListener).
public void leaveOccupiedScene(com.threerings.crowd.data.BodyObject source)
LocationProvider.leavePlace(com.threerings.presents.data.ClientObject).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||