com::cosylab::acs::maci::manager::app::ManagerContainerServices Class Reference

Inheritance diagram for com::cosylab::acs::maci::manager::app::ManagerContainerServices:
Inheritance graph
[legend]
Collaboration diagram for com::cosylab::acs::maci::manager::app::ManagerContainerServices:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ManagerContainerServices (ORB orb, POA clientPOA, DAL dal, Logger logger)
OffShoot activateOffShoot (Servant servant) throws AcsJContainerServicesEx
void deactivateOffShoot (Servant servant) throws AcsJContainerServicesEx
void checkOffShootPOA () throws AcsJContainerEx, AcsJUnexpectedExceptionEx
AdvancedContainerServices getAdvancedContainerServices ()
DAL getCDB ()
synchronized AcsLogger getLogger ()
String getName ()
ThreadFactory getThreadFactory ()
String corbaObjectToString (org.omg.CORBA.Object objRef)
org.omg.CORBA.Object corbaObjectFromString (String strObjRef)
org.omg.CORBA.Any getAny ()
ORB getORB ()
void connectManagerAdmin (AdministratorOperations adminOp, boolean retryConnectOnFailure) throws AcsJContainerEx
void disconnectManagerAdmin (AdministratorOperations adminOp)

Private Member Functions

void checkOffShootServant (Servant servant) throws AcsJContainerServicesEx

Private Attributes

final ORB orb
final DAL dal
final Logger logger
AcsLogger componentLogger
final POA clientPOA
POA offshootPoa
Policy[] offshootPolicies

Detailed Description

Author:
msekoranja

Constructor & Destructor Documentation

com::cosylab::acs::maci::manager::app::ManagerContainerServices::ManagerContainerServices ( ORB  orb,
POA  clientPOA,
DAL  dal,
Logger  logger 
) [inline]
Parameters:
orb 
dal 
logger 

References offshootPoa.


Member Function Documentation

OffShoot com::cosylab::acs::maci::manager::app::ManagerContainerServices::activateOffShoot ( Servant  servant  )  throws AcsJContainerServicesEx [inline]
void com::cosylab::acs::maci::manager::app::ManagerContainerServices::checkOffShootPOA (  )  throws AcsJContainerEx, AcsJUnexpectedExceptionEx [inline]
void com::cosylab::acs::maci::manager::app::ManagerContainerServices::checkOffShootServant ( Servant  servant  )  throws AcsJContainerServicesEx [inline, private]
void com::cosylab::acs::maci::manager::app::ManagerContainerServices::connectManagerAdmin ( AdministratorOperations  adminOp,
boolean  retryConnectOnFailure 
) throws AcsJContainerEx [inline]

Allows to connect a manager admin object to the manager, to receive notifications etc.

In the current implementation every call to this method establishes a new connection to the manager. Should a client ever need to call this method more than once, it must also call disconnectManagerAdmin(String) for each of its admin objects.

This method accepts and distinguishes AdministratorOperations objects and the subtyped SynchronousAdministratorOperations objects.

Parameters:
adminOp callback object
retryConnectOnFailure retry if the manager is not available or the connection failed.
Exceptions:
AcsJContainerEx 
Since:
ACS 7.0

Implements alma::acs::container::AdvancedContainerServices.

org.omg.CORBA.Object com::cosylab::acs::maci::manager::app::ManagerContainerServices::corbaObjectFromString ( String  strObjRef  )  [inline]

Encapsulates org.omg.CORBA.ORB#string_to_object(String).

Parameters:
strObjRef 
Returns:
org.omg.CORBA.Object

Implements alma::acs::container::AdvancedContainerServices.

References logger, and orb.

String com::cosylab::acs::maci::manager::app::ManagerContainerServices::corbaObjectToString ( org.omg.CORBA.Object  objRef  )  [inline]

Encapsulates org.omg.CORBA.ORB#object_to_string(org.omg.CORBA.Object).

Parameters:
objRef the corba stub
Returns:
standardized string representation of objRef.

Implements alma::acs::container::AdvancedContainerServices.

References logger, and orb.

void com::cosylab::acs::maci::manager::app::ManagerContainerServices::deactivateOffShoot ( Servant  cbServant  )  throws AcsJContainerServicesEx [inline]

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

Parameters:
cbServant must implement alma.ACS.OffShootOperations.
Exceptions:
AcsJContainerServicesEx if something goes wrong, e.g., if the offshoot servant was not active.

Implements alma::acs::container::ContainerServicesBase.

References checkOffShootServant(), logger, offshootPoa, and alma::JavaContainerError::wrappers::AcsJContainerServicesEx::setContextInfo().

void com::cosylab::acs::maci::manager::app::ManagerContainerServices::disconnectManagerAdmin ( AdministratorOperations  adminOp  )  [inline]

Releases a previously connected manager admin object. This call is ignored if the given object is not connected.

Parameters:
componentUrl 

Implements alma::acs::container::AdvancedContainerServices.

