public class AccumulatorManager extends java.lang.Object implements Scopeable
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.
| 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 AccumulatorManager.WorkArea |
wa
The container with the instance state.
|
| Constructor and Description |
|---|
AccumulatorManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAccumulator(Accumulator accum)
Adds an accumulator to the current set of accumulators.
|
static AccumulatorManager |
getInstance()
Get the
AccumulatorManager context-local instance. |
ScopeId |
getScopeId()
Get the
ScopeId for the instance. |
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(BlockDefinition block)
Provides a notification that a new scope is about to be entered.
|
private static AccumulatorManager.ContextContainer context
private final AccumulatorManager.WorkArea wa
public static AccumulatorManager getInstance()
AccumulatorManager context-local instance.public static void addAccumulator(Accumulator accum)
accum - The accumulatorpublic void scopeStart(BlockDefinition block)
scopeStart in interface Scopeableblock - The explicit block definition which required this notification.public void scopeFinished()
scopeFinished in interface Scopeablepublic void scopeDeleted()
This is a no-op for accumulators.
scopeDeleted in interface Scopeablepublic ScopeId getScopeId()
ScopeId for the instance.getScopeId in interface ScopeableScopeId.ACCUMULATOR_MANAGER.