alma::acs::container::BlockingComponentListener Class Reference

Inheritance diagram for alma::acs::container::BlockingComponentListener:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::container::BlockingComponentListener:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BlockingComponentListener (Logger logger)
boolean includeForeignComponents ()
synchronized void componentsAvailable (List< ComponentDescriptor > comps)
synchronized void componentsUnavailable (List< String > compNames)
synchronized void clearAndExpect (int nCalls)
boolean awaitNotifications (long timeout, TimeUnit unit) throws InterruptedException

Package Functions

List< ComponentDescriptorgetAllCompsAvailable ()
List< String > getAllCompNamesUnavailable ()

Private Attributes

final Logger logger
final List< ComponentDescriptorallCompsAvailable
final List< String > allCompNamesUnavailable
volatile CountDownLatch sync

Detailed Description

Test helper class that allows to wait until notification about unexpected component (un)availability has been received.

Author:
hsommer

Constructor & Destructor Documentation

alma::acs::container::BlockingComponentListener::BlockingComponentListener ( Logger  logger  )  [inline]

Member Function Documentation

boolean alma::acs::container::BlockingComponentListener::awaitNotifications ( long  timeout,
TimeUnit  unit 
) throws InterruptedException [inline]

Waits until nCalls notifications have been received since the call to clearAndExpect(nCalls).

Returns:
true if the calls were received before the timeout (see CountDownLatch#await(long, TimeUnit).

References sync.

Referenced by alma::acs::container::ComponentTestclient::testComponentListening().

synchronized void alma::acs::container::BlockingComponentListener::clearAndExpect ( int  nCalls  )  [inline]
synchronized void alma::acs::container::BlockingComponentListener::componentsAvailable ( List< ComponentDescriptor comps  )  [inline]

Called when components become available

Implements alma::acs::container::ContainerServices::ComponentListener.

References allCompsAvailable, logger, and sync.

synchronized void alma::acs::container::BlockingComponentListener::componentsUnavailable ( List< String >  compNames  )  [inline]

Called when components become unavailable

Implements alma::acs::container::ContainerServices::ComponentListener.

References allCompNamesUnavailable, logger, and sync.

List<String> alma::acs::container::BlockingComponentListener::getAllCompNamesUnavailable (  )  [inline, package]
List<ComponentDescriptor> alma::acs::container::BlockingComponentListener::getAllCompsAvailable (  )  [inline, package]
boolean alma::acs::container::BlockingComponentListener::includeForeignComponents (  )  [inline]

Called to find out whether a filter should be applied such that only notifications arrive for components to which the caller holds a reference.

Implements alma::acs::container::ContainerServices::ComponentListener.


Member Data Documentation

volatile CountDownLatch alma::acs::container::BlockingComponentListener::sync [private]

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

Generated by  doxygen 1.6.2