Compoze Software, Inc.

com.compoze.trigger
Class AbstractTimeoutAlgorithm


java.lang.Object

  |

  +--com.compoze.trigger.AbstractTimeoutAlgorithm

All Implemented Interfaces:
ITimeoutAlgorithm, ITriggerPropertiesKeys, java.io.Serializable
Direct Known Subclasses:
ConstantTimeoutAlgorithm, NagleTimeoutAlgorithm

public abstract class AbstractTimeoutAlgorithm
extends java.lang.Object
implements ITimeoutAlgorithm, ITriggerPropertiesKeys

This class is a potential superclass of all classes that implement ITimeoutAlgorithm. It provides the ability to store the initial and last retry values and count successive retries. Default values for the initial timeout and maximum number of retries are obtained from the TriggerProperties object.

See Also:
Serialized Form

Fields inherited from interface com.compoze.trigger.ITriggerPropertiesKeys
TRIGGER_BACKLOG_KEY, TRIGGER_BINDADDRESS_KEY, TRIGGER_DISCOVERY_GROUP_KEY, TRIGGER_DISCOVERY_MAGIC_KEY, TRIGGER_DISCOVERY_PORT_KEY, TRIGGER_DISCOVERY_SERVER_KEY, TRIGGER_DISCOVERY_TIMEOUT_KEY, TRIGGER_DISCOVERY_TTL_KEY, TRIGGER_EVENTLIST_KEY, TRIGGER_PORT_KEY, TRIGGER_STARTUP_DATASOURCE_NAME, TRIGGER_STARTUP_JDBC_DRIVER, TRIGGER_STARTUP_JDBC_PASSWORD, TRIGGER_STARTUP_JDBC_POOL_SIZE, TRIGGER_STARTUP_JDBC_URL, TRIGGER_STARTUP_JDBC_USERNAME, TRIGGER_STARTUP_KEY, TRIGGER_TIMEOUT_IMPLEMENTOR, TRIGGER_TIMEOUT_INITIAL, TRIGGER_TIMEOUT_NAGLEFACTOR, TRIGGER_TIMEOUT_RETRIES
 
Constructor Summary
AbstractTimeoutAlgorithm()
          Constructor.
AbstractTimeoutAlgorithm(long lInitialTimeout)
          Constructor.
AbstractTimeoutAlgorithm(long lInitialTimeout, int iMaxRetries)
          Constructor.
 
Method Summary
 long getNextTimeout()
          Get the next timeout to use.
abstract  long getNextTimeout(long lInitialTimeout, int iRetries, long lLastTimeout)
          Get the next timeout to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTimeoutAlgorithm


public AbstractTimeoutAlgorithm()
Constructor. The default values for initial timeout and maximum number of retries are used.

AbstractTimeoutAlgorithm


public AbstractTimeoutAlgorithm(long lInitialTimeout)
Constructor. The default value for the maximum number of retries is used.
Parameters:
lInitialTimeout - the initial timeout to use (-1 for no initial)

AbstractTimeoutAlgorithm


public AbstractTimeoutAlgorithm(long lInitialTimeout,
                                int iMaxRetries)
Constructor.
Parameters:
lInitialTimeout - the initial timeout to use (-1 for no initial)
iMaxRetries - the maximum number of tries to use (-1 for no maximum)
Method Detail

getNextTimeout


public long getNextTimeout()
Get the next timeout to use.
Specified by:
getNextTimeout in interface ITimeoutAlgorithm
Returns:
the next timeout, or -1 if no more retries (in milliseconds)

getNextTimeout


public abstract long getNextTimeout(long lInitialTimeout,
                                    int iRetries,
                                    long lLastTimeout)
Get the next timeout to use. If an initial timeout is specified this method is not called the first time.
Parameters:
lInitialTimeout - the initial timeout that was used (-1 for no initial)
iRetryNumber - the current retry number
lLastTimeout - the last timeout that was used
Returns:
the next timeout, or -1 if no more retries (in milliseconds)

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.