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

//#define CIAO_HAS_IMPORT_KEYWORD

#if !defined (CCM_CONTAINER_IDL)
#define CCM_CONTAINER_IDL

#include "CCM_Component.idl"
#include "orbsvcs/orbsvcs/SecurityLevel2.idl"
#include "CCM_Transaction.idl"

// *************** Basic Container interfaces ***************

module Components
{
  typeprefix Components "omg.org";

  typedef SecurityLevel2::Credentials Principal;

  local interface CCMContext
  {
    Principal get_caller_principal();

    CCMHome get_CCM_home();

    boolean get_rollback_only()
      raises (IllegalState);

    Transaction::UserTransaction get_user_transaction()
      raises (IllegalState);

    boolean is_caller_in_role (in string role);

    void set_rollback_only()
      raises (IllegalState);
  };

  enum CCMExceptionReason
  {
    SYSTEM_ERROR,
    CREATE_ERROR,
    REMOVE_ERROR,
    DUPLICATE_KEY,
    FIND_ERROR,
    OBJECT_NOT_FOUND,
    NO_SUCH_ENTITY
  };

  exception CCMException
  {
    CCMExceptionReason reason;
  };

  local interface EnterpriseComponent {};

  local interface SessionContext : CCMContext
  {
    Object get_CCM_object()
      raises (IllegalState);
  };

  local interface SessionComponent : EnterpriseComponent
  {
    void set_session_context ( in SessionContext ctx)
      raises (CCMException);

    void ccm_activate()
      raises (CCMException);

    void ccm_passivate()
      raises (CCMException);

    /// The following two methods are CIAO specific extension.
    /**
     * This method is invoked before ccm_activate () is called. All
     * components in the assembly get this callback before the
     * ccm_activate () is called.
     */
    void ciao_preactivate ()
      raises (CCMException);

    /**
     * This method is invoked after ccm_activate () is called. All
     * components in the assembly get this callback after the
     * ccm_activate () is called.
     */
    void ciao_postactivate ()
      raises (CCMException);

    void ccm_remove ()
      raises (CCMException);
  };

  local interface SessionSynchronization
  {
    void after_begin ()
      raises (CCMException);

    void before_completion ()
      raises (CCMException);

    void after_completion (in boolean committed)
      raises (CCMException);
  };

  local interface EntityContext : CCMContext
  {
    Object get_CCM_object ()
      raises (IllegalState);

    PrimaryKeyBase get_primary_key ()
      raises (IllegalState);
  };

  local interface EntityComponent : EnterpriseComponent
  {
    void set_entity_context (in EntityContext ctx)
      raises (CCMException);

    void unset_entity_context ()
      raises (CCMException);

    void ccm_activate ()
      raises (CCMException);

    void ccm_load ()
      raises (CCMException);

    void ccm_store ()
      raises (CCMException);

    void ccm_passivate ()
      raises (CCMException);

    void ccm_remove ()
      raises (CCMException);
  };


  local interface HomeExecutorBase
  {
  };
};
#endif /* CCM_CONTAINER_IDL */