KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jts > CosTransactions > StaticResource


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
//
31
// Module: StaticResource.java
32
//
33
// Description: Statically-registered Resource interface.
34
//
35
// Product: com.sun.jts.CosTransactions
36
//
37
// Author: Simon Holdsworth
38
//
39
// Date: March, 1997
40
//
41
// Copyright (c): 1995-1997 IBM Corp.
42
//
43
// The source code for this program is not published or otherwise divested
44
// of its trade secrets, irrespective of what has been deposited with the
45
// U.S. Copyright Office.
46
//
47
// This software contains confidential and proprietary information of
48
// IBM Corp.
49
//----------------------------------------------------------------------------
50

51 package com.sun.jts.CosTransactions;
52
53 import org.omg.CosTransactions.*;
54
55 /**
56  * The StaticResource interface provides operations that allow an object to
57  * be informed about changes in transaction associations with threads. The
58  * operations are guaranteed to be invoked on the thread on which the
59  * association is started or ended. This class is an abstract base class so
60  * the behavior here is that which is expected from any subclass.
61  *
62  * @version 0.01
63  *
64  * @author Simon Holdsworth, IBM Corporation
65  *
66  * @see
67  */

68
69 //----------------------------------------------------------------------------
70
// CHANGE HISTORY
71
//
72
// Version By Change Description
73
// 0.01 SAJH Initial implementation.
74
//----------------------------------------------------------------------------
75

76 public abstract class StaticResource {
77
78     /**
79      * Informs the object that an association has started.
80      * <p>
81      * That is, a thread association has begun on the calling thread for the
82      * transaction represented by the given Coordinator object.
83      * A flag is passed indicating whether this association is
84      * as a result of a begin operation.
85      *
86      * @param coord The transaction whose association is starting.
87      * @param begin Indicates a begin rather than a resume.
88      *
89      * @return
90      *
91      * @see
92      */

93     public abstract void startAssociation(Coordinator coord, boolean begin);
94
95     /**
96      * Informs the object that an association has ended.
97      * <p>
98      * That is, a thread association has ended on the calling thread for the
99      * transaction represented by the given Coordinator object.
100      * A flag is passed indicating whether this
101      * association is as a result of the transaction completing.
102      *
103      * @param coord The transaction whose association is starting.
104      * @param complete Indicates a commit/rollback rather than a suspend.
105      *
106      * @return
107      *
108      * @see
109      */

110     public abstract void endAssociation(Coordinator coord, boolean complete);
111
112     /**
113      * Registers the StaticResource object.
114      * <p>
115      * Until this method is called, the StaticResource object will not receive
116      * calls to start/endAssociation.
117      *
118      * @param
119      *
120      * @return
121      *
122      * @see
123      */

124     protected void register() {
125         CurrentTransaction.registerStatic(this);
126     }
127 }
128
Popular Tags