
Public Member Functions | |
| String | getName () |
| AcsLogger | getLogger () |
| DAL | getCDB () throws AcsJContainerServicesEx |
| OffShoot | activateOffShoot (Servant cbServant) throws AcsJContainerServicesEx |
| void | deactivateOffShoot (Servant cbServant) throws AcsJContainerServicesEx |
| AdvancedContainerServices | getAdvancedContainerServices () |
| ThreadFactory | getThreadFactory () |
Through this interface, the container offers services to its hosted components. The component must call these methods explicitly; in this respect, ContainerServices is different from the other services that the container provides without the component implementation knowing about it. It can be thought of as a callback handle or a library.
Currently, methods are added to this interface as the functionality becomes available. At some point we will have to declutter the interface by introducing 2nd-level interfaces that harbor cohesive functionality. For example, instead of calling myContainerServices.getComponent(...), the new call will then be something like myContainerServices.communication().getComponent(...).
created on Oct 24, 2002 12:56:36 PM
| OffShoot alma::acs::container::ContainerServicesBase::activateOffShoot | ( | Servant | cbServant | ) | throws AcsJContainerServicesEx |
Finds components by their instance name (curl) and/or by their type. Wildcards can be used for the curl and type. This method returns a possibly empty array of component curls; for each curl, you may then call getComponent to obtain the reference.
| curlWildcard | (null is understood as "*") | |
| typeWildcard | (null is understood as "*") |
To be used primarily after retrieval of a component with getDefaultComponent or getDynamicComponent, when some data like the instance name is not known. The idea behind having this method separately is that in many cases, components are not interested in this information, and are happier to get back from these methods directly the remote reference to another component, instead of always dealing with a ComponentDescriptor.
| componentUrl | the unique name of a component |
| ContainerException | if componentUrl is unknown or anything else goes wrong |
_release() on the CORBA stub for that component. If the curl is not known to the container, the request will be ignored. This method will return only when the component has actually been released, which may take some time in case there are still active requests being processed.
| componentUrl | the name/curl of the component instance as used by the manager Called to find out whether a filter should be applied such that only notifications arrive for components to which the caller holds a reference. Called when components become available Called when components become unavailable Allows a client to register a callback object that gets notified when some component(s) in use by the client (= components the client requested previously) dies or comes back to life (with ComponentListener::includeForeignComponents()==false). |
If the client wants to get notified even for components that it does not hold a reference to, then ComponentListener::includeForeignComponents() should return true.
| listener |
The OffShoot servant can be either a subclass of the xyzPOA skeleton, or a xyzPOATie instance (delegation model). Since ACS 4.1.2, a tie servant is detected, and interception code gets inserted between the POATie skeleton and the offshoot implementation class. This way, the container can intercept (and log) calls to offshoots in the same way as it does for calls to components. It is therefore recommended to use the tie approach for all offshoot servants, unless there is a reason to avoid container interception.
| cbServant | the CORBA-generated servant, e.g. CBdoublePOA; must implement alma.ACS.OffShootOperations. |
CBdouble myCBdouble = alma.ACS.CBdoubleHelper.narrow(...). | ContainerException | if anything goes wrong, especially if cbServant is not an OffShoot. |
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by alma::ACS::MasterComponentImpl::StateChangeListener::createMonitor(), alma::acs::nc::AcsNcReconnectionCallback::init(), alma::acs::nc::refactored::NCPublisher::NCPublisher(), alma::ACS::impl::CommonPropertyImpl::registerMonitor(), alma::demo::LampAccessImpl::LampAccessImpl::setLampBrightness(), alma::acs::nc::SimpleSupplier::SimpleSupplier(), and alma::acs::component::client::ComponentClientTestCaseTest::testActivateOffShoot().
| void alma::acs::container::ContainerServicesBase::deactivateOffShoot | ( | Servant | cbServant | ) | throws AcsJContainerServicesEx |
Deactivates the offshoot corba object. Caution: this method returns immediately, while the underlying org.omg.PortableServer.POAOperations#deactivate_object(byte[]) still works on the deactivation. If activateOffShoot(Servant) is called too shortly after deactivation, an exception will be thrown. TODO: find a remedy
| cbServant | must implement alma.ACS.OffShootOperations. |
| AcsJContainerServicesEx | if something goes wrong, e.g., if the offshoot servant was not active. |
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by alma::ACS::MasterComponentImpl::StateChangeListener::destroyMonitor(), alma::acs::nc::SimpleSupplier::disconnect(), alma::acs::nc::refactored::NCPublisher::disconnect(), alma::acs::nc::Consumer::disconnect(), alma::acs::nc::AcsNcReconnectionCallback::disconnect(), alma::ACS::impl::CommonPropertyImpl::unregisterMonitor(), and alma::ACS::impl::CharacteristicComponentImpl::unregisterProperty().
| AdvancedContainerServices alma::acs::container::ContainerServicesBase::getAdvancedContainerServices | ( | ) |
More specialized methods are available from the AdvancedContainerServices.
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by cl::utfsm::samplingSystemUI::core::AcsInformation::AcsInformation(), alma::acs::alarmsystem::corbaservice::AlarmServiceUtils::AlarmServiceUtils(), alma::acs::nc::AnyAide::complexObjectToCorbaAny(), com::cosylab::logging::LoggingClient::connect(), alma::acs::nc::StructuredEventCreator::createEvent(), alma::acs::nc::AnyAide::doubleArrayToCorbaAny(), com::cosylab::acs::jms::ACSJMSMessage::findProperty(), alma::acs::nc::AnyAide::floatArrayToCorbaAny(), alma::ACS::impl::CharacteristicModelImpl::get_all_characteristics(), alma::ACS::impl::CharacteristicModelImpl::get_characteristic_by_name(), alma::acs::nc::ChannelProperties::getCDBAdminProps(), alma::acs::nc::ChannelProperties::getCDBQoSProps(), alma::acs::nc::Helper::getNamingServiceInitial(), alma::jconttest::util::JconttestUtil::getSystemLevelOrbTimeoutMillis(), alma::acs::nc::AnyAide::intArrayToCorbaAny(), alma::COUNTER::CounterTestImpl::ContainerTestUtil::loginToManager(), alma::contLogTest::TestLogLevelsCompImpl::ContainerTestUtil::loginToManager(), alma::acs::nc::AnyAide::objectToCorbaAny(), alma::acs::nc::SimpleSupplier::publishEvent(), alma::acs::nc::refactored::NCPublisher::publishEvent(), alma::acs::nc::ArchiveSupplier::publishEvent(), alma::acs::nc::AnyAideTest::setUp(), alma::acs::gui::loglevel::LogLevelPanel::start(), and alma::acs::nc::AnyAide::stringArrayToCorbaAny().
| DAL alma::acs::container::ContainerServicesBase::getCDB | ( | ) | throws AcsJContainerServicesEx |
Gets a component specified by its instance name. Delegates to get_component.
This method is necessarily generic and will require a cast to the requested interface, like in HelloComponent helloComp = HelloComponentHelper.narrow(containerServices.getComponent("HELLOCOMP1"));.
the more general method get_service offered by the manager is deliberately not represented here. It would currently (Oct.03) offer access to "LogFactory", "NotifyEventChannelFactory", "ArchivingChannel", "LoggingChannel", "InterfaceRepository", "CDB", "ACSLogSvc", "PDB"; It seems that if such access is needed, specialized methods should be added to this interface, like getCDB().
if requested, we may come up with some additional way (e.g. a code-generated singleton class) to give type safe access to other components, like done with EJB xxxHome.
| componentUrl | the ACS CURL of the deployed component instance. |
| AcsJContainerServicesEx | if something goes wrong. Gets a non-sticky reference to a component. This is typically used by "weak clients" such as graphical user interfaces that only want to observe the running system without interfering with its functioning. |
A non-sticky reference does not bind the Manager to keep alive the Component, and the Client requesting a non-sticky reference is not considered when checking for reference counts. The non-sticky reference should not be released, as that call will fail. The Manager can deactivate Components independently of any non-sticky reference. Since a non-sticky reference is not considered in reference counting, it will also not activate the component if it is not already active. As a consequence, asking for a non-sticky reference to a not-active Component throws an exception. The client represented by id (the handle) must have adequate access rights to access the component.
| curl | the component URL (component instance name) |
| AcsJContainerServicesEx | if something goes wrong |
IDL:alma/PS/PowerSupply:1.0. A default instance for the given type must have been declared beforehand (either statically in the CDB config files, or dynamically), otherwise an exception is thrown.
To get more information on the returned component, call getComponentDescriptor with the instance name that you can get from the component using alma.ACS.ACSComponentOperations#name.
Delegates to si.ijs.maci.ManagerOperations#get_default_component.
| componentIDLType |
| AcsJContainerServicesEx | Gets a component that will run collocated with a given component. |
| compUrl | the component's name (URL) | |
| targetCompUrl | the name (URL) of the target component, in whose container we also want compUrl to run. |
| AcsJContainerServicesEx | If the call failed and no component reference could be obtained. |
| compSpec | the description of the component to be created | |
| markAsDefaul | if true, the new component will become the default component for its IDL type. | |
| targetCompUrl | targetCompUrl the name (URL) of the target component, in whose container we also want compUrl to run. |
| AcsJContainerServicesEx | If the call failed and no component reference could be obtained. |
The fields of compSpec can be filled in at various levels of detail, allowing the manager to blend in missing data from static deployment information. For a detailed description of the various options, please refer to the ACS documentation.
To get more information on the returned component, call getComponentDescriptor with the instance name that you've specified or that you can get from the component in case it was assigned (see alma.ACS.ACSComponentOperations#name()).
Delegates to si.ijs.maci.ManagerOperations#get_dynamic_component.
| compSpec | the description of the component to be created | |
| markAsDefault | if true, the new component will become the default component for its IDL type. More powerful and thus more dangerous version of getDynamicComponent(ComponentQueryDescriptor, boolean) which exposes a CORBA struct directly. | |
| compSpec | the description of the component to be created | |
| markAsDefault | if true, the new component will become the default component for its IDL type. |
component_name or component_type, but also the more advanced values component_code or container_name, please send a request to ACS so that access to these fields be included in the ComponentQueryDescriptor given to the recommended version of this method. Convenience method for accessing the Configuration Database.
Currently more than a convenience, given that the CDB is not yet a Java component, but a separate service...
| ContainerException |
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by alma::acs::nc::ChannelProperties::cdbChannelConfigExists(), alma::acs::nc::ChannelProperties::getCDBAdminProps(), alma::acs::nc::ChannelProperties::getCDBQoSProps(), alma::jconttest::util::JconttestUtil::getContainerLevelOrbTimeout(), alma::acs::nc::Helper::getEventHandlerTimeoutMap(), alma::acs::nc::ChannelInfo::getEventHandlerTimeoutMap(), alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::init(), alma::ACS::impl::CharacteristicComponentImpl::initialize(), alma::acs::nc::ChannelProperties::isTraceEventsEnabled(), alma::ACS::impl::PropertyImpl::PropertyImpl(), and alma::acs::component::client::ComponentClientTestCaseTest::testGetDAL().
| AcsLogger alma::acs::container::ContainerServicesBase::getLogger | ( | ) |
Delivers the ComponentStateManager object through which the component and the container administrate the state of the component.
The component needs to access the ComponentStateManager if it wishes to change its state. If it doesn't, only the container will change the state based on the information it has available.
Logger object that the component should use for logging. The Logger will be set up with a namespace specific to the component that uses this ContainerServices instance.
Specific logger extensions that only apply to certain subsystems can be used by wrapping this logger with a class such as alma.acs.logging.domainspecific.AntennaContextLogger.
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by cl::utfsm::samplingSystemUI::core::AcsInformation::AcsInformation(), alma::acssamp::jtest::acssampSupplier::acssampSupplier(), alma::acs::lasercore::test::stress::category::CategorySubscriber::adddAlarmView(), alma::acs::alarmsystem::corbaservice::AlarmServiceUtils::AlarmServiceUtils(), alma::acs::nc::AnyAide::AnyAide(), alma::alarmsystem::clients::CategoryClient::CategoryClient(), alma::acs::nc::ChannelInfo::ChannelInfo(), alma::acs::nc::ChannelProperties::ChannelProperties(), alma::ACS::impl::CommonPropertyImpl::CommonPropertyImpl(), alma::acs::lasercore::test::stress::CategoryClient::connect(), alma::acs::gui::loglevel::LogLevelFrame::connectACSComponentClient(), alma::acs::gui::util::panel::Frame::connectACSComponentClient(), alma::acs::lasercore::test::stress::category::CategorySubscriber::connectSubscriber(), alma::COUNTER::CounterTestImpl::ContainerTestUtil::ContainerTestUtil(), alma::contLogTest::TestLogLevelsCompImpl::ContainerTestUtil::ContainerTestUtil(), alma::acs::lasercore::test::stress::CategoryClient::dumpCategories(), alma::acs::eventbrowser::model::EventReceivingTest::EventReceivingTest(), alma::acs::nc::AbstractNotificationChannel::getReceiver(), cl::utfsm::samplingSystemUI::core::SamplingManager::getSamplingObj(), alma::acs::nc::Helper::Helper(), alma::alarmsystem::source::ACSAlarmSystemInterfaceFactory::init(), alma::contLogTest::TestLogLevelsCompImpl::TestLogLevelsCompImpl::initialize(), alma::lifecycleTest::TestLifeCycleCompImpl::TestLifeCycleCompImpl::initialize(), alma::test::corbareftest::component::HelloWorldImpl::initialize(), alma::demo::HelloDemoImpl::HelloDemoImpl::initialize(), alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::initialize(), alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::initialize(), alma::acs::component::ComponentImplBase::initialize(), alma::acs::lasercore::test::stress::CategoryClient::initialize(), cl::utfsm::samplingSystemUI::SampTool::initializeComponents(), alma::jconttest::util::JconttestUtil::JconttestUtil(), alma::demo::client::LampComponentClient1::LampComponentClient1(), utfsm::Loader::load(), alma::demo::client::HelloDemoClient::main(), alma::acs::nc::refactored::NCPublisher::NCPublisher(), cl::utfsm::samplingSystemUI::core::NotificationChannelSuscription::NotificationChannelSuscription(), alma::acs::lasercore::test::stress::category::CategorySubscriber::onMessage(), cl::utfsm::samplingSystemUI::core::NotificationChannelSuscription::push_structured_event(), cl::utfsm::samplingSystemUI::core::NotificationChannelSuscription::saveSampledData(), utfsm::TestAlarmDAO::setUp(), alma::acs::callbacks::SampleRequester::setUp(), alma::acs::nc::refactored::NCSubscriberTest::setUp(), alma::acs::nc::refactored::NCPublisherTest::setUp(), alma::acs::lasercore::test::IDLSendAlarmTest::setUp(), alma::acs::lasercore::test::CoreCDBAlarmTest::setUp(), alma::alarmsystem::clients::SourceClient::SourceClient(), alma::acs::gui::loglevel::LogLevelPanel::start(), and alma::acs::nc::StructuredEventCreator::StructuredEventCreator().
| String alma::acs::container::ContainerServicesBase::getName | ( | ) |
Delivers the unique instance name for the component. The name must have been specified at deployment time in the CDB (for static components like the famous "LAMP1" example), or must have been given to the manager at runtime by the client who creates a dynamic component (or was invented by the manager if none was given).
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by alma::acs::nc::StructuredEventCreator::createEvent(), alma::COUNTER::CounterTestImpl::ContainerTestUtil::loginToManager(), alma::contLogTest::TestLogLevelsCompImpl::ContainerTestUtil::loginToManager(), alma::contLogTest::TestLogLevelsCompImpl::TestLogLevelsCompImpl::name(), alma::lifecycleTest::TestLifeCycleCompImpl::TestLifeCycleCompImpl::name(), alma::test::corbareftest::component::HelloWorldImpl::name(), alma::demo::HelloDemoImpl::HelloDemoImpl::name(), alma::COUNTER::CounterSupplierImpl::CounterSupplierImpl::name(), alma::COUNTER::CounterConsumerImpl::CounterConsumerImpl::name(), alma::acs::nc::SimpleSupplier::publishEvent(), alma::acs::nc::refactored::NCPublisher::publishEvent(), alma::acs::nc::ArchiveSupplier::publishEvent(), and alma::acs::component::client::AdvancedComponentClientTest::testCreateContainerServices().
| ThreadFactory alma::acs::container::ContainerServicesBase::getThreadFactory | ( | ) |
Creates a unique id and sets it on the given (binding class) entity object. The id will be redundantly stored in an encrypted format so that later it can be verified that the id is indeed the one originally assigned.
| entity | must be freshly created and Converts a "flat-XML" component interface (as obtained from the various getComponent methods) to a "transparent-XML" component interface. This is only applicable to components that contain XML entities in their IDL interface methods, and for which the build process has been set up to generate XML binding classes and the "transparent-XML" interface in addition to the standard Java-IDL compiler output. |
The container can fulfill this request in two different ways:
flatXmlIF) and the corresponding Java binding classes (in transparentXmlIF). In either case, the returned Object implements the transparentXmlIF interface. The client component that calls this method should only cast to that interface, and does not need to know which of the two transport mechanisms are being used.
| transparentXmlIF | component interface with XML binding classes. | |
| componentReference | reference to the component to be wrapped, as obtained through getComponent(String), thus implements flatXmlIF. | |
| flatXmlIF | component interface where entity objects are represented as serialized XML inside a CORBA struct. |
transparentXmlIF. Gets a ThreadFactory, to be used as input for other classes from the concurrent library (such as ThreadPoolExecutor), or simply to create new Threads. All user-created threads should come from the factory returned here, so "<code>new Thread(...)</code>" should not appear anywhere in component code.
The returned thread factory creates new threads configured to run well in the container environment, e.g.
Implemented in alma::alarmsystem::corbaservice::AlarmSystemContainerServices, alma::acs::container::ContainerServicesImpl, and com::cosylab::acs::maci::manager::app::ManagerContainerServices.
Referenced by alma::ACS::impl::CharacteristicComponentImpl::execute(), and alma::ACS::MasterComponentImpl::MasterComponentImplBase::initialize().
1.6.2