summaryrefslogtreecommitdiff
path: root/DAnCE/dance/LocalityManager/Daemon/Locality_Manager_Impl.h
blob: 9e41964691bcc0865223cf0380f56f5287722c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// -*- C++ -*-
/**
 * @file Locality_Manager_Impl.h
 * @author William R. Otte <wotte@dre.vanderbilt.edu>
 **/

// TAO_IDL - Generated from
// be/be_codegen.cpp:1521

#ifndef DANCE_LOCALITYMANAGERI_PDD6RP_H_
#define DANCE_LOCALITYMANAGERI_PDD6RP_H_

#include "dance/DAnCE_LocalityManagerS.h"
#include "dance/DAnCE_DeploymentInterceptorsC.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/LocalObject.h"


#include "dance/LocalityManager/Daemon/Locality_Manager_Impl_Export.h"
#include "dance/LocalityManager/Scheduler/Deployment_Scheduler.h"
#include "dance/LocalityManager/Scheduler/Plugin_Manager.h"

#include <map>
#include <vector>
#include <list>
#include <string>

namespace DAnCE
{

  class Locality_Manager_Impl_Export LocalityManager_i
    : public virtual POA_DAnCE::LocalityManager
  {
  public:
    // Constructor
    LocalityManager_i (const ACE_TString &uuid,
                       std::list <std::string> plugin_config_files,
                       CORBA::ORB_ptr orb,
                       PortableServer::POA_ptr poa);

    void init (const Deployment::Properties &prop);
    // Destructor
    virtual ~LocalityManager_i (void);

    virtual
      ::Deployment::Properties * configuration (void);

    virtual
      ::Deployment::ApplicationManager_ptr preparePlan (
                          const ::Deployment::DeploymentPlan & plan,
                          ::Deployment::ResourceCommitmentManager_ptr resourceCommitment);

    virtual
      void destroyManager (::Deployment::ApplicationManager_ptr manager);

    virtual
      void shutdown (void);

    virtual
      void finishLaunch (const ::Deployment::Connections & providedReference,
                         ::CORBA::Boolean start);

    virtual
      void start (void);

    virtual
      ::Deployment::Application_ptr startLaunch (const ::Deployment::Properties & configProperty,
                                                 ::Deployment::Connections_out providedReference);

    virtual
      void destroyApplication (::Deployment::Application_ptr app);

  private:
    void install_instances (const ::Deployment::Properties &prop);

    void collect_references (::Deployment::Connections_out &providedReference);

    void disconnect_connections (void);

    const char * determine_instance_type (const ::Deployment::PlanConnectionDescription &conn,
                                  const ::Deployment::Connection & providedReference);

    ACE_TString uuid_;

    std::list< std::string > plugin_config_files_;

    CORBA::ORB_var orb_;
    PortableServer::POA_var poa_;

    typedef std::list< CORBA::ULong > INSTANCE_LIST;

    typedef std::map <std::string,
                      INSTANCE_LIST> HANDLER_TABLE;

    HANDLER_TABLE instance_handlers_;

    Plugin_Manager::INSTALL_ORDER handler_order_;

    typedef std::map < std::string, CORBA::Any_var > REFERENCE_MAP;

    REFERENCE_MAP instance_references_;

    ::Deployment::DeploymentPlan plan_;

    DAnCE::Deployment_Scheduler scheduler_;

    CORBA::ULong spawn_delay_;
  };

}
#endif /* DANCE_LOCALITYMANAGERI_H_  */