org.objectweb.jonas.discovery
Class DiscoveryServiceImpl
java.lang.Object
javax.management.NotificationBroadcasterSupport
org.objectweb.jonas.management.ReconfigDispatcher
org.objectweb.jonas.service.AbsServiceImpl
org.objectweb.jonas.discovery.DiscoveryServiceImpl
- All Implemented Interfaces:
- DiscoveryService, DiscoveryServiceImplMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ReconfigDispatcherMBean, Service
- public class DiscoveryServiceImpl
- extends AbsServiceImpl
- implements DiscoveryService, DiscoveryServiceImplMBean
- Author:
- Adriana Danes
The discovery service creates and starts at least a DiscoveryManager which is a MBean
that multicasts
discovery information
to all the servers who joined the
discovery multicast group
.
The discovery service may also create a Enroller and a DiscoveryClient, and in this case
the current server becomes a discovery server
.
Discovery information
contains information allowing to remotely manage a server in the group.
Discovery multicast group
is a group of servers which can be managed remotely by a discovery server.
Discovery server
is the server in the group who detains the discovery information concerning all the
servers in the group.
Method Summary |
protected void |
doInit(javax.naming.Context ctx)
Abstract initialization method to be implemented by sub-classes |
protected void |
doStart()
Start the discovery service |
protected void |
doStop()
Abstract method for service stopping to be implemented by sub-classes |
java.lang.Boolean |
getIsDiscoveryMaster()
|
java.lang.String |
getMulticastAddress()
|
java.lang.String |
getMulticastPort()
|
void |
startDiscoveryMaster()
Management operation allowing to make the current server become a
master if its not already. |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
handleNotification, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DiscoveryServiceImpl
public DiscoveryServiceImpl()
getMulticastAddress
public java.lang.String getMulticastAddress()
- Specified by:
getMulticastAddress
in interface DiscoveryServiceImplMBean
- Returns:
- the multicast group IP address used by the discovery service
getMulticastPort
public java.lang.String getMulticastPort()
- Specified by:
getMulticastPort
in interface DiscoveryServiceImplMBean
- Returns:
- the multicast group port number used by the discovery service
getIsDiscoveryMaster
public java.lang.Boolean getIsDiscoveryMaster()
- Specified by:
getIsDiscoveryMaster
in interface DiscoveryServiceImplMBean
- Returns:
- true if the current server is a discovery server
startDiscoveryMaster
public void startDiscoveryMaster()
throws javax.management.JMException
- Management operation allowing to make the current server become a
master if its not already.
- Specified by:
startDiscoveryMaster
in interface DiscoveryServiceImplMBean
- Throws:
javax.management.JMException
- a JMX exception occured when trying to make current server a discovery master
doInit
protected void doInit(javax.naming.Context ctx)
throws ServiceException
- Description copied from class:
AbsServiceImpl
- Abstract initialization method to be implemented by sub-classes
- Specified by:
doInit
in class AbsServiceImpl
- Parameters:
ctx
- configuration of the service
- Throws:
ServiceException
- service initialization failed
doStart
protected void doStart()
throws ServiceException
- Start the discovery service
- Specified by:
doStart
in class AbsServiceImpl
- Throws:
ServiceException
- An error occured when starting the service
doStop
protected void doStop()
throws ServiceException
- Description copied from class:
AbsServiceImpl
- Abstract method for service stopping to be implemented by sub-classes
- Specified by:
doStop
in class AbsServiceImpl
- Throws:
ServiceException
- service stopping failed