org.jboss.ha.framework.server
Class HATarget

java.lang.Object
  extended byorg.jboss.ha.framework.server.HATarget
All Implemented Interfaces:
DistributedReplicantManager.ReplicantListener (src)
Direct Known Subclasses:
HARMIServerImpl.RefreshProxiesHATarget (src)

public class HATarget
extends java.lang.Object
implements DistributedReplicantManager.ReplicantListener (src)

This class is a holder and manager of replicants. It manages lists of replicated objects and changes the list as the HAPartition notifies it.


Field Summary
protected  int allowInvocationsStatus
           
protected  int clusterViewId
           
static int DISABLE_INVOCATIONS
           
static int ENABLE_INVOCATIONS
           
protected  Latch latch
           
protected  Logger (src) log
           
static int MAKE_INVOCATIONS_WAIT
           
protected  HAPartition (src) partition
           
protected  java.lang.String replicantName
           
protected  java.util.ArrayList replicants
           
protected  java.io.Serializable target
           
 
Constructor Summary
HATarget(HAPartition (src)  partition, java.lang.String replicantName, java.io.Serializable target, int allowInvocations)
           
 
Method Summary
protected  void cleanExistenceInCurrentHAPartition()
           
 void destroy()
           
 void disable()
           
 HAPartition (src) getAssociatedPartition()
           
 long getCurrentViewId()
           
 java.util.ArrayList getReplicants()
           
 void init()
           
 boolean invocationsAllowed()
           
protected  void releaseCurrentLatch()
           
 void replicantsChanged(java.lang.String key, java.util.List newReplicants, int newReplicantsViewId)
          Callback called when the content/list of replicant for a given replicant key has changed
 void setInvocationsAuthorization(int status)
           
 java.lang.String toString()
           
 void updateHAPartition(HAPartition (src)  partition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DISABLE_INVOCATIONS

public static final int DISABLE_INVOCATIONS
See Also:
Constant Field Values (src)

MAKE_INVOCATIONS_WAIT

public static final int MAKE_INVOCATIONS_WAIT
See Also:
Constant Field Values (src)

ENABLE_INVOCATIONS

public static final int ENABLE_INVOCATIONS
See Also:
Constant Field Values (src)

replicantName

protected java.lang.String replicantName

replicants

protected java.util.ArrayList replicants

partition

protected HAPartition (src)  partition

log

protected Logger (src)  log

clusterViewId

protected int clusterViewId

target

protected java.io.Serializable target

allowInvocationsStatus

protected int allowInvocationsStatus

latch

protected Latch latch
Constructor Detail

HATarget

public HATarget(HAPartition (src)  partition,
                java.lang.String replicantName,
                java.io.Serializable target,
                int allowInvocations)
         throws java.lang.Exception
Method Detail

init

public void init()
          throws java.lang.Exception
Throws:
java.lang.Exception

toString

public java.lang.String toString()

getCurrentViewId

public long getCurrentViewId()

destroy

public void destroy()

disable

public void disable()

getReplicants

public java.util.ArrayList getReplicants()

updateHAPartition

public void updateHAPartition(HAPartition (src)  partition)
                       throws java.lang.Exception
Throws:
java.lang.Exception

setInvocationsAuthorization

public void setInvocationsAuthorization(int status)

invocationsAllowed

public boolean invocationsAllowed()
                           throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

releaseCurrentLatch

protected void releaseCurrentLatch()

getAssociatedPartition

public HAPartition (src)  getAssociatedPartition()

replicantsChanged

public void replicantsChanged(java.lang.String key,
                              java.util.List newReplicants,
                              int newReplicantsViewId)
Description copied from interface: DistributedReplicantManager.ReplicantListener (src)
Callback called when the content/list of replicant for a given replicant key has changed

Specified by:
replicantsChanged in interface DistributedReplicantManager.ReplicantListener (src)
Parameters:
key - The name of the key of the replicant that has changed
newReplicants - The list of new replicants for the give replicant key
newReplicantsViewId - The new replicant view id corresponding to this change

cleanExistenceInCurrentHAPartition

protected void cleanExistenceInCurrentHAPartition()