public abstract class SessionIdGeneratorBase extends LifecycleBase implements SessionIdGenerator
Lifecycle.SingleUseAFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
SessionIdGeneratorBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
destroyInternal() |
java.lang.String |
generateSessionId()
Generate and return a new session identifier.
|
java.lang.String |
getJvmRoute()
Return the node identifier associated with this node which will be
included in the generated session ID.
|
protected void |
getRandomBytes(byte[] bytes) |
int |
getSessionIdLength()
Return the number of bytes for a session ID
|
protected void |
initInternal() |
void |
setJvmRoute(java.lang.String jvmRoute)
Specify the node identifier associated with this node which will be
included in the generated session ID.
|
void |
setSecureRandomAlgorithm(java.lang.String secureRandomAlgorithm)
Specify a non-default algorithm to use to generate random numbers.
|
void |
setSecureRandomClass(java.lang.String secureRandomClass)
Specify a non-default @{link
SecureRandom implementation to use. |
void |
setSecureRandomProvider(java.lang.String secureRandomProvider)
Specify a non-default provider to use to generate random numbers.
|
void |
setSessionIdLength(int sessionIdLength)
Specify the number of bytes for a session ID
|
protected void |
startInternal()
Sub-classes must ensure that the state is changed to
LifecycleState.STARTING during the execution of this method. |
protected void |
stopInternal()
Sub-classes must ensure that the state is changed to
LifecycleState.STOPPING during the execution of this method. |
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateSessionIdpublic void setSecureRandomClass(java.lang.String secureRandomClass)
SecureRandom implementation to use.secureRandomClass - The fully-qualified class namepublic void setSecureRandomAlgorithm(java.lang.String secureRandomAlgorithm)
secureRandomAlgorithm - The name of the algorithmpublic void setSecureRandomProvider(java.lang.String secureRandomProvider)
secureRandomProvider - The name of the providerpublic java.lang.String getJvmRoute()
getJvmRoute in interface SessionIdGeneratorpublic void setJvmRoute(java.lang.String jvmRoute)
setJvmRoute in interface SessionIdGeneratorjvmRoute - The node identifierpublic int getSessionIdLength()
getSessionIdLength in interface SessionIdGeneratorpublic void setSessionIdLength(int sessionIdLength)
setSessionIdLength in interface SessionIdGeneratorsessionIdLength - Number of bytespublic java.lang.String generateSessionId()
generateSessionId in interface SessionIdGeneratorprotected void getRandomBytes(byte[] bytes)
protected void initInternal()
throws LifecycleException
initInternal in class LifecycleBaseLifecycleExceptionprotected void startInternal()
throws LifecycleException
LifecycleBaseLifecycleState.STARTING during the execution of this method.
Changing state will trigger the Lifecycle.START_EVENT event.
If a component fails to start it may either throw a
LifecycleException which will cause it's parent to fail to start
or it can place itself in the error state in which case LifecycleBase.stop()
will be called on the failed component but the parent component will
continue to start normally.startInternal in class LifecycleBaseLifecycleExceptionprotected void stopInternal()
throws LifecycleException
LifecycleBaseLifecycleState.STOPPING during the execution of this method.
Changing state will trigger the Lifecycle.STOP_EVENT event.stopInternal in class LifecycleBaseLifecycleExceptionprotected void destroyInternal()
throws LifecycleException
destroyInternal in class LifecycleBaseLifecycleExceptionCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.