AdvancedContainerServices com::cosylab::acs::maci::manager::app::ManagerContainerServices::getAdvancedContainerServices (  )  [inline]

More specialized methods are available from the AdvancedContainerServices.

Implements alma::acs::container::ContainerServicesBase.

org.omg.CORBA.Any com::cosylab::acs::maci::manager::app::ManagerContainerServices::getAny (  )  [inline]

Returns a reference to a new CORBA Any. In Java the only way to do this is through the ORB itself (i.e., the create_any method).

Returns:
org.omg.CORBA.Any
Exceptions:
NullPointerException if the Any object could not be created.

Implements alma::acs::container::AdvancedContainerServices.

References logger, and orb.

DAL com::cosylab::acs::maci::manager::app::ManagerContainerServices::getCDB (  )  [inline]

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.

  • the Container will later shortcut calls for components inside the same process. Like in EJB and CORBA, the implementation must therefore not assume receiving a by-value copy of any parameter from the other component.
Parameters:
componentUrl the ACS CURL of the deployed component instance.
Returns:
the CORBA proxy for the component.
Exceptions:
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.

Parameters:
curl the component URL (component instance name)
Returns:
the CORBA proxy for the component.
Exceptions:
AcsJContainerServicesEx if something goes wrong
Since:
ACS 6.0 Gets the default component specified by the component type. The type is the IDL type, such as 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.

Parameters:
componentIDLType 
Returns:
Exceptions:
AcsJContainerServicesEx Gets a component that will run collocated with a given component.
Parameters:
compUrl the component's name (URL)
targetCompUrl the name (URL) of the target component, in whose container we also want compUrl to run.
Returns:
the component reference, which should be cast using the appropriate CORBA narrow operation. Never null.
Exceptions:
AcsJContainerServicesEx If the call failed and no component reference could be obtained.
Since:
ACS 5.0.3 Dynamic version of getCollocatedComponent(String, String).
Parameters:
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.
Returns:
Exceptions:
AcsJContainerServicesEx If the call failed and no component reference could be obtained.
Since:
ACS 6.0.4 Gets a component whose instance is not registered in the CDB at deployment time.

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.

Parameters:
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.
Deprecated:
use getDynamicComponent(ComponentQueryDescriptor, boolean) instead. if you need to set not only the standard fields 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...

Returns:
the CDB interface
Exceptions:
ContainerException 

Implements alma::acs::container::ContainerServicesBase.

References dal.

synchronized AcsLogger com::cosylab::acs::maci::manager::app::ManagerContainerServices::getLogger (  )  [inline]

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.

Returns:
the state manager
See also:
alma.ACS.ComponentStates Gets a 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.

Returns:
Logger

Implements alma::acs::container::ContainerServicesBase.

References componentLogger, and getName().

String com::cosylab::acs::maci::manager::app::ManagerContainerServices::getName (  )  [inline]

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).

Returns:
the unique component instance name

Implements alma::acs::container::ContainerServicesBase.

Referenced by activateOffShoot(), and getLogger().

ORB com::cosylab::acs::maci::manager::app::ManagerContainerServices::getORB (  )  [inline]

Provides explicit access to the normally invisible ORB, for components that fulfill infrastructural tasks.

Normal subsystem components must not use this method! If they feel they should get access to the ORB, either ACS is missing a feature which should be reported, or there is a misunderstanding in how to develop software for Alma.

Returns:
the ORB that connects the container and its components with other processes.

Implements alma::acs::container::AdvancedContainerServices.

References orb.

ThreadFactory com::cosylab::acs::maci::manager::app::ManagerContainerServices::getThreadFactory (  )  [inline]

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.

Parameters:
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:

  1. Remote component: if the specified component runs in a different container, a dynamic wrapper object will be created around the provided CORBA stub. The wrapper object will translate between entity object parameters in the form of serialized XML (as found in flatXmlIF) and the corresponding Java binding classes (in transparentXmlIF).
  2. Collocated component: if the specified component runs in the same container, the container may choose to shortcut the (de-) serialization of XML binding classes. In this case, Java binding classes are transported in memory, and all communication with the other component is done without CORBA.

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.

Parameters:
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.
Returns:
the object that implements 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.

  • all threads are daeemon threads so that they can't interfere with container shutdown.
  • the priority is the same as that of the calling component thread (which is created by the ORB)
  • uncaught user exceptions are logged as WARNING before the thread terminates.
  • when a component is removed from the container, surviving user threads created by that component are killed using Thread#stop() (which even though deprecated, seems like the perfect choice in this particular situation). Otherwise a faulty components could permanently take away resources from a running container and from the other components.
Returns:
the thread factory to be used by the component to create new threads.

Implements alma::acs::container::ContainerServicesBase.


Member Data Documentation

Referenced by checkOffShootPOA().

Referenced by getLogger().

Referenced by getCDB().

Referenced by checkOffShootPOA().


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

Generated by  doxygen 1.6.2