org.jboss.ha.framework.server.util
Class PingJndi

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.ha.framework.server.util.PingJndi
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , PingJndiMBean (src) , Service (src) , ServiceMBean (src)

public class PingJndi
extends ServiceMBeanSupport (src)
implements PingJndiMBean (src)

A utility MBean that can be used as the trigger target of the TopologyMonitorService to probe the state of JNDI on the cluster nodes.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
PingJndi()
           
 
Method Summary
 java.lang.String[] getLookupNames()
          Get the names of JNDI bindings that should be queried on each host
 java.lang.String getProviderURLPattern()
          Get the Context.PROVIDER_URL regular expression.
 void membershipChanged(java.util.ArrayList removed, java.util.ArrayList added, java.util.ArrayList members, java.lang.String logCategoryName)
          The TopologyMonitorService trigger callback operation.
 void setLookupNames(java.lang.String[] names)
          Set the names of JNDI bindings that should be queried on each host
 void setProviderURLPattern(java.lang.String regex)
          Set the regular expression containing the hostname/IP address of the JNDI provider.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PingJndi

public PingJndi()
Method Detail

getLookupNames

public java.lang.String[] getLookupNames()
Get the names of JNDI bindings that should be queried on each host

Specified by:
getLookupNames in interface PingJndiMBean (src)
Returns:
the array of target names to test

setLookupNames

public void setLookupNames(java.lang.String[] names)
Set the names of JNDI bindings that should be queried on each host

Specified by:
setLookupNames in interface PingJndiMBean (src)
Parameters:
names -

getProviderURLPattern

public java.lang.String getProviderURLPattern()
Get the Context.PROVIDER_URL regular expression.

Specified by:
getProviderURLPattern in interface PingJndiMBean (src)
Returns:
the regular expression containing the host, for example 'jnp://(host):1099/'

setProviderURLPattern

public void setProviderURLPattern(java.lang.String regex)
Set the regular expression containing the hostname/IP address of the JNDI provider. This expression is used to build the JNDI Context.PROVIDER_URL for each node in the cluster. The expression should contain a "(host)" component that will be replaced with the cluster node hostname.

Specified by:
setProviderURLPattern in interface PingJndiMBean (src)
Parameters:
regex - the regular expression containing the host, for example 'jnp://(host):1099/'

membershipChanged

public void membershipChanged(java.util.ArrayList removed,
                              java.util.ArrayList added,
                              java.util.ArrayList members,
                              java.lang.String logCategoryName)
The TopologyMonitorService trigger callback operation.

Specified by:
membershipChanged in interface PingJndiMBean (src)
Parameters:
removed - ArrayList of nodes that were removed
added - ArrayList of nodes that were added
members - ArrayList of nodes currently in the cluster
logCategoryName - the log4j category name used by the TopologyMonitorService. This is used for logging to integrate with the TopologyMonitorService output.