KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > stats > JTAStats


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28
29 /*
30  * JTAStats.java
31  *
32  * Created on August 14, 2003, 12:53 PM
33  */

34
35 package com.sun.enterprise.admin.monitor.stats;
36
37 import com.sun.enterprise.admin.monitor.stats.StringStatistic;
38 import java.util.List JavaDoc;
39 import java.util.Map JavaDoc;
40
41 /** Defines additional Sun ONE Application Server specific statistic to transaction service.
42  * @author <a HREF="mailto:Kedar.Mhaswade@sun.com">Kedar Mhaswade</a>
43  * @since S1AS8.0
44  * @version $Revision: 1.3 $
45  */

46 public interface JTAStats extends javax.management.j2ee.statistics.JTAStats JavaDoc {
47
48     /** Returns the IDs of the transactions that are currently active, as a StrignStatistic.
49      * An active transaction is same as an in-flight transaction. Every such transaction can be rolled back after
50      * freezing the transaction service.
51      * @see javax.management.j2ee.statistics.JTAStats#getActiveCount
52      * @return a comma separated String of IDs
53      */

54     public StringStatistic getActiveIds();
55     
56     /** Returns the current state of the transaction service as a StringStatistic.
57      *
58      * @return String representing the current state of the transaction service.
59      */

60     public StringStatistic getState();
61     
62     /** Freezes the transaction subsystem. This operation is advised before
63      * an attempt is made to rollback any transactions to avoid the possibility of
64          * transaction completion before the rollback request is issued. The transaction subsystem
65      * is expected be active before it can be frozen. Calling this methd on
66      * an already frozen transaction subsystem has no effect.
67      */

68     public void freeze();
69     
70     /** Unfreezes the transaction subsystem. It is required to unfreeze the
71      * transaction subsystem after it is frozen earlier.
72      * Calling this method when system is not active, has no effect.
73      */

74     public void unfreeze();
75     
76     /**
77      * Rolls back a given transaction. It is advisable to call this method
78          * when the transaction subsystem is in a frozen state so that transactions
79          * won't be completed before this request. It is left to implementation how
80      * the transactions are rolled back.
81      * @param String representing the unique id of the transaction that
82      * needs to be rolled-back. Every transaction that can be rolled back
83      * has to be an in flight transaction.
84          * @return String contains the status of the rollback operation for the given txnId.
85          * status contains "Rollback successful",
86          * "Rollback unsuccessful. Current Thread is not associated with the transaction",
87          * "Rollback unsuccessful. Thread is not allowed to rollback the transaction",
88          * "Rollback unsuccessful. Unexpected error condition encountered by Transaction Manager".
89      */

90     public String JavaDoc rollback(String JavaDoc txnId);
91     
92     
93     /**
94      * Rolls back the given transactions. It is advisable to call this method
95          * when the transaction subsystem is in a frozen state so that transactions
96          * won't be completed before this request. It is left to implementation how
97      * the transactions are rolled back.
98      * @param String array representing the unique ids of the transactions that
99      * need to be frozen. Every transaction that can be rolled back has to be an
100      * in flight transaction.
101      * @return String[] containing the status for the given transaction ids.
102          * status contains "Successful","Invalid transaction Id or Transaction is over",
103          * "Rollback unsuccessful. Current Thread is not associated with the transaction",
104          * "Rollback unsuccessful. Unexpected error condition encountered by Transaction Manager".
105     
106     public String[] rollback(String[] txnIds);
107      */

108
109         // To be used for GUI ...
110
public List JavaDoc<Map JavaDoc<String JavaDoc, String JavaDoc>> listActiveTransactions();
111 }
112
113
Popular Tags