org.ow2.jonas.discovery.jgroups
Class JgroupsDiscoveryServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
          extended by org.ow2.jonas.lib.service.AbsServiceImpl
              extended by org.ow2.jonas.discovery.base.BaseDiscovery
                  extended by org.ow2.jonas.discovery.jgroups.JgroupsDiscoveryServiceImpl
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, DiscoveryServiceImplMBean, DiscoveryService, JgroupsDiscoveryServiceImplMBean, Service

public class JgroupsDiscoveryServiceImpl
extends BaseDiscovery
implements JgroupsDiscoveryServiceImplMBean

This is a JGroups based JOnAS discovery implementation.

Author:
eyindanga

Field Summary
 
Fields inherited from class org.ow2.jonas.discovery.base.BaseDiscovery
urlsList
 
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
JgroupsDiscoveryServiceImpl()
           
 
Method Summary
 void doStart()
          Abstract start-up method to be implemented by sub-classes.
 void doStop()
          Abstract method for service stopping to be implemented by sub-classes.
 String getDiscoveryProtocolVersion()
           
 String getDiscoveryTtl()
           
 int getGreetingListeningPort()
           
 String getJonasName()
           
 String getListeningIp()
           
 int getListeningPort()
           
 String getMulticastAddress()
           
 String getMulticastPort()
           
 ObjectName getMyOn()
           
 String getServerId()
           
 String[] getUrls()
           
 ArrayList getUrlsList()
           
 void setDomainName(String domainName)
           
 void setGroupName(String groupName)
           
 void setHaService(HaService haService)
           
 void setJgroupsConf(String conf)
           
 void setJonasName(String jonasName)
           
 void setListeningIp(String listeningIp)
           
 void setListeningPort(int listeningPort)
           
 void setMyOn(ObjectName myOn)
           
 void setReconnectionTimeout(long reconnectionTimeout)
           
 void setServerId(String serverId)
           
 void setTimeToLive(int ttl)
           
 void setUrls(String[] urls)
           
 void setUrlsList(ArrayList urlsList)
           
 void start(HashMap<String,Object> env, MBeanServer mbeanSrv, String discoveryType)
          Starts JGroups discovery with a given environment and a mbean server.
 void startDiscoveryMaster()
          Make this server a discovery master.
 
Methods inherited from class org.ow2.jonas.discovery.base.BaseDiscovery
getGreetingTimeout, getIsDiscoveryMaster, getJmxService, getTtl, setGreetingTimeout, setJmxService, setMaster, setTtl
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
initLogger, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.discovery.base.DiscoveryServiceImplMBean
getDomainName, getGreetingTimeout, getIsDiscoveryMaster, getTtl, setGreetingTimeout, setMaster, setTtl, start, stop
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

JgroupsDiscoveryServiceImpl

public JgroupsDiscoveryServiceImpl()
Method Detail

doStart

public void doStart()
             throws ServiceException
Description copied from class: AbsServiceImpl
Abstract start-up method to be implemented by sub-classes.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - service start-up failed

start

public void start(HashMap<String,Object> env,
                  MBeanServer mbeanSrv,
                  String discoveryType)
           throws Exception
Starts JGroups discovery with a given environment and a mbean server.

Parameters:
env - Contains discovery properties
mbeanSrv - Contains discovery properties
discoveryType - MBean server of discovery host.
Throws:
Exception - Any

doStop

public 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

getDiscoveryProtocolVersion

public String getDiscoveryProtocolVersion()
Specified by:
getDiscoveryProtocolVersion in interface DiscoveryServiceImplMBean
Returns:
the discovery protocol version number

getDiscoveryTtl

public String getDiscoveryTtl()
Specified by:
getDiscoveryTtl in interface DiscoveryServiceImplMBean
Returns:
the time-to-live of the discovery multicast

startDiscoveryMaster

public void startDiscoveryMaster()
                          throws JMException
