Package org.openbravo.cluster
Class JmxClusterServiceManager
- java.lang.Object
-
- org.openbravo.cluster.JmxClusterServiceManager
-
- All Implemented Interfaces:
JmxClusterServiceManagerMBean
@ApplicationScoped public class JmxClusterServiceManager extends Object implements JmxClusterServiceManagerMBean
An standard MBean that allows to display and manage some of the cluster services settings through JMX.
-
-
Constructor Summary
Constructors Constructor Description JmxClusterServiceManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disablePingForService(String serviceName)
Forces the current node to stop doing pings for a particular cluster service.void
enablePingForService(String serviceName)
Enables the ping service for a particular cluster service.Map<String,String>
getClusterServiceLeaders()
Map<String,String>
getClusterServiceSettings()
String
getCurrentNodeId()
String
getCurrentNodeName()
Date
getLastPingOfCurrentNode()
-
-
-
Method Detail
-
getCurrentNodeId
public String getCurrentNodeId()
- Specified by:
getCurrentNodeId
in interfaceJmxClusterServiceManagerMBean
- Returns:
- the unique identifier of the current cluster node.
-
getCurrentNodeName
public String getCurrentNodeName()
- Specified by:
getCurrentNodeName
in interfaceJmxClusterServiceManagerMBean
- Returns:
- the name of the current cluster node.
-
getLastPingOfCurrentNode
public Date getLastPingOfCurrentNode()
- Specified by:
getLastPingOfCurrentNode
in interfaceJmxClusterServiceManagerMBean
- Returns:
- the Date of the last ping done (for any service) by the current node.
-
getClusterServiceLeaders
public Map<String,String> getClusterServiceLeaders()
- Specified by:
getClusterServiceLeaders
in interfaceJmxClusterServiceManagerMBean
- Returns:
- a Map with information (leader and last ping) per available cluster service.
-
getClusterServiceSettings
public Map<String,String> getClusterServiceSettings()
- Specified by:
getClusterServiceSettings
in interfaceJmxClusterServiceManagerMBean
- Returns:
- a Map with information of the settings for each available cluster service.
-
enablePingForService
public void enablePingForService(String serviceName)
Description copied from interface:JmxClusterServiceManagerMBean
Enables the ping service for a particular cluster service.- Specified by:
enablePingForService
in interfaceJmxClusterServiceManagerMBean
- Parameters:
serviceName
- the name of the service for which the ping is enabled.
-
disablePingForService
public void disablePingForService(String serviceName)
Description copied from interface:JmxClusterServiceManagerMBean
Forces the current node to stop doing pings for a particular cluster service. In case the current node is the node in charge of handling the service it will be unregistered as the leader of the service.- Specified by:
disablePingForService
in interfaceJmxClusterServiceManagerMBean
- Parameters:
serviceName
- the name of the service for which the ping is disabled.
-
-