|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.e2etrace.trace.AbstractTraceSessionManager
public abstract class AbstractTraceSessionManager
Base class for all trace session manager implementations.
The base class automatically loads a trace configuration if a property
e2etrace.configuration
has been defined. This property must contain the name of a valid e2etrace
configuration file. For example, if
-De2etrace.configuration=e2etrace.properties is passed on the
command line of the application, the respective file will be looked up in the
classpath and loaded into an instance of PropertiesTraceConfig. The
base class applies the following rules to determine the correct configuration
class for a file name:
.properties: Load file into
PropertiesTraceConfig.
If e2etrace.configuration has not been defined, a
default trace configuration (see DefaultTraceConfig
will be used for the trace session manager.
If tracing has been disabled in the trace config,
getCurrentSession will always return a NOOP trace session (see
NoopTraceSession.
| Constructor Summary | |
|---|---|
protected |
AbstractTraceSessionManager()
Constructor. |
| Method Summary | |
|---|---|
protected abstract void |
assignCurrentSession(ITraceSession session)
CALL-BACK: Forward a newly assigned current trace session to sub-classes. |
ITraceConfig |
getConfig()
Returns the current trace configuration. |
ITraceSession |
getCurrentSession()
Returns the current (active) trace session. |
protected abstract ITraceSession |
requestCurrentSession()
CALL-BACK: Request the current trace session from sub-classes. |
void |
setConfig(ITraceConfig config)
Assign a new trace configuration to the session manager. |
void |
setCurrentSession(ITraceSession session)
Sets the current (active) trace session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.e2etrace.trace.ITraceSessionManager |
|---|
releaseCurrentSession |
| Constructor Detail |
|---|
protected AbstractTraceSessionManager()
| Method Detail |
|---|
protected abstract ITraceSession requestCurrentSession()
This call-back is triggered for every invokation of
getCurrentSession.
protected abstract void assignCurrentSession(ITraceSession session)
This call-back is triggered for every invokation of
setCurrentSession.
session - new current (active) trace sessionpublic final void setConfig(ITraceConfig config)
The configuration will be used by the manager itself and all trace sessions under its control.
setConfig in interface ITraceSessionManagerconfig - trace configurationpublic final ITraceConfig getConfig()
getConfig in interface ITraceSessionManagerpublic ITraceSession getCurrentSession()
If no current trace session has been assigned yet using setCurrentSession or
if releaseCurrentSession has been called, a NoopTraceSession will
be returned. This allows, for example, the execution of unit-tests for classes that
contain enterStep/leaveStep without intializing a trace session first.
getCurrentSession in interface ITraceSessionManagerpublic void setCurrentSession(ITraceSession session)
setCurrentSession in interface ITraceSessionManagersession - new current trace session
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||