Classes | Public Member Functions

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

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

List of all members.

Classes

class  AccessChecker
class  AccessSetter

Public Member Functions

 LCEngine ()
 LCEngine (boolean autoReconn)
 LCEngine (boolean autoReconn, FiltersVector filters)
 LCEngine (ILogQueueFileHandler cacheFileHandler)
 LCEngine (boolean autoReconn, ILogQueueFileHandler cacheFileHandler)
 LCEngine (boolean autoReconn, FiltersVector filters, ILogQueueFileHandler cacheFileHandler)
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)

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

LCEngine constructor

com.cosylab.logging.engine.ACS.LCEngine.LCEngine ( boolean  autoReconn  ) 

LCEngine constructor.

Parameters:
autoReconn If true the engine automatically reconnects
com.cosylab.logging.engine.ACS.LCEngine.LCEngine ( boolean  autoReconn,
FiltersVector  filters 
)

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 com.cosylab.logging.engine.ACS.LCEngine.setFilters().

com.cosylab.logging.engine.ACS.LCEngine.LCEngine ( ILogQueueFileHandler  cacheFileHandler  ) 

Build the LCEngine by setting an handler for the files of the cache.

Parameters:
cacheFileHandler The handler of the files of the cache
See also:
ILogQueueFileHandler
com.cosylab.logging.engine.ACS.LCEngine.LCEngine ( boolean  autoReconn,
ILogQueueFileHandler  cacheFileHandler 
)

LCEngine constructor.

Parameters:
autoReconn If true the engine automatically reconnects
cacheFileHandler The handler of the files of the cache
See also:
ILogQueueFileHandler
com.cosylab.logging.engine.ACS.LCEngine.LCEngine ( boolean  autoReconn,
FiltersVector  filters,
ILogQueueFileHandler  cacheFileHandler 
)

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 also be null or empty.
cacheFileHandler The handler of the files of the cache
See also:
ILogQueueFileHandler

References com.cosylab.logging.engine.ACS.LCEngine.setFilters().


Member Function Documentation

void com.cosylab.logging.engine.ACS.LCEngine.addFilter ( Filter  filter  ) 

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(), and com.cosylab.logging.engine.LogMatcher.setFilters().

void com.cosylab.logging.engine.ACS.LCEngine.addLogConnectionListener ( ACSLogConnectionListener  listener  ) 
void com.cosylab.logging.engine.ACS.LCEngine.addLogErrorListener ( ACSRemoteErrorListener  listener  ) 
void com.cosylab.logging.engine.ACS.LCEngine.addLogListener ( ACSRemoteLogListener  listener  ) 
void com.cosylab.logging.engine.ACS.LCEngine.addRawLogListener ( ACSRemoteRawLogListener  listener  ) 
void com.cosylab.logging.engine.ACS.LCEngine.clearFilters (  ) 

Remove all the filters.

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

References com.cosylab.logging.engine.LogMatcher.setFilters().

synchronized void com.cosylab.logging.engine.ACS.LCEngine.close ( boolean  sync  ) 
void com.cosylab.logging.engine.ACS.LCEngine.connect (  ) 
void com.cosylab.logging.engine.ACS.LCEngine.connect ( String  newAccessType  ) 

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 com.cosylab.logging.engine.ACS.LCEngine.connect(), and com.cosylab.logging.engine.ACS.LCEngine.setAccessType().

void com.cosylab.logging.engine.ACS.LCEngine.connect ( ORB  theORB,
Manager  mgr 
)

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 com.cosylab.logging.engine.ACS.LCEngine.connect(), and com.cosylab.logging.engine.ACS.LCEngine.setConnectionParams().

synchronized void com.cosylab.logging.engine.ACS.LCEngine.disconnect (  ) 

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

See also:
LCEngine$AccessSetter

Referenced by com.cosylab.logging.engine.ACS.LCEngine.close(), and com.cosylab.logging.LoggingClient.connLCEngDisconnect().

void com.cosylab.logging.engine.ACS.LCEngine.enableAutoReconnection ( boolean  autoRec  ) 

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 
)

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

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

java.lang.String com.cosylab.logging.engine.ACS.LCEngine.getAccessType (  ) 

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

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

int com.cosylab.logging.engine.ACS.LCEngine.getActualInputRate (  ) 
Returns:
The actual input rate

See ACSLogRetrieval for further details.

References com.cosylab.logging.engine.ACS.ACSLogRetrieval.getInputRate().

int com.cosylab.logging.engine.ACS.LCEngine.getActualOutputRate (  ) 
Returns:
The actual input rate

See ACSLogRetrieval for further details.

References com.cosylab.logging.engine.ACS.ACSLogRetrieval.getOutputRate().

Audience com.cosylab.logging.engine.ACS.LCEngine.getAudience (  ) 
Returns:
The discard level (can be null)

References com.cosylab.logging.engine.LogMatcher.getAudience().

LogTypeHelper com.cosylab.logging.engine.ACS.LCEngine.getDiscardLevel (  ) 

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

FiltersVector com.cosylab.logging.engine.ACS.LCEngine.getFilters (  ) 

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 (  ) 
Returns:
A description of the active filters
See also:
FiltersVector.getFilterString()

References com.cosylab.logging.engine.FiltersVector.getFilterString().

int com.cosylab.logging.engine.ACS.LCEngine.getMaxInputRate (  ) 
Returns:
The actual max input rate

See ACSLogRetrieval for further details.

References com.cosylab.logging.engine.ACS.ACSLogRetrieval.getMaxInputRate().

int com.cosylab.logging.engine.ACS.LCEngine.getMaxOutputRate (  ) 
Returns:
The actual max input rate

See ACSLogRetrieval for further details.

References com.cosylab.logging.engine.ACS.ACSLogRetrieval.getMaxOutputRate().

boolean com.cosylab.logging.engine.ACS.LCEngine.isConnected (  ) 
Returns:
ture if the engine is connected to the notification channel

References com.cosylab.logging.engine.RemoteAccess.isConnected().

Referenced by alma.acs.logging.engine.LogReceiver.isInitialized().

boolean com.cosylab.logging.engine.ACS.LCEngine.isFiltered (  ) 

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 com.cosylab.logging.engine.FiltersVector.hasActiveFilters().

void com.cosylab.logging.engine.ACS.LCEngine.setAccessType ( String  newAccessType  ) 

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

Parameters:
newAccessType java.lang.String

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

void com.cosylab.logging.engine.ACS.LCEngine.setAudience ( Audience  newAudience  ) 

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

Parameters:
newAudience The not nullaudience

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

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

Referenced by com.cosylab.logging.LoggingClient.connect(), and com.cosylab.logging.engine.ACS.LCEngine.connect().

void com.cosylab.logging.engine.ACS.LCEngine.setDiscardLevel ( LogTypeHelper  newDiscardLevel  ) 

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

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(), com.cosylab.logging.engine.FiltersVector.isActive(), and com.cosylab.logging.engine.LogMatcher.setFilters().

Referenced by com.cosylab.logging.engine.ACS.LCEngine.LCEngine().

void com.cosylab.logging.engine.ACS.LCEngine.setMaxInputRate ( int  rate  ) 

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

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

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 com.cosylab.logging.engine.ACS.ACSLogRetrieval.pause().

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

void com.cosylab.logging.engine.ACS.LCEngine.setSupended ( boolean  suspended  ) 

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

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

int com.cosylab.logging.engine.ACS.LCEngine.waitingLogsNumber (  ) 

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 com.cosylab.logging.engine.ACS.ACSLogRetrieval.size().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties