org.jboss.ejb3
Class Ejb3Registry

java.lang.Object
  extended by org.jboss.ejb3.Ejb3Registry

public class Ejb3Registry
extends java.lang.Object

Maintains an administration of all EJB3 container available.


Constructor Summary
Ejb3Registry()
           
 
Method Summary
static java.lang.String clusterUid(Container container)
           
static java.lang.String clusterUid(java.lang.String oid, java.lang.String partitionName)
           
static Container findContainer(java.lang.String oid)
          Find a potential container.
static Container getClusterContainer(java.lang.String clusterUid)
          Returns the container specified by the given canocical object name.
static Container getContainer(java.lang.String guid)
          Returns the container specified by the given GUID.
static
<T extends Container>
T
getContainer(java.lang.String oid, java.lang.Class<T> type)
          Returns the container specified by the given canonical object name which is expected to be of the given type.
static java.util.Collection<Container> getContainers()
          Returns an unmodifiable collection of the registered containers.
static java.rmi.dgc.VMID getVMID()
           
static java.lang.String guid(Container container)
           
static java.lang.String guid(Container container, java.rmi.dgc.VMID vmid)
           
static boolean hasClusterContainer(java.lang.String oid)
           
static boolean hasContainer(Container container)
          Reports the existance of a container.
static void register(Container container)
          Registers a container.
static void unregister(Container container)
          Unregisters a container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ejb3Registry

public Ejb3Registry()
Method Detail

findContainer

public static Container findContainer(java.lang.String oid)
Find a potential container.

Parameters:
oid - the canonical object name of the container
Returns:
the container or null if not found

getVMID

public static java.rmi.dgc.VMID getVMID()

hasContainer

public static boolean hasContainer(Container container)
Reports the existance of a container.

Parameters:
container - the container to check
Returns:
true if found, false otherwise

hasClusterContainer

public static boolean hasClusterContainer(java.lang.String oid)

guid

public static final java.lang.String guid(Container container,
                                          java.rmi.dgc.VMID vmid)

guid

public static final java.lang.String guid(Container container)

clusterUid

public static final java.lang.String clusterUid(Container container)

clusterUid

public static final java.lang.String clusterUid(java.lang.String oid,
                                                java.lang.String partitionName)

register

public static void register(Container container)
Registers a container.

Parameters:
container - the container to register
Throws:
java.lang.IllegalStateException - if the container is already registered

unregister

public static void unregister(Container container)
Unregisters a container.

Parameters:
container - the container to unregister
Throws:
java.lang.IllegalStateException - if the container is not registered

getContainer

public static Container getContainer(java.lang.String guid)
Returns the container specified by the given GUID. Never returns null.

Parameters:
guid - the GUID
Returns:
the container
Throws:
java.lang.IllegalStateException - if the container is not registered

getClusterContainer

public static Container getClusterContainer(java.lang.String clusterUid)
Returns the container specified by the given canocical object name. Never returns null.

Parameters:
oid - the canonical object name of the container
Returns:
the container
Throws:
java.lang.IllegalStateException - if the container is not registered

getContainer

public static <T extends Container> T getContainer(java.lang.String oid,
                                                   java.lang.Class<T> type)
Returns the container specified by the given canonical object name which is expected to be of the given type. Never returns null.

Parameters:
oid - the canonical object name of the container
type - the container type
Returns:
the container
Throws:
java.lang.IllegalStateException - if the container is not registered

getContainers

public static java.util.Collection<Container> getContainers()
Returns an unmodifiable collection of the registered containers.

Returns:
the containers