summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/ciao/Deployment_Core.idl
blob: 6dac65c2fda2f0b966a676ebf8b18349af9ae39b (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// $Id$

#if !defined (DEPLOYMENT_CORE_IDL)
#define DEPLOYMENT_CORE_IDL

#include "CCM_Component.idl"

// *************** Packaging and Deployment ***************
module Deployment
{
  // Typeprefix Components "omg.org";
  // OMG threw these things away, didn't it.

  exception UnknownImplId {};
  exception InvalidLocation {};
  exception InstallationFailure {/*Do we still need a reason? --Tao*/};
  exception ImplEntryPointNotFound {};

  //Below are from the OMG Deployment.idl

  exception StartError {
    string name;
    string reason;
  };

  exception InvalidConnection {
    string name;
    string reason;
  };
  //==============property==================
  struct Property {
    string name;
    any value;
  };
  typedef sequence < Property > Properties;

  //============connection==================

  typedef sequence < Object > Endpoints;
  //typedef Object Endpoint;

  enum CCMComponentPortKind {
    Facet,
    SimplexReceptacle,
    MultiplexReceptacle,
    EventEmitter,
    EventPublisher,
    EventConsumer
  };

  // To avoid the connection info in the plan being passed to the
  // local node and to make the implementation not very cumbersome
  // I changed the connection struct to include some extra informations.
  struct Connection {
    string instanceName;
    string portName;
    CCMComponentPortKind kind;

    // the endpoints member is change to endpoint.
    // Since we will not have more than 1 objref in there.
    Object endpoint;
  };
  typedef sequence < Connection > Connections;

  //=======================================
  struct ImplementationInfo
  {
    string component_instance_name;
    string executor_dll;
    string executor_entrypt;
    string servant_dll;
    string servant_entrypt;
    Properties component_config;
    //  Properties home_config;      //ignored for now.
    //  Properties container_config  //igore for now
  };

  typedef sequence < ImplementationInfo > ImplementationInfos;

  //==================================
  interface Application
  {
    void finishLaunch (in Connections providedReference, in boolean start)
      raises (StartError, InvalidConnection);
    void start ()
      raises (StartError);
  };

  struct Component_Info
  {
    string component_instance_name;
    Components::CCMObject component_ref;
  };

  typedef sequence < Component_Info > ComponentInfos;

  // @@ (OO) Tao, you're altering an OMG defined interface below.  In
  //         order to avoid confusion, it is probably better to create
  //         another NodeApplication interface in the CIAO namespace
  //         that inherits from Deployment::NodeApplication.  You'd
  //         then use the CIAO::NodeApplication in your
  //         implementation.
  //
  //         Alternatively, you should at least place a CIAO-specific
  //         typeprefix within your altered NodeApplication interface
  //         to prevent interoperability issues.

  // This NodeApplication contains the semantic from both Container and
  // the new DnC NodeApplication  --Tao
  interface NodeApplication : Application
  {
    readonly attribute ::Deployment::Properties properties;

    /*@@ This operation is added for the NodeApplicationManager to
     *   initialize the NodeApplication after creating it.  The
     *   properties are those for the Container and they will be
     *   implemented upon request from our users.   --Tao
     *
     *   Seems Kitty is opposing the idea of sending anys around. But
     *   what really stroke me down was that OMG is working out
     *   another property&configuration specification so all the
     *   properties we set/used might have to be thrown away in the
     *   future.....I am totally speachless and confused...and
     *   frustrated.
     *
     *   But any way seems I can forget about the configuration
     *   now. --Tao
     */

    // @@ Initialize the nodeapplication, so it will know what
    //    components it will create and home many of them are
    //    there. However the real create action will take place when
    //    start launch is called on NodeApplicationManager.
    long init ();

    // @@ This operation will be called by NodeApplicationManager
    //    client to really start to create homes and components.
    ComponentInfos install (in ImplementationInfos impl_infos)
      raises (UnknownImplId,
              ImplEntryPointNotFound,
              InstallationFailure,
              ::Components::InvalidConfiguration);


    //@@ We know that Dployment::NodeApplicationManager will be returned,
    //   however to avoid the size of the shared object of CIAO_Server.
    //   we return an Object.
       Object get_node_application_manager ();

    //@@ The properties will contain
    //1 component instance name as the key.
    //2 dll/so name of the exec
    //3 entry point of the exec
    //4 dll/so name of the svnt
    //5 entry point of the svnt
    //6 Poosible other configuration for container/home/component
    //Note:: We have to decide later how container/home/component could be configured.
    //       These properties could be passed in here or at higher level
    //       according to the plan(@ NodeApplicationManager/NodeApplication?)
    //
    //The reason that I want to expose these operation in IDL (can be called remotely)
    //is   1. for easy testing.
    //     2. Might comes in handy in the future.
    //                                                   --Tao
    ::Components::CCMHome install_home (in ImplementationInfo impl_info)
        raises (UnknownImplId,
                ImplEntryPointNotFound,
                InstallationFailure,
                ::Components::InvalidConfiguration);

    void remove_home (in string comp_ins_name)
      raises (::Components::RemoveFailure);

    ::Components::CCMHomes get_homes ();

    void remove ()
      raises (::Components::RemoveFailure);


  };

};
#endif /* DEPLOYMENT_CORE_IDL */