Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net
Class ConfigurableQuorumPolicy.MembershipQuorumPolicy

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.ConfigurableQuorumPolicy
          extended by com.tangosol.net.ConfigurableQuorumPolicy.MembershipQuorumPolicy

All Implemented Interfaces:
ActionPolicy
Direct Known Subclasses:
ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy, ConfigurableQuorumPolicy.ProxyQuorumPolicy
Enclosing class:
ConfigurableQuorumPolicy

protected abstract static class ConfigurableQuorumPolicy.MembershipQuorumPolicy
extends ConfigurableQuorumPolicy

MembershipQuorumPolicy is a quorum policy that is stateless and based solely on service membership sizes. MembershipQuorumPolicy uses a state-machine that encodes the allowable Actions, and uses MemberEvents to maintain the state-machine as the service membership changes.


Nested Class Summary
protected  class ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumListener
          QuorumListener is used to subscribe the quorum policy to receive service membership events.
protected static class ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule
          A quorum rule defines a set of allowable actions beyond the rule's threshold size.

 

Nested classes/interfaces inherited from class com.tangosol.net.ConfigurableQuorumPolicy
ConfigurableQuorumPolicy.ClusterQuorumPolicy, ConfigurableQuorumPolicy.MembershipQuorumPolicy, ConfigurableQuorumPolicy.PartitionedCacheQuorumPolicy, ConfigurableQuorumPolicy.ProxyQuorumPolicy, ConfigurableQuorumPolicy.WrapperQuorumPolicy

 

Field Summary
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] m_aRules
          The list of quorum rules.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule m_ruleCurrent
          The current state.
protected  Service m_service
          The Service that this policy applies to.
protected  java.util.Set m_setLeaving
          The set of leaving members.

 

Fields inherited from class com.tangosol.net.ConfigurableQuorumPolicy
m_xmlConfig

 

Constructor Summary
protected ConfigurableQuorumPolicy.MembershipQuorumPolicy(XmlElement xmlConfig)
          Create a MembershipQuorumPolicy using the specified Xml configuration.

 

Method Summary
protected  void configure(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
          Configure and initialize this policy with the specified quorum rules.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule getCurrentRule()
          Return the current quorum rule used by the policy.
protected  java.util.Set getLeavingMembers()
          Return the set of members that are leaving the associated service
protected  int getPolicyPopulation()
          Calculate and return the current size of the member set that contributes to the quorum for this policy domain.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] getQuorumRules()
          Return the quorum rules used by this policy.
protected static int getQuorumValue(XmlElement xmlConfig, java.lang.String sElement)
          Helper function to validate and return the specified quorum element from a quorum-policy configuration element.
 Service getService()
          Return the Service which this policy applies to.
 void init(Service service)
          Called when the specified service loads and configures this policy.
protected  MemberListener instantiateMemberListener()
          Instantiate a member listener to subscribe to service membership events.
protected  void setCurrentRule(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule ruleCurrent)
          Set the current quorum rule used by the policy.
protected  void setQuorumRules(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
          Set the quorum rules used by this policy.
protected  void setService(Service service)
          Set the service that this policy applies to.
protected  ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] sortByThreshold(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
          Sort the specified list of rules in ascending order of member threshold.
 java.lang.String toString()
          Return a human-readable String representation of this ActionPolicy.
protected  void updateCurrentRule()
          Update the currently applicable quorum rule, possibly changing it to reflect growth or shrinkage of the membership size.

 

Methods inherited from class com.tangosol.net.ConfigurableQuorumPolicy
createPolicy, getConfig, getStatusDescription, instantiateClusterPolicy, instantiatePartitionedCachePolicy, instantiateProxyPolicy

 

Methods inherited from interface com.tangosol.net.ActionPolicy
isAllowed

 

Field Detail

m_setLeaving

protected java.util.Set m_setLeaving
The set of leaving members.

m_service

protected Service m_service
The Service that this policy applies to.

m_ruleCurrent

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule m_ruleCurrent
The current state.

m_aRules

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] m_aRules
The list of quorum rules.

Constructor Detail

ConfigurableQuorumPolicy.MembershipQuorumPolicy

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy(XmlElement xmlConfig)
Create a MembershipQuorumPolicy using the specified Xml configuration.
Parameters:
xmlConfig - the Xml configuration

Method Detail

getService

public Service getService()
Return the Service which this policy applies to.
Returns:
the Service which this policy applies to

setService

protected void setService(Service service)
Set the service that this policy applies to.
Parameters:
service - the Service that this policy applies to

getCurrentRule

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule getCurrentRule()
Return the current quorum rule used by the policy.
Returns:
the current quorum rule used by the policy

setCurrentRule

protected void setCurrentRule(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule ruleCurrent)
Set the current quorum rule used by the policy.
Parameters:
ruleCurrent - the current quorum rule used by the policy

setQuorumRules

protected void setQuorumRules(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
Set the quorum rules used by this policy.
Parameters:
aRule - the quorum rules used by this policy

getQuorumRules

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] getQuorumRules()
Return the quorum rules used by this policy.
Returns:
the quorum rules used by this policy

getLeavingMembers

protected java.util.Set getLeavingMembers()
Return the set of members that are leaving the associated service
Returns:
the set of members that are leaving the associated service

getPolicyPopulation

protected int getPolicyPopulation()
Calculate and return the current size of the member set that contributes to the quorum for this policy domain.
Returns:
the current size

getQuorumValue

protected static int getQuorumValue(XmlElement xmlConfig,
                                    java.lang.String sElement)
Helper function to validate and return the specified quorum element from a quorum-policy configuration element.
Parameters:
xmlConfig - the quorum-policy configuration element
sElement - the name of the quorum element to read
Returns:
the configured quorum

sortByThreshold

protected ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] sortByThreshold(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
Sort the specified list of rules in ascending order of member threshold.
Parameters:
aRule - the list of rules to sort
Returns:
the sorted list of rules

configure

protected void configure(ConfigurableQuorumPolicy.MembershipQuorumPolicy.QuorumRule[] aRule)
Configure and initialize this policy with the specified quorum rules.
Parameters:
aRule - the list of quorum rules to configure for this policy

updateCurrentRule

protected void updateCurrentRule()
Update the currently applicable quorum rule, possibly changing it to reflect growth or shrinkage of the membership size.

init

public void init(Service service)
Called when the specified service loads and configures this policy.

Note: A policy could be applied to multiple services.

Parameters:
service - the service that this policy applies to

toString

public java.lang.String toString()
Return a human-readable String representation of this ActionPolicy.

Note: this method may be used to provide information about this ActionPolicy to management interfaces.


instantiateMemberListener

protected MemberListener instantiateMemberListener()
Instantiate a member listener to subscribe to service membership events.
Returns:
a member listener

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.