Source Code Cross Referenced for JTAResource.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » jtm » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas.jtm 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 1999 Bull S.A.
004:         * Contact: jonas-team@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id: JTAResource.java 6487 2005-03-30 17:20:15Z tonyortiz $
023:         * --------------------------------------------------------------------------
024:         */package org.objectweb.jonas.jtm;
025:
026:        // JOnAS imports
027:        import org.objectweb.jonas.management.j2eemanagement.J2EEResource;
028:        import org.objectweb.jonas.management.ReconfiguredProp;
029:
030:        import javax.transaction.xa.Xid;
031:
032:        /**
033:         * MBean class for JTAResource Management
034:         * @author Eric Hardesty JSR 77 (J2EE Management Standard)
035:         */
036:        public class JTAResource extends J2EEResource {
037:
038:            /**
039:             * Service name as used to label configuration properties
040:             */
041:            public static final String SERVICE_NAME = "jtm";
042:
043:            // Transaction Service configuration properties
044:            /**
045:             * name of the 'timeout' configuration parameter
046:             */
047:            static final String TIMEOUT = "jonas.service.jtm.timeout";
048:
049:            /**
050:             * Value used as sequence number by reconfiguration notifications
051:             */
052:            private long sequenceNumber = 0;
053:
054:            /**
055:             * Transactions time-out
056:             */
057:            private Integer timeOut;
058:
059:            /**
060:             * JTM port number
061:             */
062:            private Integer portNumber;
063:
064:            /**
065:             * JTM host name
066:             */
067:            private String hostName;
068:
069:            /**
070:             * true if JTM is local, false if remote
071:             */
072:            private Boolean localJtm;
073:
074:            /**
075:             * Managed JTM
076:             */
077:            private TransactionServiceImpl jtm;
078:
079:            /**
080:             * JTA Resource constructor
081:             * @param objectName String conformant to a JTAResource OBJECT_NAME in JSR77
082:             * @param jtm Managed JTM
083:             * @param timeOut transactions time-out
084:             * @param localJtm true if JTM is local, false if remote
085:             * @param portNumber JTM port number
086:             * @param hostName JTM host name
087:             */
088:            public JTAResource(String objectName, TransactionServiceImpl jtm,
089:                    Integer timeOut, Boolean localJtm, Integer portNumber,
090:                    String hostName) {
091:                super (objectName);
092:                this .jtm = jtm;
093:                this .timeOut = timeOut;
094:                this .localJtm = localJtm;
095:                this .portNumber = portNumber;
096:                this .hostName = hostName;
097:            }
098:
099:            /**
100:             * @return Returns the timeOut.
101:             */
102:            public Integer getTimeOut() {
103:                return timeOut;
104:            }
105:
106:            /**
107:             * @param timeOut The timeOut to set.
108:             */
109:            public void setTimeOut(Integer timeOut) {
110:                this .timeOut = timeOut;
111:                jtm.setTimeout(timeOut.intValue());
112:                // Send a notification containing the new value of this property to the
113:                // listner MBean
114:                sendReconfigNotification(++sequenceNumber, SERVICE_NAME,
115:                        new ReconfiguredProp(TIMEOUT, timeOut.toString()));
116:            }
117:
118:            /**
119:             * @return true if JTM is local, false if remote
120:             */
121:            public Boolean isLocalJtm() {
122:                return localJtm;
123:            }
124:
125:            /**
126:             * @return JTM port number
127:             */
128:            public Integer getPortNumber() {
129:                return portNumber;
130:            }
131:
132:            /**
133:             * @return JTM host name
134:             */
135:            public String getHostName() {
136:                return hostName;
137:            }
138:
139:            /**
140:             * Save updated configuration
141:             */
142:            public void saveConfig() {
143:                sendSaveNotification(++sequenceNumber, SERVICE_NAME);
144:            }
145:
146:            /**
147:             * @return Returns the totalBegunTransactions.
148:             */
149:            public Integer getTotalBegunTransactions() {
150:                return new Integer(jtm.getTotalBegunTransactions());
151:            }
152:
153:            /**
154:             * @return Returns the totalCommittedTransactions.
155:             */
156:            public Integer getTotalCommittedTransactions() {
157:                return new Integer(jtm.getTotalCommittedTransactions());
158:            }
159:
160:            /**
161:             * @return Returns the totalCurrentTransactions.
162:             */
163:            public Integer getTotalCurrentTransactions() {
164:                return new Integer(jtm.getTotalCurrentTransactions());
165:            }
166:
167:            /**
168:             * @return Returns the totalExpiredTransactions.
169:             */
170:            public Integer getTotalExpiredTransactions() {
171:                return new Integer(jtm.getTotalExpiredTransactions());
172:            }
173:
174:            /**
175:             * @return Returns the totalRolledbackTransactions.
176:             */
177:            public Integer getTotalRolledbackTransactions() {
178:                return new Integer(jtm.getTotalRolledbackTransactions());
179:            }
180:
181:            /**
182:             * Reset all transaction counters
183:             */
184:            public void resetAllCounters() {
185:                jtm.resetAllTxTotalCounters();
186:            }
187:
188:            /**
189:             * @return Returns all active Xids.
190:             */
191:            public Xid[] getAllActiveXids() {
192:                return jtm.getAllActiveXids();
193:            }
194:
195:            /**
196:             * @return Returns all active Transactions.
197:             */
198:            public String[] getAllActiveTx() {
199:                String[] mysArray;
200:
201:                mysArray = jtm.getAllActiveTx();
202:                return mysArray;
203:            }
204:
205:            /**
206:             * @return Returns all Transactions that require administrator recovery action.
207:             */
208:            public String[] getAllRecoveryTx() {
209:                String[] mysArray;
210:
211:                mysArray = jtm.getAllRecoveryTx();
212:                return mysArray;
213:            }
214:
215:            /**
216:             * @return Returns all XAResources that require administrator recovery action.
217:             */
218:            public String[] getAllXAResource(String xatx) {
219:                String[] mysArray;
220:                mysArray = jtm.getAllXAResource(xatx);
221:                return mysArray;
222:            }
223:
224:            /**
225:             * @return Returns all XAResources that require administrator recovery action.
226:             */
227:            public int commitXAResource(String xatx) {
228:                int commiterror;
229:                commiterror = jtm.commitXAResource(xatx);
230:                return commiterror;
231:            }
232:
233:            /**
234:             * @return Returns all XAResources that require administrator recovery action.
235:             */
236:            public int rollbackXAResource(String xatx) {
237:                int rollbackerror;
238:                rollbackerror = jtm.rollbackXAResource(xatx);
239:                return rollbackerror;
240:            }
241:
242:            /**
243:             * @return Returns all XAResources that require administrator recovery action.
244:             */
245:            public int forgetXAResource(String xatx) {
246:                int forgeterror;
247:                forgeterror = jtm.forgetXAResource(xatx);
248:                return forgeterror;
249:            }
250:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.