KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > transaction > MockJtaTransaction


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.transaction;
18
19 import javax.transaction.Status JavaDoc;
20 import javax.transaction.Synchronization JavaDoc;
21 import javax.transaction.xa.XAResource JavaDoc;
22
23 /**
24  * @author Juergen Hoeller
25  * @since 31.08.2004
26  */

27 public class MockJtaTransaction implements javax.transaction.Transaction JavaDoc {
28
29     private Synchronization JavaDoc synchronization;
30
31     public int getStatus() {
32         return Status.STATUS_ACTIVE;
33     }
34
35     public void registerSynchronization(Synchronization JavaDoc synchronization) {
36         this.synchronization = synchronization;
37     }
38
39     public Synchronization JavaDoc getSynchronization() {
40         return synchronization;
41     }
42
43     public boolean enlistResource(XAResource JavaDoc xaResource) {
44         return false;
45     }
46
47     public boolean delistResource(XAResource JavaDoc xaResource, int i) {
48         return false;
49     }
50
51     public void commit() {
52     }
53
54     public void rollback() {
55     }
56
57     public void setRollbackOnly() {
58     }
59
60 }
61
Popular Tags