#include <maciContainerImpl.h>
Collaboration diagram for maci::ContainerImpl:
Public Member Functions | |
maci::Container_ptr | getContainerCORBAProxy () |
char * | getProcessName () |
ContainerImpl () | |
Constructor. | |
virtual | ~ContainerImpl () |
Destructor. | |
maci::Manager_ptr | getManager () |
bool | init (int argc, char *argv[]) |
bool | connect () |
bool | run () |
bool | done () |
int | getStatus () |
Get status of container (main() return value). | |
void | setStatus (int status) |
Set status of container (main() return value). | |
void | etherealizeComponent (const char *id, PortableServer::Servant servant) |
Called by the servant manager - used to etherealize component when references to it dropped to 0. | |
int | getShutdownAction () |
void | setShutdownAction (int action) |
maci::Handle | getHandle () |
PortableServer::POA_var | getContainerPOA () |
PortableServer::POAManager_var | getPOAManager () |
ContainerServices * | getContainerServices () |
CORBA::ORB_var | getContainerORB () |
virtual maci::ComponentInfo * | activate_component (maci::Handle h, maci::ExecutionId execution_id, const char *name, const char *exe, const char *type) |
virtual void | deactivate_components (const maci::HandleSeq &h) |
virtual CORBA::Object_ptr | restart_component (maci::Handle h) |
virtual void | shutdown (CORBA::ULong action) |
virtual maci::ComponentInfoSeq * | get_component_info (const maci::HandleSeq &h) |
virtual char * | name () |
virtual void | disconnect () |
virtual maci::AuthenticationData * | authenticate (maci::ExecutionId execution_id, const char *question) |
virtual void | message (CORBA::Short type, const char *message) |
virtual void | taggedmessage (CORBA::Short type, CORBA::Short tag, const char *message) |
virtual void | components_available (const maci::ComponentInfoSeq &components) |
virtual void | components_unavailable (const maci::stringSeq &component_names) |
virtual void | set_component_shutdown_order (const maci::HandleSeq &h) |
virtual CORBA::Object_ptr | get_object (const char *name, const char *domain, bool activate) |
template<class T> T * | get_object (const char *name, const char *domain, bool activate) |
template<class T> T * | getComponent (const char *name, const char *domain, bool activate) |
template<class T> T * | getService (const char *name, const char *domain, bool activate) |
void | releaseComponent (const char *name) |
virtual CORBA::Boolean | ping () |
virtual maci::LoggingConfigurable::LogLevels | get_default_logLevels () |
virtual void | set_default_logLevels (const maci::LoggingConfigurable::LogLevels &) |
virtual maci::stringSeq * | get_logger_names () |
virtual maci::LoggingConfigurable::LogLevels | get_logLevels (const char *) |
virtual void | set_logLevels (const char *, const maci::LoggingConfigurable::LogLevels &) |
virtual void | refresh_logging_config () |
void | loadLoggerConfiguration (const std::string &loggerName) |
CORBA::Object_ptr | activateCORBAObject (PortableServer::Servant srvnt, const char *name) |
Activates CORBA obejct. | |
bool | deactivateCORBAObject (PortableServer::Servant servant) |
Deactivates servant. | |
bool | deactivateCORBAObject (CORBA::Object_ptr servant) |
Deactivates servant. | |
Static Public Member Functions | |
ContainerImpl * | getContainer () |
LoggingProxy * | getLoggerProxy () |
void | initThread (const char *threadName=0) |
Thread initialization method. Has to be called by each thread to initialize it. | |
void | doneThread () |
Thread finalization method. Has to be called by each thread to finalize it. | |
void | configureLogger (const std::string &loggerName) |
Protected Member Functions | |
Logging::Logger::LoggerSmartPtr | getLogger () |
Private Types | |
typedef ACE_Hash_Map_Manager< maci::Handle, ContainerComponentInfo, ACE_Recursive_Thread_Mutex > | COMPONENT_HASH_MAP |
typedef ACE_Hash_Map_Iterator< maci::Handle, ContainerComponentInfo, ACE_Recursive_Thread_Mutex > | COMPONENT_HASH_MAP_ITER |
typedef ACE_Hash_Map_Entry< maci::Handle, ContainerComponentInfo > | COMPONENT_HASH_MAP_ENTRY |
typedef ACE_Unbounded_Set< maci::Handle > | COMPONENT_LIST |
Private Member Functions | |
int | parseArgs (int argc, char *argv[]) |
void | showUsage (int argc, char *argv[]) |
Show usage. | |
ContainerServices * | instantiateContainerServices (maci::Handle h, ACE_CString &name, PortableServer::POA_ptr poa) |
bool | initializeCORBA (int &argc, char *argv[]) |
Initializes componentA. | |
bool | doneCORBA () |
Finalizes CORBA. | |
int | loadDLL (const char *bame) |
Helper method to loadDLL. | |
maci::Manager_ptr | resolveManager (int nSecTimeout) |
Resolve manager. | |
void | logout () |
Private Attributes | |
const char * | m_pid_file_name |
File to output the process id. | |
const char * | m_manager_ref |
Manager cmd-ln reference. | |
const char * | m_container_name |
MACIServantManager * | m_servant_mgr |
servant manager | |
cdb::Table * | m_database |
Database access. | |
maci::Container_var | m_container_ref |
CORBA::ORB_var | orb |
PortableServer::POAManager_var | poaManager |
PortableServer::POA_var | poaRoot |
PortableServer::POA_var | poaContainer |
PortableServer::POA_var | poaPersistent |
PortableServer::POA_var | poaTransient |
maci::Manager_var | m_manager |
Reference to the manager. | |
maci::Handle | m_handle |
Handle of the container (given from Mamager at logon). | |
int | m_status |
bool | m_shutdown |
Is manager shutting down? | |
COMPONENT_HASH_MAP | m_activeComponents |
Data about all active components. | |
COMPONENT_LIST | m_activeComponentList |
Component list (preserves order of activation). | |
maci::HandleSeq | m_componentShutdownOrder |
Component shutdown order (given from the manager). | |
ACE_CString | m_dbPrefix |
ACE_CString | m_dbRootPrefix |
int | m_argc |
int | m_fullargc |
char ** | m_argv |
int | m_shutdownAction |
Shutdown action. | |
bool | m_hasIFR |
Is InterfaceRepository present? | |
bool | m_recovery |
Recovery switch. | |
ACE_SYNCH_MUTEX | m_shutdownMutex |
The mutual exclusion mechanism which is required to use the <condition_>. | |
ACE_SYNCH_CONDITION | m_shutdownDone |
Condition used to wait until Container shutdown is finished. | |
bool | m_shutdownDoneSignaled |
Signaling state (to avoid waiting for already signaled signal). | |
int | m_serverThreads |
Number of server threads to handle CORBA ORB requests. | |
bool | m_dynamicContainer |
Dynamic container (i.e. without CDB configuration). | |
ContainerServices * | m_containerServices |
ContainerServices. | |
maci::ContainerThreadHook | m_containerThreadHook |
threads' standard start-up hook | |
Logging::Logger::LoggerSmartPtr | m_logger |
Logger for this container;. | |
maci::LoggingConfigurable::LogLevels | m_defaultLogLevels |
std::map< std::string, maci::LoggingConfigurable::LogLevels > | m_logLevels |
maci::ExecutionId | m_executionId |
ACS::Time | m_startTime |
Static Private Attributes | |
ContainerImpl * | m_container |
LibraryManager * | m_dllmgr |
library manager | |
LoggingProxy * | m_loggerProxy |
logger | |
int | m_logLevelRefresh |
int | m_logLevelConfigure |
CORBA::ULong | m_invocationTimeout |
Invocation timeout in milliseconds (0 - disabled). |
The Container could be easily extended to assist the Manager in fault detection: the Container could respond to periodic pings issued by the Manager, and if the responses stop, the Manager could assume a failure of the Container's computer.
|
|
|
|
|
|
|
|
|
Constructor.
|
|
Destructor.
|
|
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.
|
|
Activates CORBA obejct.
|
|
Authentication method. 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.
|
|
Notify client about the change (availability) of the components currently in use by this client. For administrative clients, notification is issued for the change of availability of any component in the domain.
|
|
Notify client that some of the components currently in use by client have become unavailable.
|
|
|
|
|
|
Deactivate all components whose handles are 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 it's code-base is no longer used, it is unloaded from memory.
|
|
Deactivates servant.
|
|
Deactivates servant.
|
|
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. |
|
|
|
Finalizes CORBA.
|
|
Thread finalization method. Has to be called by each thread to finalize it.
|
|
Called by the servant manager - used to etherealize component when references to it dropped to 0.
|
|
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!
|
|
Logging configurable methods |
|
|
|
|
|
get_object template method
|
|
Get a component, activating it if necessary. The client must have adequate access rights to access the component. This is untrue of components: NameService, Log, LogFactory, NotifyEventChannelFactory, ArchivingChannel, LoggingChannel, InterfaceRepository, CDB and PDB.
|
|
getComponent template method
|
|
Get container instance Discouraged direct usage of this reference, use CORBA proxy instead: ContainerImpl::getContainer()->getContainerCORBAProxy()
|
|
Get container CORBA proxy instance
|
|
Get container ORB
|
|
Get container POA
|
|
Get container services
|
|
Get container handle
|
|
Returns an ACS Logger created for this container.
|
|
Get logging proxy instance
|
|
Get manager instance
EXAMPLE: Attempt an operation on the Manager. try { getContainer()->getManager()->release_component("mycomponent"); } catch(const CORBA::SystemException&) { } |
|
Get POA Manager
|
|
Get container's proces name
|
|
getService template method
|
|
Get shutdown action.
|
|
Get status of container (main() return value).
|
|
|
|
Initializes componentA.
|
|
Thread initialization method. Has to be called by each thread to initialize it.
|
|
Build a new ContainerServices object (this object implements the abstract class acsContainerServices)
|
|
Helper method to loadDLL.
|
|
|
|
|
|
The Manager and administrators use this method for sending textual messages to the client.
|
|
Container name
|
|
Parses command-line argument
|
|
Manager pings its clients (both GUI clients, as well as Containers) repeatedly to verify that they still exist. The return value can be either
|
|
|
|
Releases the specified component.
|
|
Resolve manager.
|
|
Restarts an component.
|
|
|
|
Notify container about component shutdown order.
|
|
|
|
|
|
Set shutdown action.
|
|
Set status of container (main() return value).
|
|
Show usage.
|
|
Shutdown the Container.
|
|
The Manager and administrators use this method for sending tagged textual messages to the client.
|
|
Component list (preserves order of activation).
|
|
Data about all active components.
|
|
|
|
|
|
Component shutdown order (given from the manager).
|
|
|
|
|
|
|
|
|
|
threads' standard start-up hook
|
|
Database access.
|
|
|
|
|
|
|
|
library manager
|
|
Dynamic container (i.e. without CDB configuration).
|
|
|
|
|
|
Handle of the container (given from Mamager at logon).
|
|
Is InterfaceRepository present?
|
|
Invocation timeout in milliseconds (0 - disabled).
|
|
Logger for this container;.
|
|
logger
|
|
|
|
|
|
|
|
Reference to the manager.
|
|
Manager cmd-ln reference.
|
|
File to output the process id.
|
|
Recovery switch.
|
|
servant manager
|
|
Number of server threads to handle CORBA ORB requests.
|
|
Is manager shutting down?
|
|
Shutdown action.
|
|
Condition used to wait until Container shutdown is finished.
|
|
Signaling state (to avoid waiting for already signaled signal).
|
|
The mutual exclusion mechanism which is required to use the <condition_>.
|
|
|
|
Status of the container, later used as the return value from the main() function. |
|
|
|
|
|
|
|
|
|
|
|
|