Compoze Software, Inc.

com.compoze.trigger
Class NagleTimeoutAlgorithm


java.lang.Object

  |

  +--com.compoze.trigger.AbstractTimeoutAlgorithm

        |

        +--com.compoze.trigger.NagleTimeoutAlgorithm

All Implemented Interfaces:
ITimeoutAlgorithm, ITriggerPropertiesKeys, java.io.Serializable

public class NagleTimeoutAlgorithm
extends AbstractTimeoutAlgorithm
implements java.io.Serializable, ITriggerPropertiesKeys

This class implements a Nagle timeout algorithm. Each successive wait between retries is multiplied by a value so that initial retries can occur relatively rapidly with respect to successive retries.

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
NagleTimeoutAlgorithm()
          Constructor.
NagleTimeoutAlgorithm(long lInitialTimeout, int iNagleFactor, int iRetries)
          Constructor.
 
Method Summary
 long getNextTimeout(long lInitialTimeout, int iRetries, long lLastTimeout)
          Get the next timeout to use.
 
Methods inherited from class com.compoze.trigger.AbstractTimeoutAlgorithm
getNextTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NagleTimeoutAlgorithm


public NagleTimeoutAlgorithm()
Constructor. Defaults are obtained from the TriggerProperties class.

NagleTimeoutAlgorithm


public NagleTimeoutAlgorithm(long lInitialTimeout,
                             int iNagleFactor,
                             int iRetries)
Constructor.
Parameters:
lInitialTimeout - the initial timeout to use
iNagleFactor - the Nagle factor
iRetries - the maximum number of retries
Method Detail

getNextTimeout


public 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.
Overrides:
getNextTimeout in class AbstractTimeoutAlgorithm
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.