org.jdesktop.wonderland.server.spatial
Class UniverseService

java.lang.Object
  extended by com.sun.sgs.impl.util.AbstractService
      extended by org.jdesktop.wonderland.server.spatial.UniverseService
All Implemented Interfaces:
com.sun.sgs.service.Service, UniverseManager

public class UniverseService
extends com.sun.sgs.impl.util.AbstractService
implements UniverseManager

Author:
paulby

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.sgs.impl.util.AbstractService
com.sun.sgs.impl.util.AbstractService.State, com.sun.sgs.impl.util.AbstractService.Version
 
Field Summary
 
Fields inherited from class com.sun.sgs.impl.util.AbstractService
appName, dataService, IO_TASK_PROPERTY_PREFIX, IO_TASK_RETRIES_PROPERTY, IO_TASK_WAIT_TIME_PROPERTY, maxIoAttempts, retryWaitTime, taskOwner, taskScheduler, transactionScheduler, txnProxy
 
Constructor Summary
UniverseService(java.util.Properties props, com.sun.sgs.kernel.ComponentRegistry registry, com.sun.sgs.service.TransactionProxy proxy)
           
 
Method Summary
 void addCellListener(CellMOListener listener)
          Add a cell listener.
 void addChild(CellMO parent, CellMO child)
           
 void addRootToUniverse(CellMO rootCellMO)
           
 void addTransformChangeListener(CellMO cell, TransformChangeListenerSrv listener)
           
 void addViewUpdateListener(CellMO cell, ViewUpdateListener viewUpdateListener)
          Add a ViewUpdateLIstener to this cell.
 void createCell(CellMO cellMO, boolean notify)
           
protected  void doReady()
           
protected  void doShutdown()
           
 java.lang.String getName()
           
 com.jme.bounding.BoundingVolume getWorldBounds(CellMO cell, com.jme.bounding.BoundingVolume result)
           
 CellTransform getWorldTransform(CellMO cell, CellTransform result)
           
protected  void handleServiceVersionMismatch(com.sun.sgs.impl.util.AbstractService.Version oldVersion, com.sun.sgs.impl.util.AbstractService.Version currentVersion)
           
 void removeCell(CellMO cell)
           
 void removeCellListener(CellMOListener listener)
          Remove a cell listener.
 void removeChild(CellMO parent, CellMO child)
           
 void removeRootFromUniverse(CellMO rootCellMO)
           
 void removeTransformChangeListener(CellMO cell, TransformChangeListenerSrv listener)
           
 void removeViewUpdateListener(CellMO cell, ViewUpdateListener viewUpdateListener)
          Remove the specified ViewUpdateListener
 void revalidateCell(CellMO cellMO)
           
 void runTxnRunnable(UniverseTxnRunnable runnable)
          Immediately run the given runnable with the universe's TransactionProxy
 void scheduleOnTransaction(java.lang.Runnable runnable)
           
 void scheduleTask(UniverseKernelRunnable task)
          Schedule a runnable to execute when the current transaction commits.
 void setLocalTransform(CellMO cellMO, CellTransform localTransform)
           
 void viewLogin(ViewCellMO viewCell)
           
 void viewLogout(ViewCellMO viewCell)
           
 void viewRevalidate(ViewCellMO viewCell)
           
 
Methods inherited from class com.sun.sgs.impl.util.AbstractService
callFinished, callStarted, checkNonTransactionalContext, checkServiceVersion, createTaskQueue, getDataService, getState, isAlive, isInInitializedState, isRetryableException, ready, runIoTask, shutdown, shuttingDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniverseService

public UniverseService(java.util.Properties props,
                       com.sun.sgs.kernel.ComponentRegistry registry,
                       com.sun.sgs.service.TransactionProxy proxy)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface com.sun.sgs.service.Service
Overrides:
getName in class com.sun.sgs.impl.util.AbstractService

doReady

protected void doReady()
Specified by:
doReady in class com.sun.sgs.impl.util.AbstractService

doShutdown

protected void doShutdown()
Specified by:
doShutdown in class com.sun.sgs.impl.util.AbstractService

handleServiceVersionMismatch

protected void handleServiceVersionMismatch(com.sun.sgs.impl.util.AbstractService.Version oldVersion,
                                            com.sun.sgs.impl.util.AbstractService.Version currentVersion)
