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

alma::acs::logging::RemoteLogDispatcher Class Reference

Inheritance diagram for alma::acs::logging::RemoteLogDispatcher:

Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::RemoteLogDispatcher:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int getBufferSize ()
void setBufferSize (int newBuffSize)

Protected Member Functions

void writeRecords (Any[] anyLogRecordsArray) throws UserException

Protected Attributes

boolean DEBUG = false

Package Functions

 RemoteLogDispatcher (ORB orb, LogOperations logService, AcsLogFormatter logFormatter)
FailedLogRecords sendLogRecords (LogRecord[] logRecords)

Private Attributes

int bufferSize = 30
ORB orb
LogOperations logService
AcsLogFormatter logFormatter
LogRecordComparator timestampLogRecordComparator

Detailed Description

Sends log records to the remote CORBA log service. No caching or threading is done, so this class should be used at the delivering end of a smarter queue.

Author:
hsommer created Apr 19, 2005 4:15:19 PM


Constructor & Destructor Documentation

alma::acs::logging::RemoteLogDispatcher::RemoteLogDispatcher ORB  orb,
LogOperations  logService,
AcsLogFormatter  logFormatter
[inline, package]
 

Parameters:
orb used for creation of Anys
logService remote log service to which logs are sent. Since the reference is persistent across failures and restarts, we can keep working with this object the whole time. May be null for unit tests, in which case sendLogRecords(LogRecord[]) will fail and return the all log records inside the FailedLogRecords structure. With ACS 7.0.1 we allow the super type LogOperations instead of the usually expected Log, to allow unit tests with a mock Log service.
logFormatter used to format LogRecords to Any representation. No direct assumption on XML is made, so technically any valid Any returned by the formatter will do (as far as this class is concerned).


Member Function Documentation

int alma::acs::logging::RemoteLogDispatcher::getBufferSize  )  [inline]
 

FailedLogRecords alma::acs::logging::RemoteLogDispatcher::sendLogRecords LogRecord[]  logRecords  )  [inline, package]
 

Attempts to send logRecords over to the remote logging service. To not lose any log records in case of failure, they can be obtained from the returned FailedLogRecords object, and should be fed back to the log record queue in order to try again later.

Should not be called concurrently (which can't happen since we use a single threaded executor in DispatchingLogQueue).

Sorts all log records by timestamp before converting them for remote transmission.

Parameters:
logRecords 
Returns:
those LogRecords that failed to be sent, either because they could not be converted to Any, or because the remote logger failed.

void alma::acs::logging::RemoteLogDispatcher::setBufferSize int  newBuffSize  )  [inline]
 

Sets the size of the log record buffer, which determines the maximum number of log records that can be sent to the remote log service in one call.

Corresponds to cacheSize in the CDB.

Parameters:
newBuffSize value >=1, otherwise ignored

void alma::acs::logging::RemoteLogDispatcher::writeRecords Any[]  anyLogRecordsArray  )  throws UserException [inline, protected]
 

The CORBA call to Log#write_records(Any[]). May be faked by test subclasses.

Parameters:
anyLogRecordsArray 
Exceptions:
UserException 

Reimplemented in alma::acs::logging::TestLogDispatcher.


Member Data Documentation

int alma::acs::logging::RemoteLogDispatcher::bufferSize = 30 [private]
 

Maximum number of CORBA Anys (with 1 log record each) sent to remote log service at a time. This buffer is what the CDB documentation refers to as "cache" (e.g. attribute cacheSize). We call it 'buffer' because our 'cache' is the queue that feeds this dispatcher.

boolean alma::acs::logging::RemoteLogDispatcher::DEBUG = false [protected]
 

AcsLogFormatter alma::acs::logging::RemoteLogDispatcher::logFormatter [private]
 

LogOperations alma::acs::logging::RemoteLogDispatcher::logService [private]
 

ORB alma::acs::logging::RemoteLogDispatcher::orb [private]
 

LogRecordComparator alma::acs::logging::RemoteLogDispatcher::timestampLogRecordComparator [private]
 


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