Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

com::cosylab::logging::engine::ACS::LCEngine Class Reference

Inheritance diagram for com::cosylab::logging::engine::ACS::LCEngine:

Inheritance graph
[legend]
Collaboration diagram for com::cosylab::logging::engine::ACS::LCEngine:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LCEngine ()
 LCEngine (boolean autoReconn)
 LCEngine (boolean autoReconn, FiltersVector filters)
void connect ()
void connect (String newAccessType)
void connect (ORB theORB, Manager mgr)
synchronized void close (boolean sync)
synchronized void disconnect ()
java.lang.String getAccessType ()
void setAccessType (String newAccessType)
void setConnectionParams (ORB theORB, Manager mgr)
boolean isConnected ()
void setSupended (boolean suspended)
void enableAutoReconnection (boolean autoRec)
void setPaused (boolean pause)
void addLogListener (ACSRemoteLogListener listener)
void addRawLogListener (ACSRemoteRawLogListener listener)
void addLogErrorListener (ACSRemoteErrorListener listener)
void addLogConnectionListener (ACSLogConnectionListener listener)
void setFilters (FiltersVector newFilters, boolean append)
void setDiscardLevel (LogTypeHelper newDiscardLevel)
void setAudience (EngineAudienceHelper newAudience)
void addFilter (Filter filter)
void clearFilters ()
FiltersVector getFilters ()
LogTypeHelper getActualDiscardLevel ()
LogTypeHelper getDiscardLevel ()
EngineAudienceHelper getAudience ()
boolean isFiltered ()
String getFiltersString ()
void setMaxInputRate (int rate)
int getMaxInputRate ()
int getActualInputRate ()
void setMaxOutputRate (int rate)
int getMaxOutputRate ()
int getActualOutputRate ()
int waitingLogsNumber ()
void enableDynamicDiscarding (int threshold, int damping, int interval)

Private Member Functions

void disconnectRA ()

Private Attributes

final int CHECK_INTERVAL = 15
boolean wasConnected = false
AccessChecker connCheckerThread = null
boolean terminateThread = false
RemoteAccess remoteAccess = null
EngineAudienceHelper audience = EngineAudienceHelper.NO_AUDIENCE
FiltersVector filters = null
String accessType = "ACS"
ORB orb = null
Manager manager = null
boolean autoReconnect = false
ACSListenersDispatcher listenersDispatcher = new ACSListenersDispatcher()
ACSLogRetrieval logRetrieval = null

Detailed Description

LCEngine connects to the logging NC and sends messages to the listeners.

A LCEngine object can have an audience (as defined in the log_audience IDL module). If an audience is in use, a special set of filters will be applied.

It is possible to define custom filters to apply to the incoming logs. In this case, only the logs that pass all the filters are sent to the listeners. The filters do not apply to RAW (i.e. XML) log listeners. The custom filters are applied after the audience filtering.

There are three type of listeners supported: - ACSLogConnectionListener: listens events related to the connection with the logging NC and reportMessages - ACSRemoteLogListener: listens for LogEntries - ACSRemoteRawLogListener: listens for XML strings representing logs

It there are no ACSRemoteLogLiestenersRegistered then the string received from the NC is not parsed

The logs read from the NC are sent to the logRetrieval that, in turn, send them to the registered listeners. Audience and filtering are implemented by ACSLogRetrieval.

See also:
ACSRemoteLogListener

ACSRemoteRawLogListener

ACSLogConnectionListener


Constructor & Destructor Documentation

com::cosylab::logging::engine::ACS::LCEngine::LCEngine  )  [inline]
 

LCEngine constructor

com::cosylab::logging::engine::ACS::LCEngine::LCEngine boolean  autoReconn  )  [inline]
 

LCEngine constructor.

Parameters:
autoReconn If true the engine automatically reconnects

com::cosylab::logging::engine::ACS::LCEngine::LCEngine boolean  autoReconn,
FiltersVector  filters
[inline]
 

