Summer.Batch.Common.Util.ConcurrencyThrottleSupport Class Reference

Support class for throttling concurrent access to a specific resource. Designed for use as a base class, with the subclass invoking BeforeAccess and AfterAccess methods at appropriate points of its workflow. Note that AfterAccess should usually be called in a finally block! The default concurrency limit of this support class is -1 ("unbounded concurrency"). Subclasses may override this default; check the javadoc of the concrete class that you're using. More...

Public Member Functions

bool IsThrottleActive ()
 Returns whether this throttle is currently active. More...
 

Public Attributes

const int UnboundedConcurrency = -1
 Allows any number of concurrent invocations: that is, does not throttle concurrency. More...
 
const int NoConcurrency = 0
 Switch concurrency 'off': that is, does not allow any concurrent invocations. More...
 

Protected Member Functions

void BeforeAccess ()
 To be invoked before the main execution logic of concrete subclasses. This implementation applies the concurrency throttle. More...
 
void AfterAccess ()
 To be invoked after the main execution logic of concrete subclasses. More...
 

Properties

int ConcurrencyLimit [get, set]
 The maximum number of concurrent access attempts allowed. -1 indicates unbounded concurrency. In principle, this limit can be changed at runtime, although it is generally designed as a config time setting. NOTE: Do not switch between -1 and any concrete limit at runtime, as this will lead to inconsistent concurrency counts: A limit of -1 effectively turns off concurrency counting completely. More...
 

Detailed Description

Support class for throttling concurrent access to a specific resource. Designed for use as a base class, with the subclass invoking BeforeAccess and AfterAccess methods at appropriate points of its workflow. Note that AfterAccess should usually be called in a finally block! The default concurrency limit of this support class is -1 ("unbounded concurrency"). Subclasses may override this default; check the javadoc of the concrete class that you're using.

Member Function Documentation

void Summer.Batch.Common.Util.ConcurrencyThrottleSupport.AfterAccess ( )
protected

To be invoked after the main execution logic of concrete subclasses.

void Summer.Batch.Common.Util.ConcurrencyThrottleSupport.BeforeAccess ( )
protected

To be invoked before the main execution logic of concrete subclasses. This implementation applies the concurrency throttle.

bool Summer.Batch.Common.Util.ConcurrencyThrottleSupport.IsThrottleActive ( )

Returns whether this throttle is currently active.

Returns
true if the concurrency limit for this instance is active

Member Data Documentation

const int Summer.Batch.Common.Util.ConcurrencyThrottleSupport.NoConcurrency = 0

Switch concurrency 'off': that is, does not allow any concurrent invocations.

const int Summer.Batch.Common.Util.ConcurrencyThrottleSupport.UnboundedConcurrency = -1

Allows any number of concurrent invocations: that is, does not throttle concurrency.

Property Documentation

int Summer.Batch.Common.Util.ConcurrencyThrottleSupport.ConcurrencyLimit
getset

The maximum number of concurrent access attempts allowed. -1 indicates unbounded concurrency. In principle, this limit can be changed at runtime, although it is generally designed as a config time setting. NOTE: Do not switch between -1 and any concrete limit at runtime, as this will lead to inconsistent concurrency counts: A limit of -1 effectively turns off concurrency counting completely.


The documentation for this class was generated from the following file:
  • Summer.Batch.Common/Util/ConcurrencyThrottleSupport.cs