org.jboss.remoting.network
Class NetworkRegistry

java.lang.Object
  extended byorg.jboss.remoting.network.NetworkRegistry
All Implemented Interfaces:
MBeanRegistration (src) , NetworkRegistryMBean (src) , NotificationBroadcaster (src)

public class NetworkRegistry
extends java.lang.Object
implements NetworkRegistryMBean (src)

NetworkRegistry is a concrete implemenation of the NetworkRegistryMBean interface. The NetworkRegistry will keep a list of all the detected JBoss servers on the network and provide a local facility for querying for different servers.


Constructor Summary
NetworkRegistry()
           
 
Method Summary
 void addNotificationListener(NotificationListener (src)  notificationListener, NotificationFilter (src)  notificationFilter, java.lang.Object o)
          Add a listener to an MBean.
 void addServer(Identity (src)  identity, InvokerLocator (src) [] invokers)
          add a server for a given identity that is available on the network
 void changeDomain(java.lang.String newDomain)
          change the main domain of the local server
static NetworkRegistry (src) getInstance()
          return the singleton instance
 MBeanNotificationInfo (src) [] getNotificationInfo()
          Returns the notification metadata associated with the MBean.
 NetworkInstance (src) [] getServers()
          return the servers on the network
 boolean hasServer(Identity (src)  identity)
          returns true if the server with the identity is available
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean aBoolean)
          This method is called by the MBeanServer after registration takes place or when registration fails.
 void preDeregister()
          This method is called by the MBeanServer before deregistration takes place.
 ObjectName (src) preRegister(MBeanServer (src)  mBeanServer, ObjectName (src)  objectName)
          This method is called by the MBeanServer before registration takes place.
 NetworkInstance (src) [] queryServers(NetworkFilter (src)  filter)
          query the network registry for 0..* of servers based on a filter.
 void removeNotificationListener(NotificationListener (src)  notificationListener)
          Removes a listener from an MBean.
 void removeServer(Identity (src)  identity)
          remove a server no longer available on the network
 void updateServer(Identity (src)  identity, InvokerLocator (src) [] invokers)
          update the invokers for a given server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkRegistry

public NetworkRegistry()
Method Detail

getInstance

public static final NetworkRegistry (src)  getInstance()
return the singleton instance

Returns:

addServer

public void addServer(Identity (src)  identity,
                      InvokerLocator (src) [] invokers)
add a server for a given identity that is available on the network

Specified by:
addServer in interface NetworkRegistryMBean (src)
Parameters:
identity -
invokers -

updateServer

public void updateServer(Identity (src)  identity,
                         InvokerLocator (src) [] invokers)
update the invokers for a given server

Specified by:
updateServer in interface NetworkRegistryMBean (src)
Parameters:
identity -
invokers -

getServers

public NetworkInstance (src) [] getServers()
return the servers on the network

Specified by:
getServers in interface NetworkRegistryMBean (src)
Returns:

hasServer

public boolean hasServer(Identity (src)  identity)
returns true if the server with the identity is available

Specified by:
hasServer in interface NetworkRegistryMBean (src)
Parameters:
identity -
Returns:

queryServers

public NetworkInstance (src) [] queryServers(NetworkFilter (src)  filter)
query the network registry for 0..* of servers based on a filter. if the filter is null, it is considered a wildcard.

Specified by:
queryServers in interface NetworkRegistryMBean (src)
Parameters:
filter -
Returns:

removeServer

public void removeServer(Identity (src)  identity)
remove a server no longer available on the network

Specified by:
removeServer in interface NetworkRegistryMBean (src)
Parameters:
identity -

addNotificationListener

public void addNotificationListener(NotificationListener (src)  notificationListener,
                                    NotificationFilter (src)  notificationFilter,
                                    java.lang.Object o)
                             throws java.lang.IllegalArgumentException
Description copied from interface: NotificationBroadcaster (src)
Add a listener to an MBean.

Specified by:
addNotificationListener in interface NotificationBroadcaster (src)
Parameters:
notificationListener - implementation of the listener object
notificationFilter - implementation of the filter object or null if no filtering is required
o - A handback object associated with each notification sent by this notification broadcaster.
Throws:
java.lang.IllegalArgumentException - if listener is null

getNotificationInfo

public MBeanNotificationInfo (src) [] getNotificationInfo()
Description copied from interface: NotificationBroadcaster (src)
Returns the notification metadata associated with the MBean.

Specified by:
getNotificationInfo in interface NotificationBroadcaster (src)
Returns:
MBean's notification metadata
See Also:
MBeanNotificationInfo (src)

removeNotificationListener

public void removeNotificationListener(NotificationListener (src)  notificationListener)
                                throws ListenerNotFoundException (src) 
Description copied from interface: NotificationBroadcaster (src)
Removes a listener from an MBean.

Specified by:
removeNotificationListener in interface NotificationBroadcaster (src)
Parameters:
notificationListener - the listener object to remove
Throws:
ListenerNotFoundException (src) - if the listener was not found

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after deregistration takes place.

Specified by:
postDeregister in interface MBeanRegistration (src)

postRegister

public void postRegister(java.lang.Boolean aBoolean)
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after registration takes place or when registration fails.

Specified by:
postRegister in interface MBeanRegistration (src)
Parameters:
aBoolean - the MBeanServer passes true when the MBean was registered, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before deregistration takes place.

The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preDeregister in interface MBeanRegistration (src)
Throws:
java.lang.Exception

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  mBeanServer,
                              ObjectName (src)  objectName)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before registration takes place. The MBean is passed a reference of the MBeanServer it is about to be registered with. The MBean must return the ObjectName it will be registered with. The MBeanServer can pass a suggested object depending upon how the MBean is registered.

The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preRegister in interface MBeanRegistration (src)
Returns:
the actual ObjectName to register this MBean with.
Throws:
java.lang.Exception - for any error, the MBean is not registered.

changeDomain

public void changeDomain(java.lang.String newDomain)
change the main domain of the local server

Specified by:
changeDomain in interface NetworkRegistryMBean (src)
Parameters:
newDomain -