| org.apache.cocoon.components.flow.ContinuationsManagerImpl
ContinuationsManagerImpl | public class ContinuationsManagerImpl extends AbstractLogEnabled implements ContinuationsManager,Component,Configurable,ThreadSafe,Instrumentable,Serviceable,Contextualizable(Code) | | The default implementation of
ContinuationsManager . There are
two modes of work:
- standard mode - continuations are stored in single holder. No
security is applied to continuation lookup. Anyone can invoke a continuation
only knowing the ID. Set "session-bound-continuations" configuration option
to false to activate this mode.
- secure mode - each session has it's own continuations holder. A
continuation is only valid for the same session it was created for. Session
invalidation causes all bound continuations to be invalidated as well. Use
this setting for web applications. Set "session-bound-continuations"
configuration option to true to activate this mode.
author: Ovidiu Predescu author: Michael Melhem since: March 19, 2002 See Also: ContinuationsManager version: CVS $Id: ContinuationsManagerImpl.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :protected static class HolderAwareWebContinuation extends WebContinuation | |
Method Summary | |
protected void | _invalidate(WebContinuationsHolder continuationsHolder, WebContinuation wk) | public void | configure(Configuration config) | public void | contextualize(Context context) | public WebContinuation | createWebContinuation(Object kont, WebContinuation parent, int timeToLive, String interpreterId, ContinuationsDisposer disposer) | public void | displayAllContinuations() | protected void | displayExpireSet() | protected void | disposeContinuation(WebContinuationsHolder continuationsHolder, WebContinuation wk) Makes the continuation inaccessible for lookup, and triggers possible needed
cleanup code through the ContinuationsDisposer interface. | protected void | expireContinuations() Remove all continuations which have already expired. | protected WebContinuation | generateContinuation(Object kont, WebContinuation parent, int ttl, String interpreterId, ContinuationsDisposer disposer) Create WebContinuation and generate unique identifier
for it. | public Instrumentable[] | getChildInstrumentables() | public String | getInstrumentableName() | public Instrument[] | getInstruments() | public List | getWebContinuationsDataBeanList() | protected void | handleLeafContinuationExpiration(WebContinuation wk) When a new continuation is created in @link #createWebContinuation(Object, WebContinuation, int, String, ContinuationsDisposer),
it is registered in the expiration set in order to be evaluated by the invalidation mechanism. | protected void | handleParentContinuationExpiration(WebContinuation parent) When a new continuation is created in @link #createWebContinuation(Object, WebContinuation, int, String, ContinuationsDisposer),
its parent continuation is removed from the expiration set. | protected void | invalidateContinuations(WebContinuationsHolder continuationsHolder) Method used by WebContinuationsHolder to notify the continuations manager
about session invalidation. | public void | invalidateWebContinuation(WebContinuation wk) | public WebContinuation | lookupWebContinuation(String id, String interpreterId) | public WebContinuationsHolder | lookupWebContinuationsHolder(boolean createNew) Lookup a proper web continuations holder. | protected void | removeContinuation(WebContinuationsHolder continuationsHolder, WebContinuation wk) Removes an expired leaf WebContinuation node
from its continuation tree, and recursively removes its
parent(s) if it they have expired and have no (other) children. | public void | service(ServiceManager manager) | public void | setInstrumentableName(String instrumentableName) |
CONTINUATION_ID_LENGTH | final static int CONTINUATION_ID_LENGTH(Code) | | |
EXPIRE_CONTINUATIONS | final static String EXPIRE_CONTINUATIONS(Code) | | |
bindContinuationsToSession | protected boolean bindContinuationsToSession(Code) | | |
bytes | protected byte[] bytes(Code) | | |
context | protected Context context(Code) | | |
continuationsCount | protected ValueInstrument continuationsCount(Code) | | |
continuationsCounter | protected int continuationsCounter(Code) | | |
continuationsCreated | protected CounterInstrument continuationsCreated(Code) | | |
continuationsHolder | protected WebContinuationsHolder continuationsHolder(Code) | | Main continuations holder. Used unless continuations are stored in user
session.
|
continuationsInvalidated | protected CounterInstrument continuationsInvalidated(Code) | | |
defaultTimeToLive | protected int defaultTimeToLive(Code) | | How long does a continuation exist in memory since the last
access? The time is in miliseconds, and the default is 1 hour.
|
expirations | protected SortedSet expirations(Code) | | Sorted set of WebContinuation instances, based on
their expiration time. This is used by the background thread to
invalidate continuations.
|
expirationsSize | protected ValueInstrument expirationsSize(Code) | | |
forestSize | protected ValueInstrument forestSize(Code) | | |
isContinuationSharingBugCompatible | protected boolean isContinuationSharingBugCompatible(Code) | | |
random | protected SecureRandom random(Code) | | Random number generator used to create continuation ID
|
serviceManager | protected ServiceManager serviceManager(Code) | | |
ContinuationsManagerImpl | public ContinuationsManagerImpl() throws Exception(Code) | | |
_invalidate | protected void _invalidate(WebContinuationsHolder continuationsHolder, WebContinuation wk)(Code) | | |
configure | public void configure(Configuration config)(Code) | | See Also: org.apache.avalon.framework.configuration.Configurable.configure(org.apache.avalon.framework.configuration.Configuration) |
contextualize | public void contextualize(Context context) throws ContextException(Code) | | See Also: org.apache.avalon.framework.context.Contextualizable.contextualize(org.apache.avalon.framework.context.Context) |
displayAllContinuations | public void displayAllContinuations()(Code) | | Dump to Log file all WebContinuation s
in the system
|
displayExpireSet | protected void displayExpireSet()(Code) | | Dump to Log file the current contents of
the expirations SortedSet
|
disposeContinuation | protected void disposeContinuation(WebContinuationsHolder continuationsHolder, WebContinuation wk)(Code) | | Makes the continuation inaccessible for lookup, and triggers possible needed
cleanup code through the ContinuationsDisposer interface.
Parameters: continuationsHolder - Parameters: wk - the continuation to dispose. |
expireContinuations | protected void expireContinuations()(Code) | | Remove all continuations which have already expired.
|
generateContinuation | protected WebContinuation generateContinuation(Object kont, WebContinuation parent, int ttl, String interpreterId, ContinuationsDisposer disposer)(Code) | | Create WebContinuation and generate unique identifier
for it. The identifier is generated using a cryptographically strong
algorithm to prevent people to generate their own identifiers.
Parameters: kont - an Object value representing continuation Parameters: parent - value representing parent WebContinuation Parameters: ttl - WebContinuation time to live Parameters: interpreterId - id of interpreter invoking continuation creation Parameters: disposer - ContinuationsDisposer instance to use forcleanup of the continuation. the generated WebContinuation with unique identifier |
getChildInstrumentables | public Instrumentable[] getChildInstrumentables()(Code) | | See Also: org.apache.excalibur.instrument.Instrumentable.getChildInstrumentables |
getInstrumentableName | public String getInstrumentableName()(Code) | | See Also: org.apache.excalibur.instrument.Instrumentable.getInstrumentableName |
getInstruments | public Instrument[] getInstruments()(Code) | | See Also: org.apache.excalibur.instrument.Instrumentable.getInstruments |
getWebContinuationsDataBeanList | public List getWebContinuationsDataBeanList()(Code) | | Get a list of all web continuations (data only)
|
handleLeafContinuationExpiration | protected void handleLeafContinuationExpiration(WebContinuation wk)(Code) | | When a new continuation is created in @link #createWebContinuation(Object, WebContinuation, int, String, ContinuationsDisposer),
it is registered in the expiration set in order to be evaluated by the invalidation mechanism.
|
handleParentContinuationExpiration | protected void handleParentContinuationExpiration(WebContinuation parent)(Code) | | When a new continuation is created in @link #createWebContinuation(Object, WebContinuation, int, String, ContinuationsDisposer),
its parent continuation is removed from the expiration set. This way only leaf continuations are part of
the expiration set.
|
invalidateContinuations | protected void invalidateContinuations(WebContinuationsHolder continuationsHolder)(Code) | | Method used by WebContinuationsHolder to notify the continuations manager
about session invalidation. Invalidates all continuations held by passed
continuationsHolder.
|
lookupWebContinuationsHolder | public WebContinuationsHolder lookupWebContinuationsHolder(boolean createNew)(Code) | | Lookup a proper web continuations holder.
Parameters: createNew - should the manager create a continuations holder in sessionwhen none found? |
removeContinuation | protected void removeContinuation(WebContinuationsHolder continuationsHolder, WebContinuation wk)(Code) | | Removes an expired leaf WebContinuation node
from its continuation tree, and recursively removes its
parent(s) if it they have expired and have no (other) children.
Parameters: continuationsHolder - Parameters: wk - WebContinuation node |
service | public void service(ServiceManager manager) throws ServiceException(Code) | | See Also: org.apache.avalon.framework.service.Serviceable.service(org.apache.avalon.framework.service.ServiceManager) |
setInstrumentableName | public void setInstrumentableName(String instrumentableName)(Code) | | See Also: org.apache.excalibur.instrument.Instrumentable.setInstrumentableName(java.lang.String) |
|
|