Description copied from interface: DiscoveryServiceImplMBean
Make this server a discovery master.

Specified by:
startDiscoveryMaster in interface DiscoveryServiceImplMBean
Throws:
JMException - a JMX exception occured when trying to make current server a discovery master

getJonasName

public String getJonasName()
Specified by:
getJonasName in interface DiscoveryServiceImplMBean
Returns:
the jonasName

getMyOn

public ObjectName getMyOn()
Specified by:
getMyOn in interface DiscoveryServiceImplMBean
Returns:
the myOn

getServerId

public String getServerId()
Specified by:
getServerId in interface DiscoveryServiceImplMBean
Returns:
the serverId

getUrls

public String[] getUrls()
Specified by:
getUrls in interface DiscoveryServiceImplMBean
Returns:
the urls

setDomainName

public void setDomainName(String domainName)
Specified by:
setDomainName in interface DiscoveryServiceImplMBean
Parameters:
domainName - the domainName to set

setJonasName

public void setJonasName(String jonasName)
Specified by:
setJonasName in interface DiscoveryServiceImplMBean
Parameters:
jonasName - the jonasName to set

setMyOn

public void setMyOn(ObjectName myOn)
Specified by:
setMyOn in interface DiscoveryServiceImplMBean
Parameters:
myOn - the myOn to set

setServerId

public void setServerId(String serverId)
Specified by:
setServerId in interface DiscoveryServiceImplMBean
Parameters:
serverId - the serverId to set

setUrls

public void setUrls(String[] urls)
Specified by:
setUrls in interface DiscoveryServiceImplMBean
Parameters:
urls - the urls to set

setGroupName

public void setGroupName(String groupName)
Parameters:
groupName - the groupName to set. Used by the injector

setJgroupsConf

public void setJgroupsConf(String conf)
Parameters:
conf - The JGroups configuration file name to set. Used by the injector

getListeningIp

public String getListeningIp()
Specified by:
getListeningIp in interface DiscoveryServiceImplMBean
Specified by:
getListeningIp in class BaseDiscovery
Returns:
the listeningIp

getListeningPort

public int getListeningPort()
Specified by:
getListeningPort in interface DiscoveryServiceImplMBean
Specified by:
getListeningPort in class BaseDiscovery
Returns:
the listeningPort

getUrlsList

public ArrayList getUrlsList()
Specified by:
getUrlsList in interface DiscoveryServiceImplMBean
Specified by:
getUrlsList in class BaseDiscovery
Returns:
the urlsList

setListeningIp

public void setListeningIp(String listeningIp)
Specified by:
setListeningIp in interface DiscoveryServiceImplMBean
Specified by:
setListeningIp in class BaseDiscovery
Parameters:
listeningIp - the listeningIp to set

setListeningPort

public void setListeningPort(int listeningPort)
Specified by:
setListeningPort in interface DiscoveryServiceImplMBean
Specified by:
setListeningPort in class BaseDiscovery
Parameters:
listeningPort - the listeningPort to set

setUrlsList

public void setUrlsList(ArrayList urlsList)
Specified by:
setUrlsList in interface DiscoveryServiceImplMBean
Specified by:
setUrlsList in class BaseDiscovery
Parameters:
urlsList - the urlsList to set

getGreetingListeningPort

public int getGreetingListeningPort()

setTimeToLive

public void setTimeToLive(int ttl)

getMulticastAddress

public String getMulticastAddress()
Specified by:
getMulticastAddress in interface DiscoveryServiceImplMBean
Returns:
the multicast group IP address used by the discovery service

getMulticastPort

public String getMulticastPort()
Specified by:
getMulticastPort in interface DiscoveryServiceImplMBean
Returns:
the multicast group port number used by the discovery service

setReconnectionTimeout

public void setReconnectionTimeout(long reconnectionTimeout)

setHaService

public void setHaService(HaService haService)


Copyright © 2010 OW2 Consortium. All Rights Reserved.