activemq-cpp-3.9.5
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
26namespace 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_ */
The XAResource interface is a CMS mapping of the industry standard XA interface based on the X/Open C...
Definition XAResource.h:44
virtual int recover(int flag, Xid **recovered)=0
Get a list of prepared transaction branches.
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 TMJOIN
Flag to indicate that the caller is joining sn existing transaction branch.
Definition XAResource.h:62
static const int XA_RDONLY
Flag that indicates that transaction work has been read only and has been committed normally.
Definition XAResource.h:100
virtual void rollback(const Xid *xid)=0
Requests the Resource Manager to rollback a specified transaction branch.
static const int TMSUCCESS
Flag that indicates the caller is dissociating from a transaction branch.
Definition XAResource.h:88
virtual int prepare(const Xid *xid)=0
Requests the Resource manager to prepare to commit a specified transaction.
static const int TMENDRSCAN
Flag to end a recovery scan.
Definition XAResource.h:50
static const int TMRESUME
Flag that indicates the caller is resuming association with a suspended transaction branch.
Definition XAResource.h:78
static const int TMNOFLAGS
Flag that indicates that no flags options are selected.
Definition XAResource.h:67
virtual void start(const Xid *xid, int flags)=0
Starts work for a specified transaction branch.
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
virtual int getTransactionTimeout() const =0
Gets the transaction timeout value for this XAResource.
static const int XA_OK
Flag that indicates that transaction work has been Prepared normally.
Definition XAResource.h:105
virtual void end(const Xid *xid, int flags)=0
Ends the work done for a transaction branch.
static const int TMONEPHASE
Flag that indicates the caller is using one-phase commit optimization.
Definition XAResource.h:72
virtual ~XAResource()
virtual bool setTransactionTimeout(int seconds)=0
Sets the transaction timeout value for this XAResource.
virtual bool isSameRM(const XAResource *theXAResource)=0
Returns true if the ResourceManager for this XAResource is the same as the Resource Manager for a sup...
virtual void commit(const Xid *xid, bool onePhase)=0
Commits a global transaction.
virtual void forget(const Xid *xid)=0
Informs the Resource Manager that it can forget about a specified transaction branch.
static const int TMSTARTRSCAN
Flag that indicates the start of a recovery scan.
Definition XAResource.h:83
An interface which provides a mapping for the X/Open XID transaction identifier structure.
Definition Xid.h:37
#define CMS_API
Definition Config.h:31
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition DestinationResolver.h:23