org.jboss.ha.jndi
Class DetachedHANamingService

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.ha.jndi.DetachedHANamingService
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, DetachedHANamingServiceMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean
Direct Known Subclasses:
HANamingService

public class DetachedHANamingService
extends ServiceMBeanSupport
implements DetachedHANamingServiceMBean

Management Bean for the protocol independent HA-JNDI service. This allows the naming service transport layer to be provided by a detached invoker service like JRMPInvokerHA + ProxyFactoryHA.

Version:
$Revision: 80406 $
Author:
Bill Burke, Sacha Labourey, Scott.Stark@jboss.org

Field Summary
protected  org.jboss.ha.framework.interfaces.HAPartition clusterPartition
          The HAPartition
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DetachedHANamingService()
           
 
Method Summary
protected  void createService()
           
protected  void destroyService()
           
 String getAutoDiscoveryAddress()
          Get the auto-discovery bootstrap multicast address.
 String getAutoDiscoveryBindAddress()
          Get the auto-discovery bootstrap multicast bind address.
 int getAutoDiscoveryGroup()
          Get the Auto-discovery multicast port
 int getAutoDiscoveryTTL()
          Get the TTL (time-to-live) for autodiscovery IP multicast packets
 int getBacklog()
          Get the accept backlog for the bootstrap server socket
 String getBindAddress()
          Get the bootstrap IP address on which the HA-JNDI stub is made available
 boolean getDiscoveryDisabled()
          prevent autodiscovery service from starting
 org.jboss.ha.jndi.spi.DistributedTreeManager getDistributedTreeManager()
          Get the DistributedTreeManager used by this service.
 org.jboss.ha.framework.interfaces.HAPartition getHAPartition()
          Get the underlying partition used by this service.
 org.jnp.interfaces.Naming getLocalNamingInstance()
           
 Map<Long,Method> getMethodMap()
          Expose the Naming service interface mapping as a read-only attribute
protected  org.jnp.interfaces.Naming getNamingProxy()
          Get the Naming proxy for the transport.
 String getPartitionName()
          Gets the name of the partition used by this service.
 int getPort()
          Get the bootstrap port on which the HA-JNDI stub is made available
 ObjectName getProxyFactoryObjectName()
          Get the proxy factory service name used to create the Naming transport proxy.
protected  void initBootstrapListener()
          Bring up the bootstrap lookup port for obtaining the naming service proxy
 Object invoke(Invocation invocation)
          Expose the Naming service via JMX to invokers.
 void setAutoDiscoveryAddress(String adAddress)
          Set the auto-discovery bootstrap multicast address.
 void setAutoDiscoveryBindAddress(String address)
          Set the auto-discovery bootstrap multicast bind address.
 void setAutoDiscoveryGroup(int adGroup)
          Set the Auto-discovery multicast port.
 void setAutoDiscoveryTTL(int ttl)
          Set the TTL (time-to-live) for autodiscovery IP multicast packets
 void setBacklog(int backlog)
          Set the accept backlog for the bootstrap server socket
 void setBindAddress(String host)
          Set the bootstrap IP address on which the HA-JNDI stub is made available
 void setDiscoveryDisabled(boolean disable)
          prevent autodiscovery service from starting
 void setDistributedTreeManager(org.jboss.ha.jndi.spi.DistributedTreeManager distributedTreeManager)
          Sets the DistributedTreeManager used by this service.
 void setHAPartition(org.jboss.ha.framework.interfaces.HAPartition clusterPartition)
          Sets the underlying partition used by this service.
 void setJNPServerSocketFactory(String factoryClassName)
           
 void setLocalNamingInstance(org.jnp.interfaces.Naming localNamingInstance)
           
 void setLookupPool(org.jboss.util.threadpool.BasicThreadPoolMBean poolMBean)
          Set the thread pool used for the bootstrap and autodiscovery lookups
 void setPort(int p)
          Set the bootstrap port on which the HA-JNDI stub is made available
 void setProxyFactoryObjectName(ObjectName proxyFactory)
          Set the proxy factory service name used to create the Naming transport proxy.
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

clusterPartition

protected org.jboss.ha.framework.interfaces.HAPartition clusterPartition
The HAPartition

Constructor Detail

DetachedHANamingService

public DetachedHANamingService()
Method Detail

