KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > transaction > context > TransactionContext


1 /**
2  *
3  * Copyright 2003-2004 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * 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 package org.apache.geronimo.transaction.context;
19
20 import javax.transaction.HeuristicMixedException JavaDoc;
21 import javax.transaction.HeuristicRollbackException JavaDoc;
22 import javax.transaction.InvalidTransactionException JavaDoc;
23 import javax.transaction.RollbackException JavaDoc;
24 import javax.transaction.Synchronization JavaDoc;
25 import javax.transaction.SystemException JavaDoc;
26 import javax.transaction.xa.XAResource JavaDoc;
27
28 import org.apache.geronimo.transaction.ConnectionReleaser;
29 import org.apache.geronimo.transaction.InstanceContext;
30 import org.tranql.cache.InTxCache;
31
32
33 /**
34  * @version $Rev: 155839 $ $Date: 2005-03-01 15:30:08 -0800 (Tue, 01 Mar 2005) $
35  */

36 public interface TransactionContext {
37     boolean isInheritable();
38
39     boolean isActive();
40
41     boolean enlistResource(XAResource JavaDoc xaResource) throws RollbackException JavaDoc, SystemException JavaDoc;
42
43     boolean delistResource(XAResource JavaDoc xaResource, int flag) throws SystemException JavaDoc;
44
45     void registerSynchronization(Synchronization JavaDoc synchronization) throws RollbackException JavaDoc, SystemException JavaDoc;
46
47     boolean getRollbackOnly() throws SystemException JavaDoc;
48
49     void setRollbackOnly() throws SystemException JavaDoc;
50
51     void suspend() throws SystemException JavaDoc;
52
53     void resume() throws SystemException JavaDoc, InvalidTransactionException JavaDoc;
54
55     boolean commit() throws HeuristicMixedException JavaDoc, HeuristicRollbackException JavaDoc, RollbackException JavaDoc, SystemException JavaDoc;
56
57     void rollback() throws SystemException JavaDoc;
58
59     void associate(InstanceContext context) throws Throwable JavaDoc;
60
61     void unassociate(InstanceContext context) throws Throwable JavaDoc;
62
63     void unassociate(Object JavaDoc containerId, Object JavaDoc id) throws Throwable JavaDoc;
64
65     InstanceContext getContext(Object JavaDoc containerId, Object JavaDoc id);
66
67     InstanceContext beginInvocation(InstanceContext context) throws Throwable JavaDoc;
68
69     void endInvocation(InstanceContext caller);
70
71     void flushState() throws Throwable JavaDoc;
72
73     void setInTxCache(InTxCache inTxCache);
74
75     InTxCache getInTxCache();
76
77     void setManagedConnectionInfo(ConnectionReleaser key, Object JavaDoc info);
78
79     Object JavaDoc getManagedConnectionInfo(ConnectionReleaser key);
80 }
Popular Tags