public class AccumulatorManager extends java.lang.Object implements Scopeable, ScopeableFactory
All references can be added to the top scope (closest enclosing scope).
Implements the Scopeable
interface to allow this class to be
automatically notified of all scope start and end occurances. This removes
the need for client code to be instrumented to provide this service. The
use of this class is now tied to the TransactionManager
class. In
particular, the singleton instance of this class is used in each context-
local list of Scopeable
objects as a dispatcher. This bit
of nastiness is necessary since the Java Interface can't be implemented
on a static basis but instead requires an instance method implementation.
These instance methods then call the static counterparts which is where
the content-local versions of the resource pools are accessed.
The initialization processing is implemented in the initialize()
method and it is called during server startup based on an entry in the
directory until the path "/server/<serverId>/startup" or in
"/server/default/startup".
Modifier and Type | Class and Description |
---|---|
private static class |
AccumulatorManager.ContextContainer
Simple
ContextLocal subclass that properly initializes the
context-local reference to a new instance of a case-sensitive
ScopedSymbolDictionary that has a global scope. |
private static class |
AccumulatorManager.WorkArea
Stores global data relating to the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
private static AccumulatorManager.ContextContainer |
context
Pool of accums which is context-local.
|
private static AccumulatorManager |
single
Singleton instance of this class (across entire JVM, all contexts).
|
Constructor and Description |
---|
AccumulatorManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addAccumulator(Accumulator accum)
Adds an accumulator to the current set of accumulators.
|
Scopeable |
createScopeable()
Provides the singleton instance of this class as a
Scopeable . |
static AccumulatorManager |
getInstance()
Implements the singleton nature of this class, constructs this instance
if it hasn't already been constructed.
|
static void |
initialize()
Initialize the accumulator framework.
|
void |
scopeDeleted()
Provides notification that the external procedure scope has been deleted.
|
void |
scopeFinished()
Provides a notification that a scope is about to be exited.
|
void |
scopeStart()
Provides a notification that a new scope is about to be entered.
|
private static AccumulatorManager.ContextContainer context
private static AccumulatorManager single
public static AccumulatorManager getInstance()
public static void initialize()
TransactionManager
a factory object which
creates a Scopeable
instance.java.lang.IllegalStateException
- If invoked more than once.public Scopeable createScopeable()
Scopeable
.createScopeable
in interface ScopeableFactory
public static void addAccumulator(Accumulator accum)
accum
- The accumulatorpublic void scopeStart()
scopeStart
in interface Scopeable
public void scopeFinished()
scopeFinished
in interface Scopeable
public void scopeDeleted()
This is a no-op for accumulators.
scopeDeleted
in interface Scopeable