org.jboss.ha.jmx
Interface HAServiceMBean

All Superinterfaces:
NotificationBroadcaster, Service, ServiceMBean
All Known Subinterfaces:
HASingletonControllerMBean, HASingletonMBean, HASingletonSupportMBean
All Known Implementing Classes:
AbstractHAServiceMBeanSupport, HAServiceMBeanSupport, HASingletonController, HASingletonSupport

public interface HAServiceMBean
extends ServiceMBean, NotificationBroadcaster

HA-Service interface. Defines common functionality for partition symmetric (farming) services.

Version:
$Revision: 87447 $
Author:
Ivelin Ivanov

Field Summary
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Method Summary
 List callMethodOnPartition(String methodName, Object[] args, Class[] types)
          Deprecated. does not belong in this general purpose API; will be removed in AS 6; subinterfaces that wish to expose this operation can add it
 Serializable getDistributedState(String key)
          Convenience method for sharing state across a cluster partition.
 String getPartitionName()
          Gets the name of the partition used by this service.
 void sendNotification(Notification notification)
          Broadcast the notification to the remote listener nodes (if any) and then invoke super.sendNotification() to notify local listeners.
 void setClusterPartition(ClusterPartitionMBean clusterPartition)
          Deprecated. use setHAPartition(HAPartition)
 void setDistributedState(String key, Serializable value)
          Convenience method for sharing state across a cluster partition.
 void setHAPartition(org.jboss.ha.framework.interfaces.HAPartition clusterPartition)
          Sets the underlying partition used by this service.
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Method Detail

getPartitionName

String getPartitionName()
Gets the name of the partition used by this service. This is a convenience method as the partition name is an attribute of HAPartition.

Returns:
the name of the partition

setHAPartition

void setHAPartition(org.jboss.ha.framework.interfaces.HAPartition clusterPartition)
Sets the underlying partition used by this service.

Parameters:
clusterPartition - the partition

setClusterPartition

void setClusterPartition(ClusterPartitionMBean clusterPartition)
Deprecated. use setHAPartition(HAPartition)

Sets the underlying partition used by this service.

Parameters:
clusterPartition - the partition

callMethodOnPartition

@Deprecated
List callMethodOnPartition(String methodName,
                                      Object[] args,
                                      Class[] types)
                           throws Exception
Deprecated. does not belong in this general purpose API; will be removed in AS 6; subinterfaces that wish to expose this operation can add it

Convenience method for broadcasting a call to all members of a partition.

Parameters:
methodName -
args - array of Java Object representing the set of parameters to be given to the remote method
types - The types of the parameters
Returns:
a list of responses from remote nodes
Throws:
Exception

getDistributedState

Serializable getDistributedState(String key)
Convenience method for sharing state across a cluster partition. Delegates to the DistributedStateService

Parameters:
key - key for the distributed object
Returns:
Serializable the distributed object

setDistributedState

void setDistributedState(String key,
                         Serializable value)
                         throws Exception
Convenience method for sharing state across a cluster partition. Delegates to the DistributedStateService

Parameters:
key - key for the distributed object
value - the distributed object
Throws:
Exception

sendNotification

void sendNotification(Notification notification)
Broadcast the notification to the remote listener nodes (if any) and then invoke super.sendNotification() to notify local listeners.

Parameters:
notification - sent out to local listeners and other nodes. It should be serializable. It is recommended that the source of the notification is an ObjectName of an MBean that is is available on all nodes where the broadcaster MBean is registered.
See Also:
NotificationBroadcasterSupport.sendNotification(Notification)


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.