LCEngine constructor.

This constructor allows to define a set of filters to apply to incoming logs: only the logs passing the filters are sent to the listeners.

Parameters:
autoReconn If true the engine automatically reconnects
filters The filters to apply to the incoming logs. filters can be null or empty.


Member Function Documentation

void com::cosylab::logging::engine::ACS::LCEngine::addFilter Filter  filter  )  [inline]
 

Add a new filters to the vector of filters to apply to the incoming logs before sending to the listeners.

The filter is applied as active.

Parameters:
filter The not null filter to add

void com::cosylab::logging::engine::ACS::LCEngine::addLogConnectionListener ACSLogConnectionListener  listener  )  [inline]
 

Add a connection listener

Parameters:
listener The listener to add
See also:
ACSLogConnectionListener

void com::cosylab::logging::engine::ACS::LCEngine::addLogErrorListener ACSRemoteErrorListener  listener  )  [inline]
 

Add an error listener

Parameters:
listener The error listener to add
See also:
ACSRemoteErrorListener

void com::cosylab::logging::engine::ACS::LCEngine::addLogListener ACSRemoteLogListener  listener  )  [inline]
 

Add a log listener

Parameters:
listener The listener to add
See also:
ACSRemoteLogListener

void com::cosylab::logging::engine::ACS::LCEngine::addRawLogListener ACSRemoteRawLogListener  listener  )  [inline]
 

Add a RAW log listener

Parameters:
listener The listener to add
See also:
ACSRemoteRawLogListener

void com::cosylab::logging::engine::ACS::LCEngine::clearFilters  )  [inline]
 

Remove all the filters.

After calling this method, all the received logs are forwarded to the listeners.

synchronized void com::cosylab::logging::engine::ACS::LCEngine::close boolean  sync  )  [inline]
 

Close the engine and free the resources.

Parameters:
sync If true the closing is made in a synchronized way.

void com::cosylab::logging::engine::ACS::LCEngine::connect ORB  theORB,
Manager  mgr
[inline]
 

LCEngine starts an attempt to connect to the remote system. Connection is handled in a separate Thread

Parameters:
theORB The ORB (can be null)
mgr The reference to the manager (can be null)
See also:
LCEngine$AccessSetter

void com::cosylab::logging::engine::ACS::LCEngine::connect String  newAccessType  )  [inline]
 

LCEngine starts an attempt to connect to the remote system. Connection is handled in a separate Thread

Parameters:
accessTyp The access type
See also:
LCEngine$AccessSetter

void com::cosylab::logging::engine::ACS::LCEngine::connect  )  [inline]
 

LCEngine starts an attempt to connect to the remote system. Connection is handled in a separate Thread

See also:
LCEngine$AccessSetter

synchronized void com::cosylab::logging::engine::ACS::LCEngine::disconnect  )  [inline]
 

LCEngine starts an attempt to connect to the remote system. Connection is handled in a separate Thread

See also:
LCEngine$AccessSetter

void com::cosylab::logging::engine::ACS::LCEngine::disconnectRA  )  [inline, private]
 

Disconnect the remote access

void com::cosylab::logging::engine::ACS::LCEngine::enableAutoReconnection boolean  autoRec  )  [inline]
 

Enable/disable the auto reconnection

Parameters:
autoRec If true the engine tries to reconnect automatically

void com::cosylab::logging::engine::ACS::LCEngine::enableDynamicDiscarding int  threshold,
int  damping,
int  interval
[inline]
 

Enable or disable the dynamic change of the discard level depending on the amount of available memory.

Parameters:
threashold The discard level is increased when the available memory for the application is less then the threshold (in bytes). Integer.MAX_VALUE disables this feature.
damping The damping factor is used to avoid oscillations The discard level is decreased when the free memory is is greater then the threshold plus the dumping.
interval The time (in seconds) between two adjustments of the dynamic discard level. interval defaults to 10.
See also:
ACSLogRetrieval

