KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > plugins > transaction > controller > WithControlController


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2001-2002 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Romain Rouvoy.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.plugins.transaction.controller;
28
29 /**
30  * This class implements an transactionnal profile for the
31  * OpenCCM::Containers::CallController interface.
32  *
33  * @author <a HREF="mailto:Romain.Rouvoy@lifl.fr">Romain Rouvoy</a>
34  *
35  * @version 0.3
36  */

37 public abstract class WithControlController
38         extends WithCurrentController
39 {
40     // ==================================================================
41
//
42
// Internal state.
43
//
44
// ==================================================================
45

46     /**
47      * Reference to the current transaction
48      *
49      */

50     protected org.omg.CosTransactions.Control control_;
51
52     
53     // ==================================================================
54
//
55
// Constructor.
56
//
57
// ==================================================================
58

59     /**
60      ** The constructor.
61      **
62      **/

63     public
64     WithControlController()
65     {
66                 control_ = null;
67         }
68
69
70     // ==================================================================
71
//
72
// Internal methods.
73
//
74
// ==================================================================
75

76         /**
77          ** Suspend the current transaction
78          **
79          ** @param ctx the operation call context
80          **/

81         protected void
82         suspend(org.objectweb.openccm.Containers.CallContext ctx)
83         {
84                 control_ = current_.suspend();
85         }
86
87         /**
88          ** Resume the suspended trnasaction
89          **
90          ** @param ctx the operation call context
91          **/

92         protected void
93         resume(org.objectweb.openccm.Containers.CallContext ctx)
94         {
95                 if (control_ != null)
96                         {
97                                 try
98                                         {
99                                                 current_.resume(control_);
100                                         } catch (org.omg.CosTransactions.InvalidControl ex) {
101                                         }
102                                 control_ = null;
103                         }
104         }
105         
106     // ==================================================================
107
//
108
// Public methods for the CallController interface.
109
//
110
// ==================================================================
111

112     // ==================================================================
113
//
114
// Public methods for the CallProtocol interface.
115
//
116
// ==================================================================
117

118     //
119
// IDL:goal.lifl.fr/OpenCCM/Containers/CallProtocol/preinvoke:1.0
120
//
121
/**
122      **
123      **/

124     public abstract void
125         preinvoke(org.objectweb.openccm.Containers.CallContext ctx);
126         
127     //
128
// IDL:goal.lifl.fr/OpenCCM/Containers/CallProtocol/postinvoke:1.0
129
//
130
/**
131      **
132      **/

133     public abstract void
134         postinvoke(org.objectweb.openccm.Containers.CallContext ctx);
135
136     // ==================================================================
137
//
138
// Public methods for the SystemComponent interface.
139
//
140
// ==================================================================
141

142     // ==================================================================
143
//
144
// Public methods for the Configuration interface.
145
//
146
// ==================================================================
147

148     //
149
// IDL:goal.lifl.fr/OpenCCM/Containers/Configuration/configure:1.0
150
//
151
/**
152      **
153      **/

154     public abstract void
155       configure(org.objectweb.openccm.Containers.PropertySet config)
156                 throws org.objectweb.openccm.Containers.ConfigurationFailed;
157 }
158
Popular Tags