

Public Member Functions | |
| ComponentHelper (Logger containerLogger) | |
Protected Member Functions | |
| final Logger | getComponentLogger () |
| final synchronized ComponentLifecycle | getComponentImpl () throws AcsJComponentCreationEx, AcsJJavaComponentHelperEx |
| abstract ComponentLifecycle | _createComponentImpl () throws AcsJComponentCreationEx |
| abstract Class<?extends Servant > | _getPOATieClass () |
| abstract Class<?extends ACSComponentOperations > | _getOperationsInterface () |
| Class<?> | getInternalInterface () throws AcsJJavaComponentHelperEx |
| Object | _getInterfaceTranslator (Object defaultInterfaceTranslator) throws AcsJJavaComponentHelperEx |
| String[] | _getComponentMethodsExcludedFromInvocationLogging () |
| boolean | requiresOrbCentralLogSuppression () |
Protected Attributes | |
| String | componentInstanceName |
Package Functions | |
| final void | setComponentInstanceName (String name) |
| final Class<?extends Servant > | getPOATieClass () throws AcsJJavaComponentHelperEx |
| final Class<?extends ACSComponentOperations > | getOperationsInterface () throws AcsJJavaComponentHelperEx |
| final Object | getInterfaceTranslator () throws AcsJJavaComponentHelperEx |
| final String[] | getComponentMethodsExcludedFromInvocationLogging () |
Private Attributes | |
| ComponentLifecycle | m_componentImpl |
| final Logger | m_containerLogger |
Base class for component helper classes that must be provided by the component developers (for example by copying the template file that gets generated with the COMPONENT_HELPERS=on Makefile setting).
The method implementations in this class perform checks on the data returned from the subclass methods (framework-style design). In that sense, ComponentHelper is part of the container, whereas its subclass belongs to the component.
The methods that return a Class object should be implemented like return XxxPOATie.class; so that the absence of this class can be discovered at compile time. (Therefore don't use classForName which evades compile time checking.)
| alma::acs::container::ComponentHelper::ComponentHelper | ( | Logger | containerLogger | ) | [inline] |
Subclasses must override and call this constructor ("<code>super(containerLogger)</code>").
| containerLogger | logger used by this base class. |
References m_containerLogger.
| abstract ComponentLifecycle alma::acs::container::ComponentHelper::_createComponentImpl | ( | ) | throws AcsJComponentCreationEx [protected, pure virtual] |
Method _createComponentImpl to be provided by subclasses. Must return the same object that also implements the functional component interface.
| AcsJComponentCreationEx | if the component implementation class could not be instantiated |
Implemented in alma::demo::DemoCallbackResponderImpl::DemoCallbackResponderHelper, alma::ACSCOURSE_MOUNT::Mount1Impl::Mount1Helper, alma::ACSCOURSE_MOUNT::Mount6Impl::Mount6Helper, alma::alarmsystemdemo::AntennaImpl::AntennaHelper, alma::alarmsystemdemo::MFImpl::MFHelper, alma::alarmsystemdemo::MountImpl::MountHelper, alma::alarmsystemdemo::PSImpl::PSHelper, alma::alarmsystem::AlarmServiceImpl::AlarmServiceHelper, alma::contLogTest::TestLogLevelsCompImpl::TestLogLevelsCompHelper, alma::COUNTER::CounterConsumerImpl::CounterConsumerHelper, alma::COUNTER::CounterSupplierImpl::CounterSupplierHelper, alma::test::corbareftest::component::HelloWorldHelper, alma::lifecycleTest::TestLifeCycleCompImpl::TestLifeCycleCompHelper, alma::ACS::jbaci::enumProp::test::EnumTestComponentImplHelper, alma::acsexmplBuilding::BuildingImplHelper, alma::PS::PowerSupplyImplHelper, alma::TT::PrimComponentImplHelper, alma::TT::SeqComponentImplHelper, test::jbaci::SimpleMasterComponentImplHelper, alma::jconttest::ContainerServicesTesterImpl::ContainerServicesTesterHelper, alma::jconttest::DataReceiverImpl::DataReceiverHelper, alma::jconttest::DummyComponent2Impl::DummyComponent2Helper, alma::jconttest::DummyComponentImpl::DummyComponentHelper, alma::jconttest::DummyComponentWrapperImpl::DummyComponentWrapperHelper, alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentHelper, alma::demo::ErrorSystemComp::ErrorSystemHelper, alma::demo::EventConsumerImpl::EventConsumerHelper, alma::demo::EventSupplierImpl::EventSupplierHelper, alma::demo::HelloDemoImpl::HelloDemoHelper, alma::demo::LampAccessImpl::LampAccessHelper, alma::demo::LampCallbackImpl::LampCallbackHelper, alma::demo::XmlComponentImpl::XmlComponentHelper, alma::demo::test::AbstractNC::NCPublisherHelper, alma::demo::test::AbstractNC::NCReceiverHelper, alma::demo::test::EventConsumerImpl::EventConsumerHelper, alma::demo::test::EventILConsumerImpl::EventConsumerHelper, alma::demo::test::EventILSupplierImpl::EventSupplierHelper, alma::demo::test::EventSupplierCDBChannel::EventSupplierCDBChannelHelper, alma::demo::test::EventSupplierImpl::EventSupplierHelper, alma::ACS::MasterComponentImpl::TestMasterComponentHelper, alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentHelper, and alma::nctest::EventSupplierSpr2005067Impl::EventSupplierSpr2005067Helper.
Referenced by getComponentImpl().
| String [] alma::acs::container::ComponentHelper::_getComponentMethodsExcludedFromInvocationLogging | ( | ) | [inline, protected] |
Tells the container to not automatically log calls to certain component interface methods. This method may be overridden by helper subclasses, since the default behavior is for the container to log all component method invocations except ACSComponentOperations::componentState().
Dealing with OffShoots: offshoots that follow the Corba Tie-approach enjoy automatic method invocation logging just like components do. In the rare event that you explicitly activate offshoots from your component, and want to suppress automatic logging for certain methods, return String(s) in the following format: OFFSHOOT::<offshootinterfacename>#<methodname>. Example for ALMA archive: "OFFSHOOT::Operational#retrieveFragment".
Note that returning Strings is fine (compared with more sophisticated Method objects) because the functional component interface methods cannot have parameter polymorphism thanks to IDL limitations. Thus there is no ambiguity in the method names.
Reimplemented in alma::demo::XmlComponentImpl::XmlComponentHelper.
Referenced by getComponentMethodsExcludedFromInvocationLogging().
| Object alma::acs::container::ComponentHelper::_getInterfaceTranslator | ( | Object | defaultInterfaceTranslator | ) | throws AcsJJavaComponentHelperEx [inline, protected] |
To be overridden by subclass only if it wants its own interface translator to be used.
The returned interface translator must implement the component's operations interface, and must take care of translating in, inout parameters, forwarding the call to the respective method in the component implementation, and then translating out, inout parameters, and the return value.
It is foreseen that the necessary translations for most methods will be done automatically by the dynamic proxy classes. Some methods may require manual translation, e.g. if an expression that involves xml entity classes is too complex for the dynamic proxy.
On the other end of the spectrum, a manual implementation may choose to <emph>not</emph> unmarshal a marshalled binding object that it receives as an in parameter, because the binding object will only be routed through to another component, so first unmarshalling and later marshalling it would be an unnecessary performance loss. In that case, the manual interface translator could call an additional method in the component implementation which expects the marshalled xml rather than the binding object.
To facilitate the implementation of a manual interface translator, the defaultInterfaceTranslator is provided; it is a dynamic proxy object that implements the component's operations interface and forwards all calls to the component implementation created in _createComponentImpl, performing type translations in between. The methods that should be handled automatically can then be directly delegated to that proxy object, and only those methods that require special care need to be implemented by hand.
| defaultInterfaceTranslator | the default translator that the custon translator may use to delegate some or all method invocations to. |
Reimplemented in alma::demo::XmlComponentImpl::XmlComponentHelper.
Referenced by getInterfaceTranslator().
| abstract Class<? extends ACSComponentOperations> alma::acs::container::ComponentHelper::_getOperationsInterface | ( | ) | [protected, pure virtual] |
Gets the xxOperations interface as generated by the IDL compiler.
This method must be provided by the component helper class.
Class object associated with the operations interface. Implemented in alma::demo::DemoCallbackResponderImpl::DemoCallbackResponderHelper, alma::ACSCOURSE_MOUNT::Mount1Impl::Mount1Helper, alma::ACSCOURSE_MOUNT::Mount6Impl::Mount6Helper, alma::alarmsystemdemo::AntennaImpl::AntennaHelper, alma::alarmsystemdemo::MFImpl::MFHelper, alma::alarmsystemdemo::MountImpl::MountHelper, alma::alarmsystemdemo::PSImpl::PSHelper, alma::alarmsystem::AlarmServiceImpl::AlarmServiceHelper, alma::contLogTest::TestLogLevelsCompImpl::TestLogLevelsCompHelper, alma::COUNTER::CounterConsumerImpl::CounterConsumerHelper, alma::COUNTER::CounterSupplierImpl::CounterSupplierHelper, alma::test::corbareftest::component::HelloWorldHelper, alma::lifecycleTest::TestLifeCycleCompImpl::TestLifeCycleCompHelper, alma::ACS::jbaci::enumProp::test::EnumTestComponentImplHelper, alma::acsexmplBuilding::BuildingImplHelper, alma::PS::PowerSupplyImplHelper, alma::TT::PrimComponentImplHelper, alma::TT::SeqComponentImplHelper, test::jbaci::SimpleMasterComponentImplHelper, alma::jconttest::ContainerServicesTesterImpl::ContainerServicesTesterHelper, alma::jconttest::DataReceiverImpl::DataReceiverHelper, alma::jconttest::DummyComponent2Impl::DummyComponent2Helper, alma::jconttest::DummyComponentImpl::DummyComponentHelper, alma::jconttest::DummyComponentWrapperImpl::DummyComponentWrapperHelper, alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentHelper, alma::demo::ErrorSystemComp::ErrorSystemHelper, alma::demo::EventConsumerImpl::EventConsumerHelper, alma::demo::EventSupplierImpl::EventSupplierHelper, alma::demo::HelloDemoImpl::HelloDemoHelper, alma::demo::LampAccessImpl::LampAccessHelper, alma::demo::LampCallbackImpl::LampCallbackHelper, alma::demo::XmlComponentImpl::XmlComponentHelper, alma::demo::test::AbstractNC::NCPublisherHelper, alma::demo::test::AbstractNC::NCReceiverHelper, alma::demo::test::EventConsumerImpl::EventConsumerHelper, alma::demo::test::EventILConsumerImpl::EventConsumerHelper, alma::demo::test::EventILSupplierImpl::EventSupplierHelper, alma::demo::test::EventSupplierCDBChannel::EventSupplierCDBChannelHelper, alma::demo::test::EventSupplierImpl::EventSupplierHelper, alma::ACS::MasterComponentImpl::TestMasterComponentHelper, alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentHelper, and alma::nctest::EventSupplierSpr2005067Impl::EventSupplierSpr2005067Helper.
Referenced by getOperationsInterface().
| abstract Class<? extends Servant> alma::acs::container::ComponentHelper::_getPOATieClass | ( | ) | [protected, pure virtual] |
This method must be provided by the component helper class. It must return the Class of the IDL-generated POA-Tie Servant, as in
return DummyComponentPOATie.class;.
Implemented in alma::demo::DemoCallbackResponderImpl::DemoCallbackResponderHelper, alma::ACSCOURSE_MOUNT::Mount1Impl::Mount1Helper, alma::ACSCOURSE_MOUNT::Mount6Impl::Mount6Helper, alma::alarmsystemdemo::AntennaImpl::AntennaHelper, alma::alarmsystemdemo::MFImpl::MFHelper, alma::alarmsystemdemo::MountImpl::MountHelper, alma::alarmsystemdemo::PSImpl::PSHelper, alma::alarmsystem::AlarmServiceImpl::AlarmServiceHelper, alma::contLogTest::TestLogLevelsCompImpl::TestLogLevelsCompHelper, alma::COUNTER::CounterConsumerImpl::CounterConsumerHelper, alma::COUNTER::CounterSupplierImpl::CounterSupplierHelper, alma::test::corbareftest::component::HelloWorldHelper, alma::lifecycleTest::TestLifeCycleCompImpl::TestLifeCycleCompHelper, alma::ACS::jbaci::enumProp::test::EnumTestComponentImplHelper, alma::acsexmplBuilding::BuildingImplHelper, alma::PS::PowerSupplyImplHelper, alma::TT::PrimComponentImplHelper, alma::TT::SeqComponentImplHelper, test::jbaci::SimpleMasterComponentImplHelper, alma::jconttest::ContainerServicesTesterImpl::ContainerServicesTesterHelper, alma::jconttest::DataReceiverImpl::DataReceiverHelper, alma::jconttest::DummyComponent2Impl::DummyComponent2Helper, alma::jconttest::DummyComponentImpl::DummyComponentHelper, alma::jconttest::DummyComponentWrapperImpl::DummyComponentWrapperHelper, alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentHelper, alma::demo::ErrorSystemComp::ErrorSystemHelper, alma::demo::EventConsumerImpl::EventConsumerHelper, alma::demo::EventSupplierImpl::EventSupplierHelper, alma::demo::HelloDemoImpl::HelloDemoHelper, alma::demo::LampAccessImpl::LampAccessHelper, alma::demo::LampCallbackImpl::LampCallbackHelper, alma::demo::XmlComponentImpl::XmlComponentHelper, alma::demo::test::AbstractNC::NCPublisherHelper, alma::demo::test::AbstractNC::NCReceiverHelper, alma::demo::test::EventConsumerImpl::EventConsumerHelper, alma::demo::test::EventILConsumerImpl::EventConsumerHelper, alma::demo::test::EventILSupplierImpl::EventSupplierHelper, alma::demo::test::EventSupplierCDBChannel::EventSupplierCDBChannelHelper, alma::demo::test::EventSupplierImpl::EventSupplierHelper, alma::ACS::MasterComponentImpl::TestMasterComponentHelper, alma::ACS::SpecialTestMasterComponentImpl::SpecialTestMasterComponentHelper, and alma::nctest::EventSupplierSpr2005067Impl::EventSupplierSpr2005067Helper.
Referenced by getPOATieClass().
| final synchronized ComponentLifecycle alma::acs::container::ComponentHelper::getComponentImpl | ( | ) | throws AcsJComponentCreationEx, AcsJJavaComponentHelperEx [inline, protected] |
Gets the component implementation. Must be the same object that also implements the functional interface obtained from getInternalInterface.
ComponentLifecycle and the functional interface. | AcsJJavaComponentHelperEx | if the component implementation construction failed or if the component does not implement its declared functional interface. |
References _createComponentImpl(), componentInstanceName, getInternalInterface(), m_componentImpl, m_containerLogger, and alma::JavaContainerError::wrappers::AcsJJavaComponentHelperEx::setContextInfo().
Referenced by alma::demo::XmlComponentImpl::XmlComponentHelper::_getInterfaceTranslator(), and alma::acs::container::AcsContainer::activate_component().
| final Logger alma::acs::container::ComponentHelper::getComponentLogger | ( | ) | [inline, protected] |
Gets the component logger.
References componentInstanceName.
Referenced by alma::demo::XmlComponentImpl::XmlComponentHelper::_getInterfaceTranslator().
| final String [] alma::acs::container::ComponentHelper::getComponentMethodsExcludedFromInvocationLogging | ( | ) | [inline, package] |
References _getComponentMethodsExcludedFromInvocationLogging(), and m_containerLogger.
Referenced by alma::acs::container::AcsContainer::activate_component().
| final Object alma::acs::container::ComponentHelper::getInterfaceTranslator | ( | ) | throws AcsJJavaComponentHelperEx [inline, package] |
Method getInterfaceTranslator. Called by the container framework.
| AcsJJavaComponentHelperEx |
References _getInterfaceTranslator(), getInternalInterface(), getOperationsInterface(), m_componentImpl, m_containerLogger, and alma::JavaContainerError::wrappers::AcsJJavaComponentHelperEx::setContextInfo().
Referenced by alma::acs::container::AcsContainer::activate_component().
| Class<?> alma::acs::container::ComponentHelper::getInternalInterface | ( | ) | throws AcsJJavaComponentHelperEx [inline, protected] |
Gets the component's implemented functional IF. For instance, the method signatures can be the same as in the operations interface, except that the internal interface uses xml binding classes where the IDL-generated operations interface only contains stringified XML.
To be overridden by the component helper class only if the InternalInterface differs from the OperationsInterface.
Reimplemented in alma::ACSCOURSE_MOUNT::Mount6Impl::Mount6Helper, and alma::demo::XmlComponentImpl::XmlComponentHelper.
References getOperationsInterface().
Referenced by getComponentImpl(), and getInterfaceTranslator().
| final Class<? extends ACSComponentOperations> alma::acs::container::ComponentHelper::getOperationsInterface | ( | ) | throws AcsJJavaComponentHelperEx [inline, package] |
Gets the xxOperations interface as generated by the IDL compiler by calling _getOperationsInterface().
| AcsJJavaComponentHelperEx | if the subclass methdod throws something or returns null. |
References _getOperationsInterface(), and alma::JavaContainerError::wrappers::AcsJJavaComponentHelperEx::setContextInfo().
Referenced by alma::acs::container::AcsContainer::activate_component(), getInterfaceTranslator(), getInternalInterface(), and getPOATieClass().
| final Class<? extends Servant> alma::acs::container::ComponentHelper::getPOATieClass | ( | ) | throws AcsJJavaComponentHelperEx [inline, package] |
Gets the Class object for the POA tie skeleton class. The POA tie class is generated by the IDL compiler and must have a constructor that takes the operations interface as its only parameter.
References _getPOATieClass(), getOperationsInterface(), and alma::JavaContainerError::wrappers::AcsJJavaComponentHelperEx::setContextInfo().
Referenced by alma::acs::container::AcsContainer::activate_component().
| boolean alma::acs::container::ComponentHelper::requiresOrbCentralLogSuppression | ( | ) | [inline, protected] |
Do not overwrite this method unless you absolutely need to (currently only for the archive logger component!)
If true then the ORB logger will not send any log messages to the central (remote) Log service after activation of this component, regardless of any kind (env var, CDB, dynamic) log level settings. Local stdout logging by the ORB is not affected. Currently the ORB log suppression is not reversible: even when the component which requested this is unloaded, the ORB logger will not resume sending remote log messages. This may change in the future though.
Note that getComponentMethodsExcludedFromInvocationLogging can switch off automatic logging done by the container on behalf of the component. However, the ORB does not use a logger-per-component concept, and thus can't be told selectively to not log anything for a particualar component. The entire process (container and all components) are affected by suppressing the ORB's remote logging.
This method addresses the special problem of an infrastructural component that receives log messages from the Log service and writes them to the archive. Any message logged by the ORB on the receiver side would go back to the Log service and be received by the infrastructural component, with positive feedback leading to an explosion of log messages. Therefore we can't rely on log level settings and must categorically rule out such feedback loops.
Reimplemented in alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentHelper.
Referenced by alma::acs::container::AcsContainer::activate_component().
| final void alma::acs::container::ComponentHelper::setComponentInstanceName | ( | String | name | ) | [inline, package] |
Allows the container to set the component instance name. This name is used for the component logger and may also be useful in other ways.
Note that in a better design this name should be given in the constructor, but was added here as a separate method to avoid modifying existing component helper classes.
| name | the component instance name (CURL). |
References componentInstanceName.
String alma::acs::container::ComponentHelper::componentInstanceName [protected] |
Referenced by getComponentImpl(), getComponentLogger(), and setComponentInstanceName().
Referenced by getComponentImpl(), and getInterfaceTranslator().
final Logger alma::acs::container::ComponentHelper::m_containerLogger [private] |
1.6.2