getMethodMap

public Map<Long,Method> getMethodMap()
Expose the Naming service interface mapping as a read-only attribute

Specified by:
getMethodMap in interface DetachedHANamingServiceMBean
Returns:
A Map of the Naming interface

getPartitionName

public String getPartitionName()
Description copied from interface: DetachedHANamingServiceMBean
Gets the name of the partition used by this service. This is a convenience method as the partition name is an attribute of HAPartition.

Specified by:
getPartitionName in interface DetachedHANamingServiceMBean
Returns:
the name of the partition

getHAPartition

public org.jboss.ha.framework.interfaces.HAPartition getHAPartition()
Description copied from interface: DetachedHANamingServiceMBean
Get the underlying partition used by this service.

Specified by:
getHAPartition in interface DetachedHANamingServiceMBean
Returns:
the partition

setHAPartition

public void setHAPartition(org.jboss.ha.framework.interfaces.HAPartition clusterPartition)
Description copied from interface: DetachedHANamingServiceMBean
Sets the underlying partition used by this service.

Specified by:
setHAPartition in interface DetachedHANamingServiceMBean
Parameters:
clusterPartition - the partition

getDistributedTreeManager

public org.jboss.ha.jndi.spi.DistributedTreeManager getDistributedTreeManager()
Description copied from interface: DetachedHANamingServiceMBean
Get the DistributedTreeManager used by this service.

Specified by:
getDistributedTreeManager in interface DetachedHANamingServiceMBean
Returns:
the cache

setDistributedTreeManager

public void setDistributedTreeManager(org.jboss.ha.jndi.spi.DistributedTreeManager distributedTreeManager)
Description copied from interface: DetachedHANamingServiceMBean
Sets the DistributedTreeManager used by this service.

Specified by:
setDistributedTreeManager in interface DetachedHANamingServiceMBean

getLocalNamingInstance

public org.jnp.interfaces.Naming getLocalNamingInstance()

setLocalNamingInstance

public void setLocalNamingInstance(org.jnp.interfaces.Naming localNamingInstance)

getProxyFactoryObjectName

public ObjectName getProxyFactoryObjectName()
Description copied from interface: DetachedHANamingServiceMBean
Get the proxy factory service name used to create the Naming transport proxy.

Specified by:
getProxyFactoryObjectName in interface DetachedHANamingServiceMBean

setProxyFactoryObjectName

public void setProxyFactoryObjectName(ObjectName proxyFactory)
Description copied from interface: DetachedHANamingServiceMBean
Set the proxy factory service name used to create the Naming transport proxy.

Specified by:
setProxyFactoryObjectName in interface DetachedHANamingServiceMBean

setPort

public void setPort(int p)
Description copied from interface: DetachedHANamingServiceMBean
Set the bootstrap port on which the HA-JNDI stub is made available

Specified by:
setPort in interface DetachedHANamingServiceMBean

getPort

public int getPort()
Description copied from interface: DetachedHANamingServiceMBean
Get the bootstrap port on which the HA-JNDI stub is made available

Specified by:
getPort in interface DetachedHANamingServiceMBean

getBindAddress

public String getBindAddress()
Description copied from interface: DetachedHANamingServiceMBean
Get the bootstrap IP address on which the HA-JNDI stub is made available

Specified by:
getBindAddress in interface DetachedHANamingServiceMBean

setBindAddress

public void setBindAddress(String host)
                    throws UnknownHostException
Description copied from interface: DetachedHANamingServiceMBean
Set the bootstrap IP address on which the HA-JNDI stub is made available

Specified by:
setBindAddress in interface DetachedHANamingServiceMBean
Throws:
UnknownHostException

getBacklog

public int getBacklog()
Description copied from interface: DetachedHANamingServiceMBean
Get the accept backlog for the bootstrap server socket

Specified by:
getBacklog in interface DetachedHANamingServiceMBean

setBacklog

public void setBacklog(int backlog)
Description copied from interface: DetachedHANamingServiceMBean
Set the accept backlog for the bootstrap server socket

Specified by:
setBacklog in interface DetachedHANamingServiceMBean

setDiscoveryDisabled

public void setDiscoveryDisabled(boolean disable)
Description copied from interface: DetachedHANamingServiceMBean
prevent autodiscovery service from starting

