Public Member Functions | Public Attributes

maci::Container Interface Reference

import "maci.idl";

Inheritance diagram for maci::Container:
Inheritance graph
[legend]
Collaboration diagram for maci::Container:
Collaboration graph
[legend]

List of all members.

Public Member Functions

ComponentInfo activate_component (in Handle h, in ExecutionId execution_id, in string name, in string exe, in string type) raises (maciErrType::CannotActivateComponentEx)
void activate_component_async (in Handle h, in ExecutionId execution_id, in string name, in string exe, in string type, in CBComponentInfo callback, in ACS::CBDescIn desc)
void deactivate_component (in Handle h) raises (maciErrType::CannotDeactivateComponentEx, maciErrType::ComponentDeactivationUncleanEx, maciErrType::ComponentDeactivationFailedEx)
oneway void shutdown (in unsigned long action)
ComponentInfoSeq get_component_info (in HandleSeq h)
Object restart_component (in Handle h) raises (maciErrType::CannotRestartComponentEx)
void set_component_shutdown_order (in HandleSeq h)

Public Attributes

const string ContainerStatusStartupBeginMsg = "ContainerStatusMsg: Startup begins"
const string ContainerStatusStartupEndMsg = "ContainerStatusMsg: Startup ends"
const string ContainerStatusORBInitBeginMsg = "ContainerStatusMsg: ORB initialization begins"
const string ContainerStatusORBInitEndMsg = "ContainerStatusMsg: ORB initialization ends"
const string ContainerStatusMgrInitBeginMsg = "ContainerStatusMsg: Manager access initialization begins"
const string ContainerStatusMgrInitEndMsg = "ContainerStatusMsg: Manager access initialization ends"
const string ContainerStatusCompAutoloadBeginMsg = "ContainerStatusMsg: Automatic component loading begins"
const string ContainerStatusCompAutoloadEndMsg = "ContainerStatusMsg: Automatic component loading ends"
const string ContainerStatusReadyMsg = "ContainerStatusMsg: Ready"

Detailed Description

Container is an agent of MACI that is installed on every computer of the control system. There can be more than one container living on the same computer, but there can be only one container per process. It has the following responsibilities:

  1. Constructs components when the Manager instructs it to (see activate_component and deactivate_component).
  2. Provides the components that it hosts with basic MACI services, such as:
    • access to the Manager
    • access to the Local Database
    • access to other components (indirectly through the Manager)
    • access to the ORB and POA
  3. Handles intricacies of working with the ORB and the POA, such as connecting the newly created components to the POA.
  4. Maintains code-base of components that can be instantiated on the computer (see get_executables, get_executable_info and put_executable_code.
  5. Is responsive to a shutdown directive from the Manager, which can shutdown only the container's process, or reboot the computer (see shutdown).

The container assists the Manager in fault detection: the container responds to periodic pings issued by the Manager, and if the responses stop, the Manager may assume a failure of the container's computer (see the Client::ping method).

Container may support recovery. If the container terminates unexpectedly, and then recovers (after a reboot, for example), it logs in to the Manager and notifies it that it supports recovery by responding with "AR" to the Client::authenticate method. The Manager then uses the activate_component method on the container to bring all the components the container used to have back to life.

If the container does not support recovery, it should respond with "A" to the Client::authenticate method. In this case, the Manager will log off the previous instance of the container implicitly if it has not yet done so.


Member Function Documentation

ComponentInfo maci::Container::activate_component ( in Handle  h,
in ExecutionId  execution_id,
in string  name,
in string  exe,
in string  type 
) raises (maciErrType::CannotActivateComponentEx)

Activate a component whose type (class) and name (instance) are given.

In the process of activation, component's code-base is loaded into memory if it is not there already. The code-base resides in an executable file (usually a dynamic-link library or a shared library -- DLL).

On platforms that do not automatically load dependent executables (e.g., VxWorks), the container identifies the dependancies by querying the executable and loads them automatically.

Once the code is loaded, it is asked to construct a servant of a given type.

The servant is then initialized with the Configuration Database (CDB) and Persistance Database (PDB) data. The servant is attached to the component, and a reference to it is returned.

Returns:
Returns the reference to the object that has just been activated. If the component could not the activated, a nil reference is returned.
Parameters:
h Handle of the component that is being activated. This handle is used by the component when it will present itself to the Manager. The component is expected to remember this handle for its entire life-time.
execution_id Execution ID of the component
name that is being activated. Name of the component to instantiate.
exe Path to the executable file (a DLL or a shared library) in which the component's code resides. The path is relative to the root directory in which all executable code is stored. The path must not contain dots, and uses slashes (not backslashes) to separate components of the path. The path must not include the extension, or any prefixes, so that it is platform independent.
type The type of the component to instantiate. The interpretation of this field depends on the executable. Type should uniquely identify the code-base which the component will be executing. Note: Type name is NOT CORBA repository id.
void maci::Container::activate_component_async ( in Handle  h,
in ExecutionId  execution_id,
in string  name,
in string  exe,
in string  type,
in CBComponentInfo  callback,
in ACS::CBDescIn  desc 
)

Asynchronously activate a component. See activate_component.

Parameters:
h Handle of the component that is being activated. This handle is used by the component when it will present itself to the Manager. The component is expected to remember this handle for its entire life-time.
execution_id Execution ID of the component
name that is being activated. Name of the component to instantiate.
exe Path to the executable file (a DLL or a shared library) in which the component's code resides. The path is relative to the root directory in which all executable code is stored. The path must not contain dots, and uses slashes (not backslashes) to separate components of the path. The path must not include the extension, or any prefixes, so that it is platform independent.
type The type of the component to instantiate. The interpretation of this field depends on the executable. Type should uniquely identify the code-base which the component will be executing. Note: Type name is NOT CORBA repository id.

Deactivate a components whose handle is given. Deactivation is the inverse process of activation: component is detached from the POA, and thus made unavailable through CORBA, and its resources are freed. If its code-base is no longer used, it is unloaded from memory. For the time being the Containers implement this as a synchronous call, but in the future we may change it to return before the component has been fully deactivated. TODO: Remove CannotDeactivateComponentEx, see http://almasw.hq.eso.org/almasw/bin/view/ACS/ReleaseComponentRefactoring2010

Parameters:
h A handle identifying a component to be released.
ComponentInfoSeq maci::Container::get_component_info ( in HandleSeq  h  ) 

Returns information about a subset of components that are currently hosted by the container.

Note: If the list of handles is empty, information about all components hosted by the container is returned!

Returns:
Information about the selected components.
Parameters:
h Handles of the components whose information should be retrieved.
Object maci::Container::restart_component ( in Handle  h  )  raises (maciErrType::CannotRestartComponentEx)

Restarts an component. Returns a new reference of the restarted component.

Parameters:
h Handle of the component to be restarted.
void maci::Container::set_component_shutdown_order ( in HandleSeq  h  ) 

Set component shutdown order.

Parameters:
h Ordered sequence of component handles.
oneway void maci::Container::shutdown ( in unsigned long  action  ) 

Shutdown the container.

Notice that this is a oneway method and therefore there cannot be return values or user exceptions. Only CORBA runtime exceptions due to communication issues can be thrown

Parameters:
action Action to take after shutting down. Bits 8 thru 15 of this parameter denote the action, which can be one of:

  • 0 -- reload the container
  • 1 -- reboot the computer
  • 2 -- exit the container

The bits 0 thru 7 (values 0 to 255) are the return value that the container will pass to the operating system.


Member Data Documentation

const string maci::Container::ContainerStatusCompAutoloadBeginMsg = "ContainerStatusMsg: Automatic component loading begins"
const string maci::Container::ContainerStatusCompAutoloadEndMsg = "ContainerStatusMsg: Automatic component loading ends"
const string maci::Container::ContainerStatusMgrInitBeginMsg = "ContainerStatusMsg: Manager access initialization begins"
const string maci::Container::ContainerStatusMgrInitEndMsg = "ContainerStatusMsg: Manager access initialization ends"
const string maci::Container::ContainerStatusORBInitBeginMsg = "ContainerStatusMsg: ORB initialization begins"
const string maci::Container::ContainerStatusORBInitEndMsg = "ContainerStatusMsg: ORB initialization ends"
const string maci::Container::ContainerStatusReadyMsg = "ContainerStatusMsg: Ready"
const string maci::Container::ContainerStatusStartupBeginMsg = "ContainerStatusMsg: Startup begins"
const string maci::Container::ContainerStatusStartupEndMsg = "ContainerStatusMsg: Startup ends"

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