org.jdesktop.wonderland.client.cell.registry
Class CellComponentRegistry

java.lang.Object
  extended by org.jdesktop.wonderland.client.cell.registry.CellComponentRegistry
All Implemented Interfaces:
PrimaryServerListener

public class CellComponentRegistry
extends java.lang.Object
implements PrimaryServerListener

The cell comopnent registry manages the collection of cell component types registered with the system. This is used to display them in the palette and also provides the necessary information to create them in-world.

Author:
Jordan Slott

Constructor Summary
CellComponentRegistry()
          Default constructor
 
Method Summary
 java.util.Set<CellComponentFactorySPI> getAllCellFactories()
          Returns a set of all cell factories.
static CellComponentRegistry getCellComponentRegistry()
          Returns a single instance of this class
 CellComponentFactorySPI getCellFactoryByClass(java.lang.Class clazz)
          Returns a set of cell factories given the Class.
 CellComponentFactorySPI getCellFactoryByStateClass(java.lang.Class clazz)
          Returns a set of cell factories given the Class of the server-side state object.
 void primaryServer(ServerSessionManager server)
          Notification that the primary server has changed.
 void registerCellComponentFactory(CellComponentFactorySPI factory)
          Registers a CellFactory.
protected  void registerFactories(ServerSessionManager manager)
          Register all factories associated with the given session manager.
 void unregisterCellComponentFactory(CellComponentFactorySPI factory)
          Unregisters a CellFactory.
protected  void unregisterFactories()
          Unregister all factories associated with the current session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellComponentRegistry

public CellComponentRegistry()
Default constructor

Method Detail

getCellComponentRegistry

public static final CellComponentRegistry getCellComponentRegistry()
Returns a single instance of this class

Returns:
Single instance of this class.

registerCellComponentFactory

public void registerCellComponentFactory(CellComponentFactorySPI factory)
Registers a CellFactory. This cell factory is used to generate cell setup classes, GUI panels to configuration the cell setup information, and information so that the cell type can be used in a world assembly palette of cell types.

Parameters:
factory - The cell factory

unregisterCellComponentFactory

public void unregisterCellComponentFactory(CellComponentFactorySPI factory)
Unregisters a CellFactory. Make sure we're not removing something that someone other than this factory wrote.

Parameters:
factory - The cell factory

getAllCellFactories

public java.util.Set<CellComponentFactorySPI> getAllCellFactories()
Returns a set of all cell factories. If no factories are registered, returns an empty set.

Returns:
A set of registered cell factories

getCellFactoryByClass

public CellComponentFactorySPI getCellFactoryByClass(java.lang.Class clazz)
Returns a set of cell factories given the Class. If no factories are present for the given Class, returns null.

Parameters:
clazz - The Class for the cell component factory
Returns:
A CellComponentFactorySPI object registered on the Class

getCellFactoryByStateClass

public CellComponentFactorySPI getCellFactoryByStateClass(java.lang.Class clazz)
Returns a set of cell factories given the Class of the server-side state object. If no factories are present for the given Class, return null.

Parameters:
clazz - The Class for the cell component server state
Returns:
A CellComponentFactorySPI object registered on the Class

primaryServer

public void primaryServer(ServerSessionManager server)
Notification that the primary server has changed. Update our maps accordingly.

Specified by:
primaryServer in interface PrimaryServerListener
Parameters:
server - the new primary server (may be null)

registerFactories

protected void registerFactories(ServerSessionManager manager)
Register all factories associated with the given session manager.


unregisterFactories

protected void unregisterFactories()
Unregister all factories associated with the current session



Open Wonderland - http://openwonderland.org