

Public Member Functions | |
| void | initialize (ContainerServices containerServices) |
| void | execute () throws ComponentLifecycleException |
| void | cleanUp () |
| void | aboutToAbort () |
| ComponentStates | componentState () |
| String | name () |
| int | sendBlocks (int initVal, int lastVal, int changeVal, float period) throws CouldntPerformActionEx |
Static Public Attributes | |
| static final String | PROP_ASSERTION_MESSAGE = "CounterSupplierAssert" |
Package Attributes | |
| int | eventCount = 0 |
| volatile boolean | flag = false |
Private Attributes | |
| ContainerServices | m_containerServices |
| Logger | m_logger |
| SimpleSupplier | m_supplier = null |
CounterSupplier is a simple class that creates the "counter" notification channel, generates events, and then disconnects from the channel.
| void alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::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::CounterSupplierImpl::CounterSupplierImpl::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 alma::acs::nc::SimpleSupplier::disconnect(), m_logger, and m_supplier.
Referenced by aboutToAbort().
| ComponentStates alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::componentState | ( | ) | [inline] |
Implements alma::ACS::ACSComponentOperations.
References alma::acs::container::ContainerServices::getComponentStateManager(), and m_containerServices.
| void alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::execute | ( | ) | throws ComponentLifecycleException [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::CounterSupplierImpl::CounterSupplierImpl::initialize | ( | ContainerServices | containerServices | ) | [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::nc::SimpleSupplier::disconnect(), alma::acs::container::ContainerServicesBase::getLogger(), m_containerServices, m_logger, and m_supplier.
| String alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::name | ( | ) | [inline] |
Implements alma::ACS::ACSComponentOperations.
References alma::acs::container::ContainerServicesBase::getName(), and m_containerServices.
| int alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::sendBlocks | ( | int | initVal, | |
| int | lastVal, | |||
| int | changeVal, | |||
| float | period | |||
| ) | throws CouldntPerformActionEx [inline] |
| CouldntPerformActionEx |
Implements alma::COUNTER::CounterSupplierOperations.
References alma::acs::nc::SimpleSupplier::disconnect(), eventCount, flag, m_logger, m_supplier, PROP_ASSERTION_MESSAGE, alma::acs::nc::SimpleSupplier::publishEvent(), alma::acs::exceptions::AcsJException::setProperty(), and alma::ACSErrTypeCommon::wrappers::AcsJCouldntPerformActionEx::toCouldntPerformActionEx().
int alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::eventCount = 0 [package] |
Total number of events that have been consumed.
Referenced by sendBlocks().
volatile boolean alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::flag = false [package] |
Referenced by sendBlocks().
ContainerServices alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::m_containerServices [private] |
Referenced by componentState(), initialize(), and name().
Logger alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::m_logger [private] |
Referenced by cleanUp(), execute(), initialize(), and sendBlocks().
Referenced by cleanUp(), initialize(), and sendBlocks().
final String alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::PROP_ASSERTION_MESSAGE = "CounterSupplierAssert" [static] |
Referenced by sendBlocks().
1.6.2