org.rhq.enterprise.communications.command.server.discovery
Class AutoDiscovery

java.lang.Object
  extended by org.rhq.enterprise.communications.command.server.CommandMBean
      extended by org.rhq.enterprise.communications.command.server.discovery.AutoDiscovery
All Implemented Interfaces:
EventListener, MBeanRegistration, NotificationListener, AutoDiscoveryMBean

public abstract class AutoDiscovery
extends CommandMBean
implements AutoDiscoveryMBean, NotificationListener

Provides a mechanism to integrate with JBoss/Remoting's Network Registry in order to detect new servers coming on and offline.

Author:
John Mazzitelli

Constructor Summary
AutoDiscovery()
           
 
Method Summary
abstract  void discoveredChangedDomain(org.jboss.remoting.network.NetworkNotification networkNotification)
          Processes a Network Registry notification that indicates the domain has changed.
abstract  void discoveredNewServers(org.jboss.remoting.network.NetworkNotification networkNotification)
          Processes a Network Registry notification that indicates new servers have come online.
abstract  void discoveredRemovedServers(org.jboss.remoting.network.NetworkNotification networkNotification)
          Processes a Network Registry notification that indicates servers have gone offline.
abstract  void discoveredUpdatedServers(org.jboss.remoting.network.NetworkNotification networkNotification)
          Processes a Network Registry notification that indicates servers have been updated.
 String getNetworkRegistryName()
          Returns the JMX ObjectName of the Network Registry that is used to perform auto-discovery.
 ObjectName getNetworkRegistryObjectName()
          Returns the Network Registry Name as an ObjectName.
 void handleNotification(Notification notification, Object handback)
          Receives notifications from the Network Registry indicating that servers are either coming on or offline.
 void setNetworkRegistryName(String name)
          Sets the name (in String form of a JMX ObjectName) of the Network Registry that is used to perform auto-discovery and begins listeningn to it.
 void stopService()
          Unregisters this object as a notification listener on the Network Registry.
 
Methods inherited from class org.rhq.enterprise.communications.command.server.CommandMBean
getLog, getMBeanServer, getObjectName, postDeregister, postRegister, preDeregister, preRegister, startService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoDiscovery

public AutoDiscovery()
Method Detail

getNetworkRegistryName

public String getNetworkRegistryName()
Description copied from interface: AutoDiscoveryMBean
Returns the JMX ObjectName of the Network Registry that is used to perform auto-discovery.

Specified by:
getNetworkRegistryName in interface AutoDiscoveryMBean
Returns:
name of Network Registry MBean
See Also:
AutoDiscoveryMBean.getNetworkRegistryName()

setNetworkRegistryName

public void setNetworkRegistryName(String name)
Description copied from interface: AutoDiscoveryMBean
Sets the name (in String form of a JMX ObjectName) of the Network Registry that is used to perform auto-discovery and begins listeningn to it. The caller must know what it is doing - this must be the name the Network Registry is registered as, otherwise, auto-discovery will fail.

Note that if this object is already listening to a Network Registry, it will be unregistered before setting the name.

Specified by:
setNetworkRegistryName in interface AutoDiscoveryMBean
Parameters:
name - name the registered name of the Network Registry MBean
See Also:
AutoDiscoveryMBean.setNetworkRegistryName(String)

getNetworkRegistryObjectName

public ObjectName getNetworkRegistryObjectName()
Returns the Network Registry Name as an ObjectName.

Returns:
the MBean name of the Network Registry
See Also:
AutoDiscoveryMBean.getNetworkRegistryName()

handleNotification

public void handleNotification(Notification notification,
                               Object handback)
Receives notifications from the Network Registry indicating that servers are either coming on or offline.

Specified by:
handleNotification in interface NotificationListener
See Also:
NotificationListener.handleNotification(javax.management.Notification, java.lang.Object)

stopService

public void stopService()
Unregisters this object as a notification listener on the Network Registry.

Overrides:
stopService in class CommandMBean

discoveredNewServers

public abstract void discoveredNewServers(org.jboss.remoting.network.NetworkNotification networkNotification)
Processes a Network Registry notification that indicates new servers have come online.

Parameters:
networkNotification - the notification that was received from the Network Registry

discoveredRemovedServers

public abstract void discoveredRemovedServers(org.jboss.remoting.network.NetworkNotification networkNotification)
Processes a Network Registry notification that indicates servers have gone offline.

Parameters:
networkNotification - the notification that was received from the Network Registry

discoveredUpdatedServers

public abstract void discoveredUpdatedServers(org.jboss.remoting.network.NetworkNotification networkNotification)
Processes a Network Registry notification that indicates servers have been updated.

Parameters:
networkNotification - the notification that was received from the Network Registry

discoveredChangedDomain

public abstract void discoveredChangedDomain(org.jboss.remoting.network.NetworkNotification networkNotification)
Processes a Network Registry notification that indicates the domain has changed.

Parameters:
networkNotification - the notification that was received from the Network Registry


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.