org.jboss.ejb3
Class Ejb3Registry

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

public class Ejb3Registry
extends Object

Maintains an administration of all EJB3 container available.

Version:
$Revision: 68144 $
Author:
William DeCoste

Constructor Summary
Ejb3Registry()
           
 
Method Summary
static String clusterUid(Container container)
           
static String clusterUid(String oid, String partitionName)
           
static Container findContainer(String oid)
          Find a potential container.
static Container getClusterContainer(String clusterUid)
          Returns the container specified by the given canocical object name.
static Container getContainer(String guid)
          Returns the container specified by the given GUID.
static
<T extends Container>
T
getContainer(String oid, Class<T> type)
          Returns the container specified by the given canonical object name which is expected to be of the given type.
static Collection<Container> getContainers()
          Returns an unmodifiable collection of the registered containers.
static VMID getVMID()
           
static String guid(Container container)
           
static String guid(Container container, VMID vmid)
           
static boolean hasClusterContainer(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(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 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(String oid)

guid

public static final String guid(Container container,
                                VMID vmid)

guid

public static final String guid(Container container)

clusterUid

public static final String clusterUid(Container container)

clusterUid

public static final String clusterUid(String oid,
                                      String partitionName)

register

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

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

unregister

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

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

getContainer

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

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

getClusterContainer

public static Container getClusterContainer(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:
IllegalStateException - if the container is not registered

getContainer

public static <T extends Container> T getContainer(String oid,
                                                   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:
IllegalStateException - if the container is not registered

getContainers

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

Returns:
the containers


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.