Specified by:
handleServiceVersionMismatch in class com.sun.sgs.impl.util.AbstractService

addRootToUniverse

public void addRootToUniverse(CellMO rootCellMO)
Specified by:
addRootToUniverse in interface UniverseManager

removeRootFromUniverse

public void removeRootFromUniverse(CellMO rootCellMO)
Specified by:
removeRootFromUniverse in interface UniverseManager

createCell

public void createCell(CellMO cellMO,
                       boolean notify)
Specified by:
createCell in interface UniverseManager

revalidateCell

public void revalidateCell(CellMO cellMO)
Specified by:
revalidateCell in interface UniverseManager

removeCell

public void removeCell(CellMO cell)
Specified by:
removeCell in interface UniverseManager

addChild

public void addChild(CellMO parent,
                     CellMO child)
Specified by:
addChild in interface UniverseManager

removeChild

public void removeChild(CellMO parent,
                        CellMO child)
Specified by:
removeChild in interface UniverseManager

setLocalTransform

public void setLocalTransform(CellMO cellMO,
                              CellTransform localTransform)
Specified by:
setLocalTransform in interface UniverseManager

viewLogin

public void viewLogin(ViewCellMO viewCell)
Specified by:
viewLogin in interface UniverseManager

viewRevalidate

public void viewRevalidate(ViewCellMO viewCell)
Specified by:
viewRevalidate in interface UniverseManager

viewLogout

public void viewLogout(ViewCellMO viewCell)
Specified by:
viewLogout in interface UniverseManager

getWorldTransform

public CellTransform getWorldTransform(CellMO cell,
                                       CellTransform result)
Specified by:
getWorldTransform in interface UniverseManager

getWorldBounds

public com.jme.bounding.BoundingVolume getWorldBounds(CellMO cell,
                                                      com.jme.bounding.BoundingVolume result)
Specified by:
getWorldBounds in interface UniverseManager

addCellListener

public void addCellListener(CellMOListener listener)
Description copied from interface: UniverseManager
Add a cell listener. The listener will be notified whenever a cell is added or removed. Cell listeners must be serializable and may optionally implement managed object. Listeners will be notified in a Darkstar transaction, and are persisted across restarts.

Specified by:
addCellListener in interface UniverseManager
Parameters:
listener - the listener to add

removeCellListener

public void removeCellListener(CellMOListener listener)
Description copied from interface: UniverseManager
Remove a cell listener.

Specified by:
removeCellListener in interface UniverseManager
Parameters:
listener - the listener to remove

addTransformChangeListener

public void addTransformChangeListener(CellMO cell,
                                       TransformChangeListenerSrv listener)
Specified by:
addTransformChangeListener in interface UniverseManager

removeTransformChangeListener

public void removeTransformChangeListener(CellMO cell,
                                          TransformChangeListenerSrv listener)
Specified by:
removeTransformChangeListener in interface UniverseManager

addViewUpdateListener

public void addViewUpdateListener(CellMO cell,
                                  ViewUpdateListener viewUpdateListener)
Description copied from interface: UniverseManager
Add a ViewUpdateLIstener to this cell. This listener will be called whenever the view of a ViewCache that contains this cell is updated

Specified by:
addViewUpdateListener in interface UniverseManager
viewUpdateListener - listener to add

removeViewUpdateListener

public void removeViewUpdateListener(CellMO cell,
                                     ViewUpdateListener viewUpdateListener)
Description copied from interface: UniverseManager
Remove the specified ViewUpdateListener

Specified by:
removeViewUpdateListener in interface UniverseManager
viewUpdateListener - listener to remove

scheduleOnTransaction

public void scheduleOnTransaction(java.lang.Runnable runnable)

scheduleTask

public void scheduleTask(UniverseKernelRunnable task)
Description copied from interface: UniverseManager
Schedule a runnable to execute when the current transaction commits. This is useful if you need to interact with other changes in the UniverseManager that are pending on the completion of the current transaction.

Specified by:
scheduleTask in interface UniverseManager

runTxnRunnable

public void runTxnRunnable(UniverseTxnRunnable runnable)
Description copied from interface: UniverseManager
Immediately run the given runnable with the universe's TransactionProxy

Specified by:
runTxnRunnable in interface UniverseManager
Parameters:
runnable - the runnable to run


Open Wonderland - http://openwonderland.org