org.e2etrace.trace
Interface ITraceSessionManager

All Known Implementing Classes:
AbstractTraceSessionManager, DefaultTraceSessionManager, ThreadedTraceSessionManager

public interface ITraceSessionManager

Manages the trace sessions of the current application.

An application should only maintain a single trace session manager. However, the session manager may be able to administer multiple trace sessions, e.g. one for every thread of the application. For details, please refer to the concrete session manager implementations.

Author:
Gunther Popp

Method Summary
 ITraceConfig getConfig()
          Returns the current trace configuration.
 ITraceSession getCurrentSession()
          Returns the current (active) trace session.
 void releaseCurrentSession()
          Release current session.
 void setConfig(ITraceConfig config)
          Assign a new trace configuration to the session manager.
 void setCurrentSession(ITraceSession session)
          Sets the current (active) trace session.
 

Method Detail

getCurrentSession

ITraceSession getCurrentSession()
Returns the current (active) trace session.

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.

Returns:
trace session

setCurrentSession

void setCurrentSession(ITraceSession session)
Sets the current (active) trace session.

Parameters:
session - new current trace session

releaseCurrentSession

void releaseCurrentSession()
Release current session.

This call releases the reference to the current trace session. It should be called in when all trace data for the current trace session has been collected and the session is no longer needed.


setConfig

void setConfig(ITraceConfig config)
Assign a new trace configuration to the session manager.

The configuration will be used by the manager itself and all trace sessions under its control.

Parameters:
config - trace configuration

getConfig

ITraceConfig getConfig()
Returns the current trace configuration.

Returns:
trace configuration


Copyright © 2013 Gunther Popp. All Rights Reserved.