站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 cluster API Documentation 英文版文档

DistributedReplicantManager (JBoss Cluster API) - JBoss 4.0.1 sp1 cluster API Documentation 英文版文档


org.jboss.ha.framework.interfaces
Interface DistributedReplicantManager

All Known Subinterfaces:
DistributedReplicantManagerImplMBean
All Known Implementing Classes:
DistributedReplicantManagerImpl

public interface DistributedReplicantManager

Version:
$Revision: 1.9 $

Revisions:

2001/10/31: marcf

  1. DRM is no longer remote

2002/08/23: Sacha Labourey

  1. added isMasterReplica
Author:
Bill Burke., Sacha Labourey.

Nested Class Summary
static interface DistributedReplicantManager.ReplicantListener
          When a particular key in the DistributedReplicantManager table gets modified, all listeners will be notified of replicant changes for that key.
 
Method Summary
 void add(String key, Serializable replicant)
          Add a replicant, it will be attached to this cluster node
 Collection getAllServices()
          Return a list of all services that have a least one replicant.
 int getReplicantsViewId(String key)
          Returns an id corresponding to the current view of this set of replicants.
 boolean isMasterReplica(String key)
          Indicates if the current node is the master replica for this given key.
 Serializable lookupLocalReplicant(String key)
          Lookup the replicant attached to this cluster node
 List lookupReplicants(String key)
          Return a list of all replicants.
 List lookupReplicantsNodeNames(String key)
          Return a list of all replicants node names.
 void registerListener(String key, DistributedReplicantManager.ReplicantListener subscriber)
          Subscribe a new listener DistributedReplicantManager.ReplicantListener for replicants change
 void remove(String key)
          Remove the entire key from the ReplicationService
 void unregisterListener(String key, DistributedReplicantManager.ReplicantListener subscriber)
          Unsubscribe a listener DistributedReplicantManager.ReplicantListener that had subscribed for replicants changes
 

Method Detail

registerListener

public void registerListener(String key,
                             DistributedReplicantManager.ReplicantListener subscriber)
Subscribe a new listener DistributedReplicantManager.ReplicantListener for replicants change

Parameters:
key - Name of the replicant, must be identical cluster-wide for all identical replicants
subscriber - The subsribing DistributedReplicantManager.ReplicantListener

unregisterListener

public void unregisterListener(String key,
                               DistributedReplicantManager.ReplicantListener subscriber)
Unsubscribe a listener DistributedReplicantManager.ReplicantListener that had subscribed for replicants changes

Parameters:
key - Name of the replicant, must be identical cluster-wide for all identical replicants
subscriber - The unsubscribing DistributedReplicantManager.ReplicantListener

add

public void add(String key,
                Serializable replicant)
         throws Exception
Add a replicant, it will be attached to this cluster node

Parameters:
key - Replicant name. All replicas around the cluster must use the same key name.
replicant - Local data of the replicant, that is, any serializable data
Throws:
Exception - Thrown if a cluster communication problem occurs

remove

public void remove(String key)
            throws Exception
Remove the entire key from the ReplicationService

Parameters:
key - Name of the replicant
Throws:
Exception - Thrown if a cluster communication problem occurs

lookupLocalReplicant

public Serializable lookupLocalReplicant(String key)
Lookup the replicant attached to this cluster node

Parameters:
key - The name of the replicant
Returns:
The local replicant for the give key name

lookupReplicants

public List lookupReplicants(String key)
Return a list of all replicants.

Parameters:
key - The replicant name
Returns:
An array of serialized replicants available around the cluster for the given key

lookupReplicantsNodeNames

public List lookupReplicantsNodeNames(String key)
Return a list of all replicants node names.

Parameters:
key - The replicant name
Returns:
An array of replicants node names available around the cluster for the given key

getAllServices

public Collection getAllServices()
Return a list of all services that have a least one replicant.

Returns:
A collection of services names (String)

getReplicantsViewId

public int getReplicantsViewId(String key)
Returns an id corresponding to the current view of this set of replicants.

Parameters:
key - The replicant name
Returns:
A view id (doesn't grow sequentially)

isMasterReplica

public boolean isMasterReplica(String key)
Indicates if the current node is the master replica for this given key.

Parameters:
key - The replicant name
Returns:
True if this node is the master


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.