summaryrefslogtreecommitdiff
path: root/TAO/CIAO/ciao/Deployment_Core.idl
blob: 98fd140ff9150d9d9c0feca44bcd7faeb66c4de1 (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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
// $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 
  {
    string name;
    string reason;
  };

  exception InvalidLocation {};
  exception InstallationFailure 
  {
    string name;
    string reason;
  };
  exception ImplEntryPointNotFound 
  {
    string name;
    string reason;
  };

  //Below are from the OMG Deployment.idl

  exception StartError
  {
    string name;
    string reason;
  };

  exception StopError {
    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,
	ecEventEmitter,
    ecEventPublisher,
    ecEventConsumer,
    rtecEventEmitter,
    rtecEventPublisher,
    rtecEventConsumer,
    nsEventEmitter,
    nsEventPublisher,
    nsEventConsumer
  };

  // 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;

    string endpointInstanceName; // CIAO specific extension 
    string endpointPortName;     // CIAO specific extension

    // 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 ComponentImplementationInfo
  {
    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.
  };

  typedef sequence <ComponentImplementationInfo> ComponentImplementationInfos;

  // ContainerImplementationInfo contains a list of components to be installed and
  // policy configuration for the container which hosts these components
  struct ContainerImplementationInfo
  {
    ComponentImplementationInfos impl_infos;
    Properties container_config;
  };

  typedef sequence <ContainerImplementationInfo> ContainerImplementationInfos;

  struct NodeImplementationInfo
  {
    ContainerImplementationInfos impl_infos;
    Properties nodeapp_config;
  };

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

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

  typedef sequence < Component_Info > ComponentInfos;

  // @@ (OO) 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.

  interface NodeApplication; // Forward decl.
  typedef sequence<NodeApplication> NodeApplications;

  interface Container
  {
    readonly attribute ::Deployment::Properties properties;

    /// Get the NodeApplication which created us
    NodeApplication get_node_application ();

    /// Initialize the container with policies
    // long init (in ::CORBA::PolicyList policies);

    // NW: The following should be component specific info because the
    // container has already been created and initialized at this
    // time.  So there's not much container configuration to be done
    // at this stage.
    //@@ The container_impl_info 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

    /// Install all homes and components    
    Deployment::ComponentInfos install (in ContainerImplementationInfo container_impl_info)
        raises (UnknownImplId,
                ImplEntryPointNotFound,
                InstallationFailure,
                ::Components::InvalidConfiguration);

    /// Remove all homes and components
    void remove ()
      raises (::Components::RemoveFailure);

    /// Remove a component instance
    void remove_component (in string inst_name)
      raises (::Components::RemoveFailure);
  };

  typedef sequence<Container> Containers;

  interface NodeApplication : Application
  {
    readonly attribute ::Deployment::Properties properties;

    /// @@ 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 NodeImplementationInfo node_impl_info)
      raises (UnknownImplId,
              ImplEntryPointNotFound,
              InstallationFailure,
              ::Components::InvalidConfiguration,
              ::Components::RemoveFailure);

    ///@@ We know that Deployment::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 ();

    Container create_container (in ::Deployment::Properties properties)
      raises (::Components::CreateFailure,
              ::Components::InvalidConfiguration);

    void remove_container (in Container cref)
      raises (::Components::RemoveFailure);

    Containers get_containers ();

    /// Remove a component instance from the NodeApplication
    void remove_component (in string inst_name)
      raises (::Components::RemoveFailure);

    /// Remove all containers, components and component homes.
    /// Shuts down the ORB of the NodeApplication to terminate the process.
    oneway void remove ();

    /// CIAO specific extensions. This will enforce the component to
    /// be activated (preactivate, activate, postactivated) before the assembly
    /// is established
    void ciao_preactivate ()
      raises (StartError);

    void ciao_postactivate ()
      raises (StartError);

    void ciao_passivate ()
      raises (StopError);
  };

};
#endif /* DEPLOYMENT_CORE_IDL */