KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > embedded > XidFactoryMBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.ejb3.embedded;
23
24 import javax.transaction.xa.Xid JavaDoc;
25 import org.jboss.tm.*;
26
27 /**
28  * Stupid wrapper because tons of services use the XidFactoryMBean interface.
29  *
30  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
31  * @version $Revision: 37459 $
32  */

33 public class XidFactoryMBean implements org.jboss.tm.XidFactoryMBean
34 {
35    private XidFactoryBase base;
36
37    public XidFactoryMBean(XidFactoryBase base)
38    {
39       this.base = base;
40    }
41
42    public org.jboss.tm.XidFactoryMBean getInstance()
43    {
44       return this;
45    }
46
47    public String JavaDoc getName()
48    {
49       throw new RuntimeException JavaDoc("should not be called");
50    }
51
52    public int getState()
53    {
54       throw new RuntimeException JavaDoc("should not be called");
55    }
56
57    public String JavaDoc getStateString()
58    {
59       throw new RuntimeException JavaDoc("should not be called");
60    }
61
62    public void jbossInternalLifecycle(String JavaDoc method) throws Exception JavaDoc
63    {
64       throw new RuntimeException JavaDoc("should not be called");
65    }
66
67    public void create() throws Exception JavaDoc
68    {
69    }
70
71    public void start() throws Exception JavaDoc
72    {
73    }
74
75    public void stop()
76    {
77    }
78
79    public void destroy()
80    {
81    }
82
83    public String JavaDoc getBaseGlobalId()
84    {
85       return base.getBaseGlobalId();
86    }
87
88    public void setBaseGlobalId(String JavaDoc baseGlobalId)
89    {
90       base.setBaseGlobalId(baseGlobalId);
91    }
92
93    public long getGlobalIdNumber()
94    {
95       return base.getGlobalIdNumber();
96    }
97
98    public void setGlobalIdNumber(long globalIdNumber)
99    {
100       base.setGlobalIdNumber(globalIdNumber);
101    }
102
103    public String JavaDoc getBranchQualifier()
104    {
105       return base.getBranchQualifier();
106    }
107
108    public void setBranchQualifier(String JavaDoc branchQualifier)
109    {
110       base.setBranchQualifier(branchQualifier);
111    }
112
113    public boolean isPad()
114    {
115       return base.isPad();
116    }
117
118    public void setPad(boolean pad)
119    {
120       base.setPad(pad);
121    }
122
123    public XidImpl newXid()
124    {
125       return base.newXid();
126    }
127
128    public XidImpl newBranch(GlobalId globalId)
129    {
130       return base.newBranch(globalId);
131    }
132
133    public XidImpl newBranch(XidImpl xid, long branchIdNum)
134    {
135       return base.newBranch(xid, branchIdNum);
136    }
137
138    public XidImpl recreateXid(long localId)
139    {
140       return base.recreateXid(localId);
141    }
142
143    public XidImpl recreateXid(long localId, GlobalId globalId)
144    {
145       return base.recreateXid(localId, globalId);
146    }
147
148    public byte[] localIdToGlobalId(long localId)
149    {
150       return base.localIdToGlobalId(localId);
151    }
152
153    public long extractLocalIdFrom(byte[] globalId)
154    {
155       return base.extractLocalIdFrom(globalId);
156    }
157
158    public String JavaDoc getBaseBranchQualifier(byte[] branchQualifier)
159    {
160       return base.getBaseBranchQualifier(branchQualifier);
161    }
162
163    public String JavaDoc toString(Xid JavaDoc xid)
164    {
165       return base.toString(xid);
166    }
167 }
168
Popular Tags