java.lang.String com::cosylab::logging::engine::ACS::LCEngine::getAccessType  )  [inline]
 

Insert the method's description here. Creation date: (2/18/2002 9:58:30 AM)

Returns:
java.lang.String

LogTypeHelper com::cosylab::logging::engine::ACS::LCEngine::getActualDiscardLevel  )  [inline]
 

Return the discard level in use by the engine.

Note: the actual discard level may or may not be the same discard level set by the user. They differ if the user enabled the dynamic change of the discard level depending on the available memory .

Returns:
The actual discard level (can be null)
See also:
ACSLogRetrieval.getDiscardlevel(), LogMatcher.getActualDiscardLevel()

getDiscardLevel()

int com::cosylab::logging::engine::ACS::LCEngine::getActualInputRate  )  [inline]
 

Returns:
The actual input rate
See ACSLogRetrieval for further details.

int com::cosylab::logging::engine::ACS::LCEngine::getActualOutputRate  )  [inline]
 

Returns:
The actual input rate
See ACSLogRetrieval for further details.

EngineAudienceHelper com::cosylab::logging::engine::ACS::LCEngine::getAudience  )  [inline]
 

Returns:
The discard level (can be null)

LogTypeHelper com::cosylab::logging::engine::ACS::LCEngine::getDiscardLevel  )  [inline]
 

Return the discard level set by the user.

Note: the discard level in use can be different if the dynamic change of the discard level depending on the available memory in the engine has been activated.

Returns:
The discard level (can be null)
See also:
ACSLogRetrieval.getDiscardlevel(), LogMatcher.getActualDiscardLevel()

getActualDiscardLevel()

FiltersVector com::cosylab::logging::engine::ACS::LCEngine::getFilters  )  [inline]
 

Return the filters to filter the incoming logs before sending to the listeners

Returns:
The filters (can be null)

Implements com::cosylab::logging::engine::Filterable.

String com::cosylab::logging::engine::ACS::LCEngine::getFiltersString  )  [inline]
 

Returns:
A description of the active filters
See also:
FiltersVector.getFilterString()

int com::cosylab::logging::engine::ACS::LCEngine::getMaxInputRate  )  [inline]
 

Returns:
The actual max input rate
See ACSLogRetrieval for further details.

int com::cosylab::logging::engine::ACS::LCEngine::getMaxOutputRate  )  [inline]
 

Returns:
The actual max input rate
See ACSLogRetrieval for further details.

boolean com::cosylab::logging::engine::ACS::LCEngine::isConnected  )  [inline]
 

Returns:
ture if the engine is connected to the notification channel

boolean com::cosylab::logging::engine::ACS::LCEngine::isFiltered  )  [inline]
 

Return true if the engine is applying filters. If a filter is in place but not enabled then it is ignored.

Returns:
true if there are filters active in the engine
See also:
FiltersVector.hasActiveFilters()

void com::cosylab::logging::engine::ACS::LCEngine::setAccessType String  newAccessType  )  [inline]
 

Insert the method's description here. Creation date: (2/18/2002 9:58:30 AM)

Parameters:
newAccessType java.lang.String

void com::cosylab::logging::engine::ACS::LCEngine::setAudience EngineAudienceHelper  newAudience  )  [inline]
 

Set the audience for the engine. If an audience is defined, a special set of filters is applied.

Parameters:
newAudience The not null</code >audience

void com::cosylab::logging::engine::ACS::LCEngine::setConnectionParams ORB  theORB,
Manager  mgr
[inline]
 

Set the connection params fro this

Parameters:
theORB The ORB. It can't be null if the manager is not null
mgr The reference to the Manager

void com::cosylab::logging::engine::ACS::LCEngine::setDiscardLevel LogTypeHelper  newDiscardLevel  )  [inline]
 

Set the discard level for filtering.

Note: if the dynamic change of the discard level depending on the memory usage has been activated, then the discard level effectively used by the engine might be greater then newDiscardlevel.

