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

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

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

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

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

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

See also:
ClientLogManagerStandalone(CountDownLatch)

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


Member Data Documentation

Referenced by delay().

Initial value:
 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().

Referenced by prepareRemoteLogging().


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

Generated by  doxygen 1.6.2