activemq-cpp-3.6.0
XAResource.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _CMS_XARESOURCE_H_
19 #define _CMS_XARESOURCE_H_
20 
21 #include <cms/Config.h>
22 
23 #include <cms/Xid.h>
24 #include <cms/XAException.h>
25 
26 namespace cms {
27 
45  public:
46 
50  static const int TMENDRSCAN;
51 
56  static const int TMFAIL;
57 
62  static const int TMJOIN;
63 
67  static const int TMNOFLAGS;
68 
72  static const int TMONEPHASE;
73 
78  static const int TMRESUME;
79 
83  static const int TMSTARTRSCAN;
84 
88  static const int TMSUCCESS;
89 
94  static const int TMSUSPEND;
95 
100  static const int XA_RDONLY;
101 
105  static const int XA_OK;
106 
107  public:
108 
109  virtual ~XAResource();
110 
132  virtual void commit(const Xid* xid, bool onePhase) = 0;
133 
164  virtual void end(const Xid* xid, int flags) = 0;
165 
178  virtual void forget(const Xid* xid) = 0;
179 
190  virtual int getTransactionTimeout() const = 0;
191 
204  virtual bool isSameRM(const XAResource* theXAResource) = 0;
205 
224  virtual int prepare(const Xid* xid) = 0;
225 
245  virtual int recover(int flag, Xid** recovered) = 0;
246 
256  virtual void rollback(const Xid* xid) = 0;
257 
272  virtual bool setTransactionTimeout(int seconds) = 0;
273 
299  virtual void start(const Xid* xid, int flags) = 0;
300 
301  };
302 
303 }
304 
305 #endif /* _CMS_XARESOURCE_H_ */