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

alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone Class Reference

Inheritance diagram for alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone:

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

Collaboration graph
[legend]
List of all members.

Protected Member Functions

LogOperations getLogService (Manager manager, int managerHandle)
void prepareRemoteLogging ()

Package Functions

 ClientLogManagerStandalone (CountDownLatch syncOnPrepareRemoteLogging)
void setDelayMillis (long delayMillis)
void delay ()

Private Attributes

final CountDownLatch syncOnPrepareRemoteLogging
volatile long delayMillis = 100
final LogOperations logServiceMock

Detailed Description

Modified ClientLogManager which skips the manager call and uses a mock Log service. Remote communication delays are simulated, see setDelayMillis(long).


Constructor & Destructor Documentation

alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::ClientLogManagerStandalone CountDownLatch  syncOnPrepareRemoteLogging  )  [inline, package]
 

Constructor.

Parameters:
syncOnPrepareRemoteLogging Optional synchronization aid (may be null). Method prepareRemoteLogging()} will call countDown() to allow a test to wait until initRemoteLogging(ORB, Manager, int, boolean)} is actually running in cases where it gets started from a separate thread. Note that the parent constructor will not call countDown() even though it calls prepareRemoteLogging, because we only set the CountDownLatch after calling the parent ctor. Thus passing a CountDownLatch(1) will work.


Member Function Documentation

void alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::delay  )  [inline, package]
 

Sleeps for the time given in setDelayMillis(long)}.

LogOperations alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::getLogService Manager  manager,
int  managerHandle
[inline, protected]
 

This is called by ClientLogManager::initRemoteLogging(ORB, Manager, int, boolean)} and simulates the access to the Log service by sleeping via delay()}.

See also:
alma.acs.logging.ClientLogManager::getLogService(si.ijs.maci.Manager, int)

Reimplemented from alma::acs::logging::ClientLogManager.

void alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::prepareRemoteLogging  )  [inline, protected]
 

Overloaded only to allow clients to sync with execution of initRemoteLogging(ORB, Manager, int, boolean).

See also:
ClientLogManagerStandalone(CountDownLatch)

Reimplemented from alma::acs::logging::ClientLogManager.

void alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::setDelayMillis long  delayMillis  )  [inline, package]
 

Sets the delay in milliseconds which subsequent calls to delay() will sleep for. Default is 100 ms if this method does not get called.


Member Data Documentation

volatile long alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::delayMillis = 100 [private]
 

final LogOperations alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::logServiceMock [private]
 

Initial value:

new LogEmptyImpl() { public void write_records(Any[] records) { for (Any any : records) { System.out.println("Remote log: " + any.extract_string()); } delay(); } }
Mock impl of the Log service. All methods are total no-ops, except for which prints the xml log records contained in the given Any objects to stdout, and simulates network delay by sleeping via a call to #delay().

final CountDownLatch alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::syncOnPrepareRemoteLogging [private]
 


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