

Public Member Functions | |
| void | initialize (ContainerServices containerServices) throws ComponentLifecycleException |
| void | execute () |
| void | cleanUp () |
| void | aboutToAbort () |
| void | receive (statusBlockEvent someParam) |
| ComponentStates | componentState () |
| String | name () |
| void | getBlocks () throws CouldntPerformActionEx |
| int | waitTillDone () throws CouldntPerformActionEx |
Static Public Attributes | |
| static final String | PROP_ASSERTION_MESSAGE = "CounterConsumerAssert" |
Package Attributes | |
| int | eventCount = 0 |
| volatile boolean | contFlag = true |
Private Attributes | |
| ContainerServices | m_containerServices |
| Logger | m_logger |
| Consumer | m_consumer = null |
CounterConsumer is a simple class that connects to the "counter" notification channel, receives events, and then disconnects from the channel.
| void alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::aboutToAbort | ( | ) | [inline] |
Called when due to some error condition the component is about to be forcefully removed some unknown amount of time later (usually not very much...).
The component should make an effort to die as neatly as possible.
Because of its urgency, this method will be called asynchronously to the execution of any other method of the component.
Implements alma::acs::component::ComponentLifecycle.
References cleanUp().
| void alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::cleanUp | ( | ) | [inline] |
Called after the last functional call to the component has finished. The component should then orderly release resources etc.
Implements alma::acs::component::ComponentLifecycle.
References contFlag, alma::acs::nc::Consumer::disconnect(), m_consumer, and m_logger.
Referenced by aboutToAbort().
| ComponentStates alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::componentState | ( | ) | [inline] |
Implements alma::ACS::ACSComponentOperations.
References alma::acs::container::ContainerServices::getComponentStateManager(), and m_containerServices.
| void alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::execute | ( | ) | [inline] |
Called after ComponentLifecycle#initialize(ContainerServices) to tell the component that it has to be ready to accept incoming functional calls any time.
Examples:
initialize seemed too early Must be implemented as a synchronous (blocking) call (can spawn threads though).
Implements alma::acs::component::ComponentLifecycle.
References m_logger.
| void alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::getBlocks | ( | ) | throws CouldntPerformActionEx [inline] |
| CouldntPerformActionEx |
Implements alma::COUNTER::CounterConsumerOperations.
References alma::acs::nc::Consumer::addSubscription(), alma::acs::nc::Consumer::consumerReady(), alma::acs::nc::Consumer::disconnect(), m_consumer, m_containerServices, m_logger, PROP_ASSERTION_MESSAGE, alma::acs::exceptions::AcsJException::setProperty(), and alma::ACSErrTypeCommon::wrappers::AcsJCouldntPerformActionEx::toCouldntPerformActionEx().
| void alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::initialize | ( | ContainerServices | containerServices | ) | throws ComponentLifecycleException [inline] |
Called to give the component time to initialize itself. For instance, the component could retrieve connections, read in configuration files/parameters, build up in-memory tables, ...
Called before execute(). In fact, this method might be called quite some time before functional requests can be sent to the component.
Must be implemented as a synchronous (blocking) call.
| containerServices | callback object for services provided by the container |
Implements alma::acs::component::ComponentLifecycle.
References alma::acs::container::ContainerServicesBase::getLogger(), m_containerServices, and m_logger.
| String alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::name | ( | ) | [inline] |
Implements alma::ACS::ACSComponentOperations.
References alma::acs::container::ContainerServicesBase::getName(), and m_containerServices.
| void alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::receive | ( | statusBlockEvent | someParam | ) | [inline] |
receive must be overriden in Consumer subclasses to do something useful.
References contFlag, alma::COUNTER::statusBlockEvent::counter1, alma::COUNTER::statusBlockEvent::counter2, alma::COUNTER::statusBlockEvent::counter3, alma::acs::nc::Consumer::disconnect(), eventCount, alma::COUNTER::statusBlockEvent::flipFlop, m_consumer, m_logger, alma::COUNTER::statusBlockEvent::myString, alma::COUNTER::OnOffStates::ON, alma::COUNTER::statusBlockEvent::onOff, and alma::COUNTER::statusBlockEvent::period.
| int alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::waitTillDone | ( | ) | throws CouldntPerformActionEx [inline] |
| CouldntPerformActionEx |
Implements alma::COUNTER::CounterConsumerOperations.
References contFlag, eventCount, m_consumer, m_logger, PROP_ASSERTION_MESSAGE, alma::acs::exceptions::AcsJException::setProperty(), and alma::ACSErrTypeCommon::wrappers::AcsJCouldntPerformActionEx::toCouldntPerformActionEx().
volatile boolean alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::contFlag = true [package] |
Referenced by cleanUp(), receive(), and waitTillDone().
int alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::eventCount = 0 [package] |
Total number of events that have been consumed.
Referenced by receive(), and waitTillDone().
Referenced by cleanUp(), getBlocks(), receive(), and waitTillDone().
ContainerServices alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::m_containerServices [private] |
Referenced by componentState(), getBlocks(), initialize(), and name().
Logger alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::m_logger [private] |
Referenced by cleanUp(), execute(), getBlocks(), initialize(), receive(), and waitTillDone().
final String alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::PROP_ASSERTION_MESSAGE = "CounterConsumerAssert" [static] |
Referenced by getBlocks(), and waitTillDone().
1.6.2