activemq-cpp-3.8.2
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_ */
static const int TMENDRSCAN
Flag to end a recovery scan.
Definition: XAResource.h:50
An interface which provides a mapping for the X/Open XID transaction identifier structure.
Definition: Xid.h:37
static const int TMFAIL
Flag to indicate that the caller is dissociation from a transaction branch and that it should be mark...
Definition: XAResource.h:56
The XAResource interface is a CMS mapping of the industry standard XA interface based on the X/Open C...
Definition: XAResource.h:44
static const int TMRESUME
Flag that indicates the caller is resuming association with a suspended transaction branch...
Definition: XAResource.h:78
#define CMS_API
Definition: Config.h:31
static const int TMSUCCESS
Flag that indicates the caller is dissociating from a transaction branch.
Definition: XAResource.h:88
static const int TMONEPHASE
Flag that indicates the caller is using one-phase commit optimization.
Definition: XAResource.h:72
static const int TMNOFLAGS
Flag that indicates that no flags options are selected.
Definition: XAResource.h:67
static const int TMJOIN
Flag to indicate that the caller is joining sn existing transaction branch.
Definition: XAResource.h:62
static const int TMSTARTRSCAN
Flag that indicates the start of a recovery scan.
Definition: XAResource.h:83
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: DestinationResolver.h:23
static const int TMSUSPEND
Flag that indicates that the caller is suspending (not terminating) its association with a transactio...
Definition: XAResource.h:94
static const int XA_RDONLY
Flag that indicates that transaction work has been read only and has been committed normally...
Definition: XAResource.h:100
static const int XA_OK
Flag that indicates that transaction work has been Prepared normally.
Definition: XAResource.h:105