Public Member Functions | |
ComponentInfo | activate_component (int componentHandle, long execution_id, String compName, String exe, String type) throws CannotActivateComponentEx |
void | set_component_shutdown_order (int[] handleSeq) |
void | deactivate_components (int[] handles) throws CannotDeactivateComponentEx |
org.omg.CORBA.Object | restart_component (int compHandle) throws CannotRestartComponentEx |
void | shutdown (int encryptedAction) |
ComponentInfo[] | get_component_info (int[] handles) |
String | name () |
void | disconnect () |
AuthenticationData | authenticate (long execution_id, String question) |
void | message (short type, String message) |
void | taggedmessage (short type, short messageID, String message) |
boolean | ping () |
void | components_available (ComponentInfo[] components) |
void | components_unavailable (String[] component_names) |
LogLevels | get_default_logLevels () |
void | set_default_logLevels (LogLevels levels) throws IllegalArgumentEx |
String[] | get_logger_names () |
LogLevels | get_logLevels (String logger_name) throws LoggerDoesNotExistEx |
void | set_logLevels (String logger_name, LogLevels levels) throws LoggerDoesNotExistEx, IllegalArgumentEx |
void | refresh_logging_config () |
Static Public Attributes | |
final int | CONTAINER_RELOAD = 0 |
final int | CONTAINER_REBOOT = 1 |
final int | CONTAINER_EXIT = 2 |
Protected Member Functions | |
void | loginToManager () throws AcsJContainerEx |
Package Functions | |
AcsContainer (String containerName, AcsCorba acsCorba, AcsManagerProxy managerProxy, boolean isEmbedded) throws AcsJContainerEx | |
void | initialize () throws AcsJContainerEx |
DAL | getCDB () |
void | setRecoveryMode (boolean recoveryStart) |
void | shutdown (int encryptedAction, boolean gracefully, boolean isOrbThread) |
Private Member Functions | |
void | registerWithCorba () throws AcsJContainerEx |
ComponentAdapter | getExistingComponent (int componentHandle, String name, String type) |
ComponentHelper | createComponentHelper (String compName, String exe, ClassLoader compCL) throws AcsJContainerEx |
synchronized ComponentAdapter[] | markAndFilterForDeactivation (ComponentAdapter[] compAdapters) |
synchronized void | abortAllComponents (long maxWaitTimeMillis) |
void | logManagerRequest (String msgBegin, int[] handles) |
Private Attributes | |
final long | startTimeUTClong |
final String | m_containerName |
long | executionId = -1 |
final AcsManagerProxy | m_managerProxy |
final AcsCorba | m_acsCorba |
final boolean | isEmbedded |
final AcsLogger | m_logger |
final ThreadFactory | containerThreadFactory |
final ComponentMap | m_activeComponentMap |
LogConfig | logConfig |
DAL | cdb |
final AtomicBoolean | shuttingDown = new AtomicBoolean(false) |
boolean | useRecoveryMode = true |
Static Private Attributes | |
AcsContainer | s_instance |
ContainerPOA
, an instance of this class is a corba object that implements the maci container interface. Only one instance of this class can be created per JVM.
|
Constructor which creates a container that is registered as a CORBA object, but not yet logged in to the manager (for that, call initialize().
|
|
Aborts all components that are not already aborting or already defunct.
This method runs the components'
|
|
Activates a component so that it's ready to receive functional calls after returning from this method. Called by the ACS Manager. From MACI IDL: 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 dependencies 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.
|
|
Authentication method. Below some passages from maci.idl: Method authenticate is the challenge issued to the client after it tries to login. The login will be successful if the client's authenticate() produces the expected result. Only in this case will the Manager's login method return a valid handle, which the client will later use as the id parameter with all calls to the Manager. The first character of the answer identifies the type of the client, and can be one of:
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.
|
|
Notify client about the change (availability) of the components currently in use by this client.
|
|
Notify client that some of the components currently in use by client have become unavailable.
|
|
|
|
Deactivates all components whose handles are given. From maci.idl: 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.
|
|
Disconnect notification. The disconnect method is called by the Manager to notify the client that it will be unavailable and that the client should log off. Since ACS 7.0.2, this method returns quickly and uses a different thread to log back in with the manager. This is cleaner than taking a thread from the ORB's pool for a possibly long time, although the manager does not care because this method is defined as oneway in IDL.
|
|
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!
|
|
Gets the log levels of the default logging configuration. These levels are used by all loggers that have not been configured individually. |
|
Gets the names of all loggers, to allow configuring their levels individually. The names are those that appear in the log records in the field "SourceObject". This includes the container logger, ORB logger, component loggers, and (only C++) GlobalLogger. The returned logger names are randomly ordered. |
|
Gets log levels for a particular named logger. If the returned field LogLevels.useDefault is true, then the logger uses the default levels, see get_default_logLevels(); otherwise the returned local and remote levels apply.
For possible convenience, the default levels are returned in addition to setting LogLevels#useDefault to |
|
Gets a reference to the CDB. Reuses the previously obtained reference. Implemented as on-demand remote call, so always use this method instead of directly accessing the field cdb. TODO: reuse this CDB reference in ContainerServicesImpl for method getCDB()
|
|
Checks if there is an existing component that matches the spec. This can happen if the Manager went down and back up. Strategy:
|
|
Container initialization such as logging in to the manager, configuring logging, initializing the alarm system. This is taken out of the ctor just to keep is lean and be able to instantiate a minimum container for testing.
|
|
Will attempt to log into the manager. If the manager reference is not available, will enter a loop and keep trying. If login fails on an available manager, will throw a AcsJContainerServicesEx.
|
|
Logs a request from the manager which involves an array of component handles. (which is quite different from a LogManager request...)
Checks if the handles are valid. If no component can be found for a given handle, the string Used simply to avoid code duplication.
|
|
Filters out those components from Must be synchronized to avoid deactivating the same component more than once.
|
|
|
|
|
|
Replies with Prints a message to System.out, so that it's visible on the local console that the container is doing ok. Does not log anything, because a failure to reply would show up remotely anyway. No message is printed if the container log level is above INFO, see http://jira.alma.cl/browse/COMP-1736.
|
|
Commands the container or manager to read in again the logging configuration from the CDB and to reconfigure the loggers accordingly. This allows for persistent changes in the logging configuration to become effective, and also for changes of more advanced parameters. Note that unlike for the logging initialization in initialize(), now we give precedence to the CDB values over any previous settings. |
|
To be called only once from the ctor.
|
|
Not yet implemented. Left for ACS 3.1 (or later...), see comments at http://almasw.hq.eso.org/almasw/bin/view/ACS/NewMaciIdl, e.g. GianlucaChiozzi - 21 Oct 2003 We do not have really clear ideas yet about this. I think that the most accepted ipothesis is that restart of a component means destroy/create while restart of a container means shutdown/restart. For ACS 3.0 I would forget about this issue and leave it for ACS 3.1. from maci idl: Restarts a component. Returns a new reference of the restarted component.
|
|
Called by the manager to update the container's knowledge about optimum shutdown order of its components. This information will only be needed for a locally initiated container shutdown, since the manager will call deactivate_components(int[]) in a regular shutdown. |
|
Sets the log levels of the default logging configuration. These levels are used by all loggers that have not been configured individually. |
|
Sets log levels for a particular named logger. If levels.useDefault is true, then the logger will be reset to using default levels; otherwise it will use the supplied local and remote levels. |
|
|
|
Shuts down the container.
Depending on the This method may be called from the following threads:
|
|
Action to take after shutting down (ignored for the time being). Bits 8 thru 15 of this parameter denote the action, which can be one of:
The bits 0 thru 7 (values 0 to 255) are the return value that the Container should pass to the operating system. TODO: get rid of this silly bit-multiplexing
|
|
|
|
Cache for method getCDB(). Don't use this field directly. |
|
|
|
|
|
actions for shutdown() |
|
|
|
An ID assigned by the manager at first login. This ID survives logout/login to the manager. For container shutdown/crashes, a new ID is assigned the following login. |
|
|
|
Singleton logging config object shared with ClientLogManager. |
|
|
|
|
|
|
|
|
|
|
|
It's a singleton, but not with a static getAcsContainer() method to restrict access; |
|
|
|
|
|
see comments in authenticate(String) |