|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.framework.server.HAPartitionLocator
public class HAPartitionLocator
Service Locator utility for locating an HAPartition
. Maintains
an internal registry of partitions, and if it cannot find a partition there,
will attempt to find it in JNDI using a standard naming pattern.
Field Summary | |
---|---|
static String |
JNDI_CONTEXT_NAME
Name of the standard JNDI context under which HAPartitions are bound |
Constructor Summary | |
---|---|
protected |
HAPartitionLocator()
Allow subclasses to create a new HAPartitionLocator. |
Method Summary | |
---|---|
void |
deregisterHAPartition(HAPartition partition)
Deregister a partition from this locator. |
protected HAPartition |
findInJndi(String partitionName,
Hashtable jndiProperties)
Find the given partition in JNDI under a standard binding . |
protected HAPartition |
findInRegistry(String partitionName)
Find the given partition in the local registry. |
HAPartition |
getHAPartition(String partitionName,
Hashtable jndiProperties)
Locates and returns the HAPartition whose partition name matches
the given partitionName . |
static HAPartitionLocator |
getHAPartitionLocator()
Gets the |
static String |
getStandardJndiBinding(String partitionName)
Appends the partition name to JNDI_CONTEXT_NAME ; e.g. |
void |
registerHAPartition(HAPartition partition)
Register a partition with this locator. |
protected static void |
setSharedInstance(HAPartitionLocator shared)
Allows replacement of the default implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JNDI_CONTEXT_NAME
Constructor Detail |
---|
protected HAPartitionLocator()
Method Detail |
---|
public static HAPartitionLocator getHAPartitionLocator()
null
public static final String getStandardJndiBinding(String partitionName)
JNDI_CONTEXT_NAME
; e.g.
/HAPartition/DefaultPartition
.
partitionName
- the name of the partition
protected static void setSharedInstance(HAPartitionLocator shared)
shared
- the locator to use. Cannot be null
.public HAPartition getHAPartition(String partitionName, Hashtable jndiProperties)
HAPartition
whose partition name matches
the given partitionName
.
partitionName
- the name of the partition. Cannot be null
.jndiProperties
- any naming properties to pass to new InitialContext()
if JNDI lookup is needed.
null
IllegalStateException
- if no matching partition can be foundpublic void registerHAPartition(HAPartition partition)
partition
- the partitionpublic void deregisterHAPartition(HAPartition partition)
partition
- the partitionprotected HAPartition findInRegistry(String partitionName)
partitionName
- the name of the partition. Cannot be null
.
null
protected HAPartition findInJndi(String partitionName, Hashtable jndiProperties) throws NamingException
standard binding
.
partitionName
- the name of the partition. Cannot be null
.
null
NamingException
- if there is a problem with the naming context. Will
not throw NameNotFoundException; if not found, will
return null
.getStandardJndiBinding(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |