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.

Classes

class  AccessChecker
class  AccessSetter

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 (Audience newAudience)
void addFilter (Filter filter)
void clearFilters ()
FiltersVector getFilters ()
LogTypeHelper getActualDiscardLevel ()
LogTypeHelper getDiscardLevel ()
Audience 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
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

References listenersDispatcher, and logRetrieval.

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

LCEngine constructor.

Parameters:
autoReconn If true the engine automatically reconnects

References autoReconnect.

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.

References setFilters().


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

References com::cosylab::logging::engine::FiltersVector::addFilter(), filters, logRetrieval, and com::cosylab::logging::engine::LogMatcher::setFilters().

Referenced by alma::acs::jlog::test::EngineFilteringTest::testAddFilter(), and alma::acs::jlog::test::EngineFilteringTest::testFiltering().

void com::cosylab::logging::engine::ACS::LCEngine::addLogConnectionListener ( ACSLogConnectionListener  listener  )  [inline]
void com::cosylab::logging::engine::ACS::LCEngine::addLogErrorListener ( ACSRemoteErrorListener  listener  )  [inline]
void com::cosylab::logging::engine::ACS::LCEngine::addLogListener ( ACSRemoteLogListener  listener  )  [inline]
void com::cosylab::logging::engine::ACS::LCEngine::addRawLogListener ( ACSRemoteRawLogListener  listener  )  [inline]
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.

References filters, logRetrieval, and com::cosylab::logging::engine::LogMatcher::setFilters().

Referenced by alma::acs::jlog::test::EngineFilteringTest::testAddFilter().

synchronized void com::cosylab::logging::engine::ACS::LCEngine::close ( boolean  sync  )  [inline]
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

References connect(), and setConnectionParams().

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

References connect(), and setAccessType().

void com::cosylab::logging::engine::ACS::LCEngine::connect (  )  [inline]
synchronized void com::cosylab::logging::engine::ACS::LCEngine::disconnect (  )  [inline]
void com::cosylab::logging::engine::ACS::LCEngine::disconnectRA (  )  [inline, private]
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

References autoReconnect.

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

References com::cosylab::logging::engine::ACS::ACSLogRetrieval::enableDynamicDiscarding(), and logRetrieval.

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().

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

References accessType.

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()

References com::cosylab::logging::engine::LogMatcher::getActualDiscardLevel(), and logRetrieval.

int com::cosylab::logging::engine::ACS::LCEngine::getActualInputRate (  )  [inline]
int com::cosylab::logging::engine::ACS::LCEngine::getActualOutputRate (  )  [inline]
Audience com::cosylab::logging::engine::ACS::LCEngine::getAudience (  )  [inline]
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()

References com::cosylab::logging::engine::ACS::ACSLogRetrieval::getDiscardLevel(), and logRetrieval.

Referenced by alma::acs::logging::io::IOLogsHelper::LoadLogs::run().

FiltersVector com::cosylab::logging::engine::ACS::LCEngine::getFilters (  )  [inline]
String com::cosylab::logging::engine::ACS::LCEngine::getFiltersString (  )  [inline]
int com::cosylab::logging::engine::ACS::LCEngine::getMaxInputRate (  )  [inline]
int com::cosylab::logging::engine::ACS::LCEngine::getMaxOutputRate (  )  [inline]
boolean com::cosylab::logging::engine::ACS::LCEngine::isConnected (  )  [inline]
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()

References filters, and com::cosylab::logging::engine::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

References accessType.

Referenced by connect(), alma::acs::logging::engine::LogReceiver::initialize(), and com::cosylab::logging::LoggingClientText::initialize().

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

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

Parameters:
newAudience The not nullaudience

References logRetrieval, and com::cosylab::logging::engine::LogMatcher::setAudience().

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().

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

References manager, and orb.

Referenced by com::cosylab::logging::LoggingClient::connect(), and connect().

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

References logRetrieval, and com::cosylab::logging::engine::ACS::ACSLogRetrieval::setDiscardLevel().

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), and com::cosylab::logging::LoggingClient::getEngine().

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.

References com::cosylab::logging::engine::FiltersVector::addFilter(), com::cosylab::logging::engine::FiltersVector::clear(), filters, com::cosylab::logging::engine::FiltersVector::isActive(), logRetrieval, and com::cosylab::logging::engine::LogMatcher::setFilters().

Referenced by LCEngine(), com::cosylab::logging::LoggingClient::showEngineFiltersDialog(), and alma::acs::jlog::test::EngineFilteringTest::testAddFiltersVector().

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

References logRetrieval, and com::cosylab::logging::engine::ACS::ACSLogRetrieval::setMaxInputRate().

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().

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

References logRetrieval, and com::cosylab::logging::engine::ACS::ACSLogRetrieval::setMaxOutputRate().

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed().

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 

References logRetrieval, and com::cosylab::logging::engine::ACS::ACSLogRetrieval::pause().

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), com::cosylab::logging::LoggingClient::pause(), and com::cosylab::logging::LoggingClient::resume().

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

References remoteAccess.

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), and com::cosylab::logging::LoggingClient::connect().

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

References logRetrieval, and com::cosylab::logging::engine::ACS::ACSLogRetrieval::size().


Member Data Documentation

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

See also:
AccessSetter.run

Referenced by disconnectRA(), getAccessType(), com::cosylab::logging::engine::ACS::LCEngine::AccessSetter::run(), and setAccessType().

If true the engine tries to reconnect automatically

Referenced by enableAutoReconnection(), LCEngine(), and com::cosylab::logging::engine::ACS::LCEngine::AccessChecker::run().

The connection is checked every CHECK_INTERVAL seconds

Referenced by com::cosylab::logging::engine::ACS::LCEngine::AccessChecker::run().

Referenced by connect(), and disconnect().

The filters to apply to the incoming logs.

The filters are applied by ACSLogReceiver.run()

Referenced by addFilter(), clearFilters(), getFilters(), getFiltersString(), isFiltered(), and setFilters().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2