Parameters:
newDiscardlevel The discard level Not applied if null.
See also:
ACSLogRetrieval

void com::cosylab::logging::engine::ACS::LCEngine::setFilters FiltersVector  newFilters,
boolean  append
[inline]
 

Set the filters to apply before sending the log entries to the listener. By setting a null or empty filters disable the filtering.

Parameters:
newFilters The new filters to apply If null or empty the filtering is disabled
append If true the new filters are added to the existing filters (if any).

Implements com::cosylab::logging::engine::Filterable.

void com::cosylab::logging::engine::ACS::LCEngine::setMaxInputRate int  rate  )  [inline]
 

Set the max number of logs per second to accept from the RemoteAccess, typically the logging NC.

All the logs arriving after the max number has been reached will be discarded, regardless of their level.

See ACSLogRetrieval for further details.

Parameters:
rate The max number of logs per second to accept

void com::cosylab::logging::engine::ACS::LCEngine::setMaxOutputRate int  rate  )  [inline]
 

Set the max number of logs to publish to listeners.

When this number has been reached, no more logs are sent to the listeners.

See ACSLogRetrieval for further details.

Parameters:
rate The max number of logs per second to accept

void com::cosylab::logging::engine::ACS::LCEngine::setPaused boolean  pause  )  [inline]
 

Pause/unpause the publishing of logs to the listener The difference between pause and suspended is that when the engine is suspended all the received logs are discarded. When it is paused, the received logs are cached and published when the engine will be unpaused.

Parameters:
pause 

void com::cosylab::logging::engine::ACS::LCEngine::setSupended boolean  suspended  )  [inline]
 

Suspend resume the notification of logs NOTE: When suspended the log discarded are lost forever

Parameters:
suspended If true suspend the notification of the logs

int com::cosylab::logging::engine::ACS::LCEngine::waitingLogsNumber  )  [inline]
 

Return the number of logs waiting in the cache i.e. the logs received from the RemoteAcess and not yet sent to the listeners.

Returns:
the number of logs waiting in the cache


Member Data Documentation

String com::cosylab::logging::engine::ACS::LCEngine::accessType = "ACS" [private]
 

accessType, orb and manager are used to connect to the logging channel

See also:
AccessSetter.run

EngineAudienceHelper com::cosylab::logging::engine::ACS::LCEngine::audience = EngineAudienceHelper.NO_AUDIENCE [private]
 

The audience used to filter out messages

See also:
setAudience()

boolean com::cosylab::logging::engine::ACS::LCEngine::autoReconnect = false [private]
 

If true the engine tries to reconnect automatically

final int com::cosylab::logging::engine::ACS::LCEngine::CHECK_INTERVAL = 15 [private]
 

The connection is checked every CHECK_INTERVAL seconds

AccessChecker com::cosylab::logging::engine::ACS::LCEngine::connCheckerThread = null [private]
 

FiltersVector com::cosylab::logging::engine::ACS::LCEngine::filters = null [private]
 

The filters to apply to the incoming logs.

The filters are applied by ACSLogReceiver.run()

ACSListenersDispatcher com::cosylab::logging::engine::ACS::LCEngine::listenersDispatcher = new ACSListenersDispatcher() [private]
 

ACSLogRetrieval com::cosylab::logging::engine::ACS::LCEngine::logRetrieval = null [private]
 

Manager com::cosylab::logging::engine::ACS::LCEngine::manager = null [private]
 

ORB com::cosylab::logging::engine::ACS::LCEngine::orb = null [private]
 

RemoteAccess com::cosylab::logging::engine::ACS::LCEngine::remoteAccess = null [private]
 

boolean com::cosylab::logging::engine::ACS::LCEngine::terminateThread = false [private]
 

boolean com::cosylab::logging::engine::ACS::LCEngine::wasConnected = false [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:13:10 2009 for ACS Java API by doxygen 1.3.8