#include <DomainApplicationManager_AMH_Impl.h>
Public Types | |
enum | Connection_Search_Type { External_Connections, Internal_Connections } |
typedef struct CIAO::DomainApplicationManager_AMH_Impl::_chained_artifacts | Chained_Artifacts |
Public Member Functions | |
DomainApplicationManager_AMH_Impl (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, Deployment::TargetManager_ptr manager, Execution_Manager::Execution_Manager_Impl *em, const Deployment::DeploymentPlan &plan, const char *deployment_file) | |
Constructor. | |
void | init () |
void | set_uuid (const char *uuid) |
const char * | get_uuid () const |
virtual void | get_node_app (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, const char *node_name) |
virtual void | startLaunch (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, const ::Deployment::Properties &configProperty,::CORBA::Boolean start) |
virtual void | finishLaunch (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, CORBA::Boolean start, CORBA::Boolean is_ReDAC) |
virtual void | post_finishLaunch (void) |
virtual void | passivate_shared_components (void) |
virtual void | activate_shared_components (void) |
virtual void | start (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) |
virtual void | destroyApplication (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) |
virtual void | getPlan (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) |
virtual void | destroyManager (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh) |
virtual void | perform_redeployment (Deployment::AMH_DomainApplicationManagerResponseHandler_ptr _tao_rh, const Deployment::DeploymentPlan &plan) |
Protected Types | |
typedef ACE_Hash_Map_Manager_Ex < ACE_CString, Chained_Artifacts, ACE_Hash < ACE_CString >, ACE_Equal_To < ACE_CString > , ACE_Null_Mutex > | Chained_Artifacts_Table |
typedef ACE_Hash_Map_Manager_Ex < ACE_CString, CIAO::CIAO_Event_Service_var, ACE_Hash< ACE_CString > , ACE_Equal_To< ACE_CString > , ACE_Null_Mutex > | Event_Service_Table |
Protected Member Functions | |
virtual | ~DomainApplicationManager_AMH_Impl (void) |
Destructor. | |
bool | get_plan_info (void) |
int | split_plan (void) |
CIAO::Component_Binding_Info * | populate_binding_info (const ACE_CString &name, const ACE_CString &child_uuid) |
CIAO::Component_Binding_Info * | populate_binding_info (const ACE_CString &name) |
void | synchronize_shared_components_with_node_managers (void) |
void | add_shared_components (const Deployment::ComponentPlans &shared) |
bool | is_shared_component (const char *name) |
void | add_connections (const Deployment::Connections &incoming_conn) |
Deployment::Connections * | get_outgoing_connections (const Deployment::DeploymentPlan &plan, bool is_getting_all_connections=true, bool is_search_new_plan=true, Connection_Search_Type t=Internal_Connections) |
bool | get_outgoing_connections_i (const char *instname, Deployment::Connections &retv, bool is_ReDAC, bool is_search_new_plan) |
This is a helper function to find the connection for a component. | |
bool | populate_connection_for_binding (const char *instname, const Deployment::PlanConnectionDescription &binding, const Deployment::DeploymentPlan &plan, Deployment::Connections &retv) |
bool | handle_es_connection (const char *instname, const Deployment::PlanConnectionDescription &binding, const Deployment::DeploymentPlan &plan, Deployment::Connections &retv) |
bool | handle_direct_connection (const char *instname, const Deployment::PlanConnectionDescription &binding, const Deployment::DeploymentPlan &plan, Deployment::Connections &retv) |
void | dump_connections (const ::Deployment::Connections &connections) |
Dump connections, a static method. | |
bool | already_exists (const Deployment::PlanConnectionDescription &conn) |
Check whether a connection already exists in the cached old plan. | |
Deployment::Connections * | subtract_connections (const Deployment::Connections &left, const Deployment::Connections &right) |
Remove those appeared in <right> from the <left>. | |
void | purge_connections (Deployment::Connections_var &connections, const char *inst) |
virtual void | install_all_es (void) |
virtual void | add_es_to_map (const char *node_name, CIAO::CIAO_Event_Service *ciao_es) |
virtual const Deployment::Properties * | get_connection_QoS_configuration (const Deployment::Requirement &requirement) |
Protected Attributes | |
CORBA::String_var | domainapp_path_ |
location of the Domainapplication | |
CORBA::ORB_var | orb_ |
Keep a pointer to the managing ORB serving this servant. | |
PortableServer::POA_var | poa_ |
Keep a pointer to the managing POA. | |
Execution_Manager::Execution_Manager_Impl * | execution_manager_ |
Deployment::ComponentPlans_var | shared_ |
Cache a list of shared components. | |
CORBA::String_var | ior_ |
Cache the ior of the previous reference. | |
Deployment::TargetManager_var | target_manager_ |
Cached TargetManager. | |
Deployment::DeploymentPlan | plan_ |
Deployment::DeploymentPlan | old_plan_ |
Cached old deployment plan, i.e., before redeployment. | |
size_t | num_child_plans_ |
Cached child plans. | |
ACE_Vector< ACE_CString > | node_manager_names_ |
Chained_Artifacts_Table | artifact_map_ |
Event_Service_Table | es_map_ |
const char * | deployment_file_ |
The deployment information data file. | |
Deployment_Configuration | deployment_config_ |
Deployment Configuration info, which contains the deployment topology. | |
CORBA::String_var | uuid_ |
UUID from the Plan. | |
::Deployment::Connections_var | all_connections_ |
bool | is_redeployment_ |
CIAO::DAnCE::EventServiceDeploymentDescriptions_var | esd_ |
Cache the CIAO_Event_Service deployment description. | |
Classes | |
struct | _chained_artifacts |
typedef struct CIAO::DomainApplicationManager_AMH_Impl::_chained_artifacts CIAO::DomainApplicationManager_AMH_Impl::Chained_Artifacts |
Cached information for NodeManager, NodeApplicationManager, NodeApplication, Connections, etc. Key: NodeManager name with CString type. Value: Chained_Artifacts struct type.
typedef ACE_Hash_Map_Manager_Ex<ACE_CString, CIAO::CIAO_Event_Service_var, ACE_Hash<ACE_CString>, ACE_Equal_To<ACE_CString>, ACE_Null_Mutex> CIAO::DomainApplicationManager_AMH_Impl::Event_Service_Table [protected] |
Cached information of all the CIAO_Event_Service objects within the deployment plan Key: the string identifier of the CIAO_Event_Service Value: the object reference of the CIAO_Event_Service
CIAO::DomainApplicationManager_AMH_Impl::DomainApplicationManager_AMH_Impl | ( | CORBA::ORB_ptr | orb, | |
PortableServer::POA_ptr | poa, | |||
Deployment::TargetManager_ptr | manager, | |||
Execution_Manager::Execution_Manager_Impl * | em, | |||
const Deployment::DeploymentPlan & | plan, | |||
const char * | deployment_file | |||
) |
Constructor.
CIAO::DomainApplicationManager_AMH_Impl::~DomainApplicationManager_AMH_Impl | ( | void | ) | [protected, virtual] |
Destructor.
void CIAO::DomainApplicationManager_AMH_Impl::init | ( | ) |
Initialize the DomainApplicationManager. em A pointer to the ExecutionManager servant C++ object.
(1) Set the total number of child plans. (2) Set the list of NodeManager names, which is an array of strings. The <node_manager_names> is a pointer to an array of ACE_CString objets, which is allocated by the caller and deallocated by the DomainApplicationManager destructor. (3) Check the validity of the deployment plan and the deployment information data file. (4) Call split_plan () member function. (5) Invoke all the preparePlan () operations on all the corresponding NodeManagers with child plans.
@ What else do we need to initialize here?
ACE_INLINE void CIAO::DomainApplicationManager_AMH_Impl::set_uuid | ( | const char * | uuid | ) |
set_uuid method on the DomainApplicationManager assigns the UUID of the associated plan to this Manager. This helps in reverse lookup operations such as given a manager, obtaining the UUID associated. The get_uuid method is used in this case.
ACE_INLINE const char * CIAO::DomainApplicationManager_AMH_Impl::get_uuid | ( | ) | const |
void CIAO::DomainApplicationManager_AMH_Impl::get_node_app | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh, | |
const char * | node_name | |||
) | [virtual] |
Fetch the NodeApplication object reference based on the NodeManager name.
void CIAO::DomainApplicationManager_AMH_Impl::startLaunch | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh, | |
const ::Deployment::Properties & | configProperty, | |||
::CORBA::Boolean | start | |||
) | [virtual] |
Executes the application, but does not start it yet. Users can optionally provide launch-time configuration properties to override properties that are part of the plan. Raises the InvalidProperty exception if a configuration property is invalid. Raises the StartError exception if an error occurs during launching. Raises the ResourceNotAvailable exception if the commitResources parameter to the prepare operation of the ExecutionManager was true, if late resource allocation is used, and one of the requested resources is not available.
Reimplemented in CIAO::DomainApplicationManager_AMI_Impl.
void CIAO::DomainApplicationManager_AMH_Impl::finishLaunch | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh, | |
CORBA::Boolean | start, | |||
CORBA::Boolean | is_ReDAC | |||
) | [virtual] |
The second step in launching an application in the domain-level. If the start parameter is true, the application is started as well. Raises the StartError exception if launching or starting the application fails.
void CIAO::DomainApplicationManager_AMH_Impl::post_finishLaunch | ( | void | ) | [virtual] |
The last step in launching an application in the domain-level. We establish connection bindings for external/shared components of this deployment plan components. Internally, this operation will invoke some operations on ExecutionManager to finish up this task.
void CIAO::DomainApplicationManager_AMH_Impl::passivate_shared_components | ( | void | ) | [virtual] |
void CIAO::DomainApplicationManager_AMH_Impl::activate_shared_components | ( | void | ) | [virtual] |
void CIAO::DomainApplicationManager_AMH_Impl::start | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh | ) | [virtual] |
Starts the application. Raises the StartError exception if starting the application fails.
void CIAO::DomainApplicationManager_AMH_Impl::destroyApplication | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh | ) | [virtual] |
Terminates a running application. Raises the StopError exception if an error occurs during termination. Raises the InvalidReference exception if the appliction reference is unknown.
void CIAO::DomainApplicationManager_AMH_Impl::getPlan | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh | ) | [virtual] |
Returns the DeploymentPlan associated with this ApplicationManager.
void CIAO::DomainApplicationManager_AMH_Impl::destroyManager | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh | ) | [virtual] |
This is a helper function to destroy the NodeAppManager. Since we don't want to do so in the destructor so we will ask the ExecutionManager to do this on us when the same IDL op invoked on it. This is part of the result for merging DAM with DA.
void CIAO::DomainApplicationManager_AMH_Impl::perform_redeployment | ( | Deployment::AMH_DomainApplicationManagerResponseHandler_ptr | _tao_rh, | |
const Deployment::DeploymentPlan & | plan | |||
) | [virtual] |
bool CIAO::DomainApplicationManager_AMH_Impl::get_plan_info | ( | void | ) | [protected] |
(1) Parse the global deployment plan, get the total number of child plans included in the global plan, and get the list of names of NodeManagers for each child plan. (2) Check whether all the NodeManager names are present in the deployment information data file.
int CIAO::DomainApplicationManager_AMH_Impl::split_plan | ( | void | ) | [protected] |
Split the global (domain-level) deployment plan to a set of local (node-level) deployment plans. The set of local plans are cached in the ACE hash map member variable. Also, fill in the <node_manager_> field of the Chained_Artifacts struct.
CIAO::Component_Binding_Info * CIAO::DomainApplicationManager_AMH_Impl::populate_binding_info | ( | const ACE_CString & | name, | |
const ACE_CString & | child_uuid | |||
) | [protected] |
Construct <Component_Binding_Info> struct for the component instance.
name | component instance name | |
child_uuid | child plan uuid string |
CIAO::Component_Binding_Info * CIAO::DomainApplicationManager_AMH_Impl::populate_binding_info | ( | const ACE_CString & | name | ) | [protected] |
Construct <Component_Binding_Info> struct for the component instance. Fetch the plan_uuid info from the internally cached shared component list.
name | component instance name |
void CIAO::DomainApplicationManager_AMH_Impl::synchronize_shared_components_with_node_managers | ( | void | ) | [protected] |
Contact each NodeManager to get shared compnents information and then update its internal cache.
void CIAO::DomainApplicationManager_AMH_Impl::add_shared_components | ( | const Deployment::ComponentPlans & | shared | ) | [protected] |
A helper function to add a list of shared components into the cached shared component list.
shared | A list of shared components to be added. |
bool CIAO::DomainApplicationManager_AMH_Impl::is_shared_component | ( | const char * | name | ) | [protected] |
A private function to check whether a component is in the shared component list.
name | The name of a component instance. |
void CIAO::DomainApplicationManager_AMH_Impl::add_connections | ( | const Deployment::Connections & | incoming_conn | ) | [protected] |
Cache the incoming connections, which is a sequence of Connections, into the <all_connections_> list.
Deployment::Connections * CIAO::DomainApplicationManager_AMH_Impl::get_outgoing_connections | ( | const Deployment::DeploymentPlan & | plan, | |
bool | is_getting_all_connections = true , |
|||
bool | is_search_new_plan = true , |
|||
Connection_Search_Type | t = Internal_Connections | |||
) | [protected] |
Given a child deployment plan, find the <Connections> sequence of the "providedReference" for the component instances in the child deployment plan as Receiver side. By default, we search in the new plan.
If <is_getting_all_connections> is false, then we only search for "new connections" (valid for ReDaC case only). Otherwise, we will search for both new connections and those already existing connections.
bool CIAO::DomainApplicationManager_AMH_Impl::get_outgoing_connections_i | ( | const char * | instname, | |
Deployment::Connections & | retv, | |||
bool | is_ReDAC, | |||
bool | is_search_new_plan | |||
) | [protected] |
This is a helper function to find the connection for a component.
bool CIAO::DomainApplicationManager_AMH_Impl::populate_connection_for_binding | ( | const char * | instname, | |
const Deployment::PlanConnectionDescription & | binding, | |||
const Deployment::DeploymentPlan & | plan, | |||
Deployment::Connections & | retv | |||
) | [protected] |
bool CIAO::DomainApplicationManager_AMH_Impl::handle_es_connection | ( | const char * | instname, | |
const Deployment::PlanConnectionDescription & | binding, | |||
const Deployment::DeploymentPlan & | plan, | |||
Deployment::Connections & | retv | |||
) | [protected] |
bool CIAO::DomainApplicationManager_AMH_Impl::handle_direct_connection | ( | const char * | instname, | |
const Deployment::PlanConnectionDescription & | binding, | |||
const Deployment::DeploymentPlan & | plan, | |||
Deployment::Connections & | retv | |||
) | [protected] |
void CIAO::DomainApplicationManager_AMH_Impl::dump_connections | ( | const ::Deployment::Connections & | connections | ) | [protected] |
Dump connections, a static method.
bool CIAO::DomainApplicationManager_AMH_Impl::already_exists | ( | const Deployment::PlanConnectionDescription & | conn | ) | [protected] |
Check whether a connection already exists in the cached old plan.
Deployment::Connections * CIAO::DomainApplicationManager_AMH_Impl::subtract_connections | ( | const Deployment::Connections & | left, | |
const Deployment::Connections & | right | |||
) | [protected] |
Remove those appeared in <right> from the <left>.
void CIAO::DomainApplicationManager_AMH_Impl::purge_connections | ( | Deployment::Connections_var & | connections, | |
const char * | inst | |||
) | [protected] |
void CIAO::DomainApplicationManager_AMH_Impl::install_all_es | ( | void | ) | [protected, virtual] |
The first step in finish_launching an application in the domain-level. We install all the CIAO_Event_Service objects as specified in the DeploymentPlan. Internally, this operation will invoke an operation on each cached NodeApplication object.
void CIAO::DomainApplicationManager_AMH_Impl::add_es_to_map | ( | const char * | node_name, | |
CIAO::CIAO_Event_Service * | ciao_es | |||
) | [protected, virtual] |
Add all CIAO_Event_Service objects into the cached map.
const Deployment::Properties * CIAO::DomainApplicationManager_AMH_Impl::get_connection_QoS_configuration | ( | const Deployment::Requirement & | requirement | ) | [protected, virtual] |
Get the actual event connection QoS properties based on the deployment requirement. The deployment requirement only specifies an identifier/reference to the EventServiceDeploymentDescriptions.
location of the Domainapplication
Keep a pointer to the managing ORB serving this servant.
Keep a pointer to the managing POA.
Execution_Manager::Execution_Manager_Impl* CIAO::DomainApplicationManager_AMH_Impl::execution_manager_ [protected] |
Pointer to the ExecutionManager_Impl "singleton" servant object We could do this because ExecutionManager and DomainApplicationManager are always collocated in the same process, so we don't have to pass CORBA object reference back and forth.
Deployment::ComponentPlans_var CIAO::DomainApplicationManager_AMH_Impl::shared_ [protected] |
Cache a list of shared components.
Cache the ior of the previous reference.
Deployment::TargetManager_var CIAO::DomainApplicationManager_AMH_Impl::target_manager_ [protected] |
Cached TargetManager.
Cached deployment plan for the particular domain. The plan will be initialized when init is called.
Cached old deployment plan, i.e., before redeployment.
size_t CIAO::DomainApplicationManager_AMH_Impl::num_child_plans_ [protected] |
Cached child plans.
Total number of child deployment plans.
The list of node manager names, each of them corresponds to one child plan.
const char* CIAO::DomainApplicationManager_AMH_Impl::deployment_file_ [protected] |
The deployment information data file.
Deployment Configuration info, which contains the deployment topology.
UUID from the Plan.
::Deployment::Connections_var CIAO::DomainApplicationManager_AMH_Impl::all_connections_ [protected] |
Maintain a list of <Connections>, each of which is obtained by calling the startLaunch() method on the NodeApplicationManager object.
bool CIAO::DomainApplicationManager_AMH_Impl::is_redeployment_ [protected] |
This variable is used to control the execution path of some member function implementations. The reason is because we want to avoid unnecessary code duplicate. The default value is "false".
CIAO::DAnCE::EventServiceDeploymentDescriptions_var CIAO::DomainApplicationManager_AMH_Impl::esd_ [protected] |
Cache the CIAO_Event_Service deployment description.