

Protected Member Functions | |
| AcsLogServiceOperations | 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 AcsLogServiceOperations | logServiceMock |
Modified ClientLogManager which skips the manager call and uses a mock Log service. Remote communication delays are simulated, see setDelayMillis(long).
| alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::ClientLogManagerStandalone | ( | CountDownLatch | syncOnPrepareRemoteLogging | ) | [inline, package] |
Constructor.
| 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. |
| void alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::delay | ( | ) | [inline, package] |
Sleeps for the time given in setDelayMillis(long)}.
References delayMillis.
Referenced by getLogService().
| AcsLogServiceOperations 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()}.
Reimplemented from alma::acs::logging::ClientLogManager.
References delay(), and logServiceMock.
| void alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::prepareRemoteLogging | ( | ) | [inline, protected] |
Overloaded only to allow clients to sync with execution of initRemoteLogging(ORB, Manager, int, boolean).
Reimplemented from alma::acs::logging::ClientLogManager.
References syncOnPrepareRemoteLogging.
| 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.
Referenced by alma::acs::logging::RemoteLoggingTest::testConcurrentRemoteInitAndStop().
volatile long alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::delayMillis = 100 [private] |
Referenced by delay().
final AcsLogServiceOperations alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::logServiceMock [private] |
new LogEmptyImpl() { public void write_records(Any[] records) { for (Any any : records) { System.out.println("Remote log: " + any.extract_string()); } delay(); } @Override public void writeRecords(XmlLogRecord[] xmlLogRecords) { for (XmlLogRecord record : xmlLogRecords) { System.out.println("Remote log: " + record.xml); } 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().
Referenced by getLogService().
final CountDownLatch alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::syncOnPrepareRemoteLogging [private] |
Referenced by prepareRemoteLogging().
1.6.2