summaryrefslogtreecommitdiff
path: root/TAO/CIAO/ciao/CCM_Container_Ex.idl
blob: 0aeb481807df2e23da40d95e0d9266c52268fe50 (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$

/**
 * @@ Compile this file with:
 *
 *     tao_idl -Gv -I ../.. -I ../../orbsvcs/orbsvcs \
 *          -Wb,export_macro=CIAO_Export \
 *          -Wb,export_include=CIAO_export.h \
 *          -Wb,pre_include="ace/pre.h" \
 *          -Wb,post_include="ace/post.h" \
 *          CCM_Container_Ex.idl
 */

//#define CIAO_HAS_IMPORT_KEYWORD

#if !defined (CCM_CONTAINER_EX_IDL)
#define CCM_CONTAINER_EX_IDL

#include "CCM_Container.idl"
#include <CosPersistentState.idl>

// *************** Extended Container Interfaces ***************

module Components
{
  typeprefix Components "omg.org";

  enum BadComponentReferenceReason
  {
    NON_LOCAL_REFERENCE,
    NON_COMPONENT_REFERENCE,
    WRONG_CONTAINER
  };

  typedef CosPersistentState::CatalogBase CatalogBase;
  typedef CosPersistentState::_TypeId _TypeId;

  typedef short SegmentId;
  const SegmentId COMPONENT_SEGMENT = 0;

  typedef short FacetId;
  const FacetId COMPONENT_FACET = 0;

  typedef sequence<octet> IdData;
  typedef CosPersistentState::Pid PersistentId;

  typedef short StateIdType;
  const StateIdType PERSISTENT_ID = 0;

  exception BadComponentReference
  {
    BadComponentReferenceReason reason;
  };
  exception PolicyMismatch {};
  exception PersistenceNotAvailable {};
  exception UnknownActualHome {};
  exception ProxyHomeNotSupported {};
  exception InvalidStateIdData {};

  local interface HomeRegistration
  {
    void register_home (in CCMHome home_ref,
                        in string home_name);

    void unregister_home (in CCMHome home_ref);
  };

  local interface CCM2Context : CCMContext
  {
    HomeRegistration get_home_registration ();

    void req_passivate ()
      raises (PolicyMismatch);

    CatalogBase get_persistence (in _TypeId catalog_type_id)
      raises (PersistenceNotAvailable);
  };

  local interface ProxyHomeRegistration : HomeRegistration
  {
    void register_proxy_home (in CCMHome rhome,
                              in CCMHome ahome)
      raises (UnknownActualHome,
              ProxyHomeNotSupported);
  };

  local interface Session2Context : SessionContext, CCM2Context
  {
    Object create_ref (in CORBA::RepositoryId repid);

    Object create_ref_from_oid (in CORBA::OctetSeq oid,
                                in CORBA::RepositoryId repid);

    CORBA::OctetSeq get_oid_from_ref (in Object objref)
      raises (IllegalState,
              BadComponentReference);
  };

  abstract valuetype StateIdValue
  {
    StateIdType get_sid_type();
    IdData get_sid_data();
  };

  local interface StateIdFactory
  {
    StateIdValue create (in IdData data)
      raises (InvalidStateIdData);
  };

  valuetype PersistentIdValue : StateIdValue
  {
    private PersistentId pid;

    PersistentId get_pid();
    factory init (in PersistentId pid);
  };

  valuetype SegmentDescr
  {
    private StateIdValue sid;
    private SegmentId seg;

    StateIdValue get_sid();
    SegmentId get_seg_id();
    factory init (in StateIdValue sid,
                  in SegmentId seg);
  };

  typedef sequence<SegmentDescr> SegmentDescrSeq;

  local interface ComponentId
  {
    FacetId get_target_facet();

    SegmentId get_target_segment();

    StateIdValue get_target_state_id (in StateIdFactory sid_factory)
      raises (InvalidStateIdData);

    StateIdValue get_segment_state_id (in SegmentId seg,
                                       in StateIdFactory sid_factory)
      raises (InvalidStateIdData);

    ComponentId create_with_new_target (in FacetId new_target_facet,
                                        in SegmentId new_target_segment);

    SegmentDescrSeq get_segment_descrs (in StateIdFactory sid_factory)
      raises (InvalidStateIdData);
  };

  local interface Entity2Context : EntityContext, CCM2Context
  {
    ComponentId get_component_id ()
      raises (IllegalState);

    ComponentId create_component_id (in FacetId target_facet,
                                     in SegmentId target_segment,
                                     in SegmentDescrSeq seq_descrs);

    ComponentId create_monolithic_component_id (in FacetId target_facet,
                                                in StateIdValue sid);

    Object create_ref_from_cid (in CORBA::RepositoryId repid,
                                in ComponentId cid);

    ComponentId get_cid_from_ref (in Object objref)
      raises (BadComponentReference);
  };

  local interface ExecutorLocator : EnterpriseComponent
  {
    Object obtain_executor (in string name)
      raises (CCMException);

    void release_executor (in Object exc)
      raises (CCMException);

    void configuration_complete()
      raises (InvalidConfiguration);
  };
};
#endif /* CCM_CONTAINER_EX_IDL */