infoservice.dynamic
Class DynamicConfiguration

java.lang.Object
  extended by infoservice.dynamic.DynamicConfiguration

public class DynamicConfiguration
extends java.lang.Object


Field Summary
private  IInfoServiceAgreementAdapter m_agreementAdapter
           
private  int m_agreementLogLevel
           
private  long m_agreementPhaseGap
           
private  IDynamicCascadeBuildingStrategy m_cascadeBuildingStrategy
           
private  long m_emcConsensusLogTimeout
           
private  long m_emcGlobalTimeout
           
private  int m_hourOfAgreement
           
private static DynamicConfiguration m_instance
           
private  int m_maxCascadeLength
           
private  int m_minCascadeLength
           
private  long m_passivePhaseLength
           
private  long m_paxosRoundTimeout
           
 
Constructor Summary
private DynamicConfiguration()
          Private constructor -> singleton
 
Method Summary
 IInfoServiceAgreementAdapter getAgreementHandler()
          Returns the configured IInfoServiceAgreementAdapter
 int getAgreementLogLevel()
          Returns the log level to be used for the agreement-specific file log
 long getAgreementPhaseGap()
          Returns the configured phase gap between commitment and reveal phase in the agreement
 IDynamicCascadeBuildingStrategy getCascadeBuildingStrategy()
          Returns the strategy for building new cascades
 long getEmcConsensusLogTimeout()
          Returns the configured consensus log timeout for EMC
 long getEmcGlobalTimeout()
          Returns the configured global timeout for EMC
 int getHourOfAgreement()
          Returns the hour in which new cascades should be created, e.g.
static DynamicConfiguration getInstance()
          Returns the singleton instance of this class
 int getMaxCascadeLength()
          Returns the configured max cascade length to be used by the dynamic algorithms
 int getMinCascadeLength()
          Returns the configured min cascade length to be used by the dynamic algorithms
 long getPassivePhaseLength()
          Returns the length of the passive phase before the actual agreement
 long getPaxosRoundTimeout()
          Returns the configured round timeout for paxos
private  int parseInt(java.lang.String a_str, int a_default)
          Parses the given string to an int value.
private  int parseLogLevel(java.lang.String logLevel)
          Takes a string and returns a LogLevel.
private  long parseLong(java.lang.String a_str, long a_default)
          Parses the given string to a long value.
 void readConfiguration(java.util.Properties a_properties)
          Reads the configuration values out of the given Properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_emcGlobalTimeout

private long m_emcGlobalTimeout

m_agreementPhaseGap

private long m_agreementPhaseGap

m_emcConsensusLogTimeout

private long m_emcConsensusLogTimeout

m_paxosRoundTimeout

private long m_paxosRoundTimeout

m_minCascadeLength

private int m_minCascadeLength

m_maxCascadeLength

private int m_maxCascadeLength

m_hourOfAgreement

private int m_hourOfAgreement

m_passivePhaseLength

private long m_passivePhaseLength

m_agreementAdapter

private IInfoServiceAgreementAdapter m_agreementAdapter

m_cascadeBuildingStrategy

private IDynamicCascadeBuildingStrategy m_cascadeBuildingStrategy

m_agreementLogLevel

private int m_agreementLogLevel

m_instance

private static final DynamicConfiguration m_instance
Constructor Detail

DynamicConfiguration

private DynamicConfiguration()
Private constructor -> singleton

Method Detail

getInstance

public static DynamicConfiguration getInstance()
Returns the singleton instance of this class

Returns:

readConfiguration

public void readConfiguration(java.util.Properties a_properties)
Reads the configuration values out of the given Properties. If one or more are not present, default values will be applied

Parameters:
a_properties - The Properties holding the configuration values

parseLogLevel

private int parseLogLevel(java.lang.String logLevel)
Takes a string and returns a LogLevel. The strings may be the typical log levels of log4j

Parameters:
logLevel - The string representing a log4j log level
Returns:

getAgreementHandler

public IInfoServiceAgreementAdapter getAgreementHandler()
Returns the configured IInfoServiceAgreementAdapter

Returns:
he configured IInfoServiceAgreementAdapter

getAgreementPhaseGap

public long getAgreementPhaseGap()
Returns the configured phase gap between commitment and reveal phase in the agreement

Returns:
The configured phase gap between commitment and reveal phase in the agreement

getEmcConsensusLogTimeout

public long getEmcConsensusLogTimeout()
Returns the configured consensus log timeout for EMC

Returns:
The configured consensus log timeout for EMC

getEmcGlobalTimeout

public long getEmcGlobalTimeout()
Returns the configured global timeout for EMC

Returns:
The configured global timeout for EMC

getPaxosRoundTimeout

public long getPaxosRoundTimeout()
Returns the configured round timeout for paxos

Returns:
The configured round timeout for paxos

getMaxCascadeLength

public int getMaxCascadeLength()
Returns the configured max cascade length to be used by the dynamic algorithms

Returns:
he configured max cascade length to be used by the dynamic algorithms

getMinCascadeLength

public int getMinCascadeLength()
Returns the configured min cascade length to be used by the dynamic algorithms

Returns:
he configured min cascade length to be used by the dynamic algorithms

parseLong

private long parseLong(java.lang.String a_str,
                       long a_default)
Parses the given string to a long value. If the string is no long, the given default value will be used

Parameters:
a_str - The string to be parsed
a_default - The default to be applied if the string is no long
Returns:
The parsed long

parseInt

private int parseInt(java.lang.String a_str,
                     int a_default)
Parses the given string to an int value. If the string is no int, the given default value will be used

Parameters:
a_str - The string to be parsed
a_default - The default to be applied if the string is no int
Returns:
The parsed int

getHourOfAgreement

public int getHourOfAgreement()
Returns the hour in which new cascades should be created, e.g. 5 for 5 a.m

Returns:
he hour in which new cascades should be created

getCascadeBuildingStrategy

public IDynamicCascadeBuildingStrategy getCascadeBuildingStrategy()
Returns the strategy for building new cascades

Returns:
The strategy for building new cascades

getPassivePhaseLength

public long getPassivePhaseLength()
Returns the length of the passive phase before the actual agreement

Returns:
The length of the passive phase before the actual agreement

getAgreementLogLevel

public int getAgreementLogLevel()
Returns the log level to be used for the agreement-specific file log

Returns:
The log level to be used for the agreement-specific file log