Specified by:
setDiscoveryDisabled in interface DetachedHANamingServiceMBean

getDiscoveryDisabled

public boolean getDiscoveryDisabled()
Description copied from interface: DetachedHANamingServiceMBean
prevent autodiscovery service from starting

Specified by:
getDiscoveryDisabled in interface DetachedHANamingServiceMBean

getAutoDiscoveryAddress

public String getAutoDiscoveryAddress()
Description copied from interface: DetachedHANamingServiceMBean
Get the auto-discovery bootstrap multicast address.

Specified by:
getAutoDiscoveryAddress in interface DetachedHANamingServiceMBean

setAutoDiscoveryAddress

public void setAutoDiscoveryAddress(String adAddress)
Description copied from interface: DetachedHANamingServiceMBean
Set the auto-discovery bootstrap multicast address. If null or empty, no auto-discovery bootstrap socket will be created.

Specified by:
setAutoDiscoveryAddress in interface DetachedHANamingServiceMBean

getAutoDiscoveryGroup

public int getAutoDiscoveryGroup()
Description copied from interface: DetachedHANamingServiceMBean
Get the Auto-discovery multicast port

Specified by:
getAutoDiscoveryGroup in interface DetachedHANamingServiceMBean

setAutoDiscoveryGroup

public void setAutoDiscoveryGroup(int adGroup)
Description copied from interface: DetachedHANamingServiceMBean
Set the Auto-discovery multicast port.

Specified by:
setAutoDiscoveryGroup in interface DetachedHANamingServiceMBean

getAutoDiscoveryBindAddress

public String getAutoDiscoveryBindAddress()
Description copied from interface: DetachedHANamingServiceMBean
Get the auto-discovery bootstrap multicast bind address.

Specified by:
getAutoDiscoveryBindAddress in interface DetachedHANamingServiceMBean

setAutoDiscoveryBindAddress

public void setAutoDiscoveryBindAddress(String address)
                                 throws UnknownHostException
Description copied from interface: DetachedHANamingServiceMBean
Set the auto-discovery bootstrap multicast bind address. If not specified and a BindAddress is specified, the BindAddress will be used.

Specified by:
setAutoDiscoveryBindAddress in interface DetachedHANamingServiceMBean
Throws:
UnknownHostException

getAutoDiscoveryTTL

public int getAutoDiscoveryTTL()
Description copied from interface: DetachedHANamingServiceMBean
Get the TTL (time-to-live) for autodiscovery IP multicast packets

Specified by:
getAutoDiscoveryTTL in interface DetachedHANamingServiceMBean

setAutoDiscoveryTTL

public void setAutoDiscoveryTTL(int ttl)
Description copied from interface: DetachedHANamingServiceMBean
Set the TTL (time-to-live) for autodiscovery IP multicast packets

Specified by:
setAutoDiscoveryTTL in interface DetachedHANamingServiceMBean

setJNPServerSocketFactory

public void setJNPServerSocketFactory(String factoryClassName)
                               throws ClassNotFoundException,
                                      InstantiationException,
                                      IllegalAccessException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

setLookupPool

public void setLookupPool(org.jboss.util.threadpool.BasicThreadPoolMBean poolMBean)
Description copied from interface: DetachedHANamingServiceMBean
Set the thread pool used for the bootstrap and autodiscovery lookups

Specified by:
setLookupPool in interface DetachedHANamingServiceMBean

createService

protected void createService()
                      throws Exception
Overrides:
createService in class ServiceMBeanSupport
Throws:
Exception

startService

protected void startService()
                     throws Exception
Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Overrides:
destroyService in class ServiceMBeanSupport
Throws:
Exception

invoke

public Object invoke(Invocation invocation)
              throws Exception
Expose the Naming service via JMX to invokers.

Specified by:
invoke in interface DetachedHANamingServiceMBean
Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
Exception - Failed to invoke method.

initBootstrapListener

protected void initBootstrapListener()
Bring up the bootstrap lookup port for obtaining the naming service proxy


getNamingProxy

protected org.jnp.interfaces.Naming getNamingProxy()
                                            throws Exception
Get the Naming proxy for the transport. This version looks up the proxyFactory service Proxy attribute. Subclasses can override this to set the proxy another way.

Returns:
The Naming proxy for the protocol used with the HAJNDI service
Throws:
Exception


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