KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > resource > ResourceManager


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 package com.sun.enterprise.resource;
24
25 import javax.transaction.Transaction JavaDoc;
26
27 /**
28  * Interface definition for the Resource Manager. Depending on the
29  * ResourceSpec, PoolManager selects appropriate Resource Manager.
30  *
31  * @author Binod PG
32  */

33 public interface ResourceManager {
34
35     /**
36      * Returns the current Transaction, resource should be dealing with.
37      *
38      * @return An instance of Transaction object.
39      * @exception PoolingException If there is any error in getting the
40      * transaction
41      */

42     public Transaction JavaDoc getTransaction() throws PoolingException;
43
44     /**
45      * Get the component involved in invocation. Returns null , if there is
46      * no component is involved in the current invocation.
47      *
48      * @return object handle
49      * @exception PoolingException If there is any error in getting the component.
50      */

51     public Object JavaDoc getComponent() ;
52     
53     /**
54      * Enlist the Resource handle to the transaction.
55      *
56      * @param h Resource to be enlisted.
57      * @exception PoolingException If there is any error in enlisting.
58      */

59     public void enlistResource(ResourceHandle h) throws PoolingException;
60
61     /**
62      * Register the resource for a transaction's house keeping activities.
63      *
64      * @param h Resource to be registered.
65      * @exception PoolingException If there is any error in registering.
66      */

67     public void registerResource(ResourceHandle handle) throws PoolingException;
68     
69     /**
70      * Set the transaction for rolling back.
71      */

72     public void rollBackTransaction();
73     
74     /**
75      * Delist the resource from the transaction.
76      *
77      * @param h Resource to be delisted.
78      */

79     public void delistResource(ResourceHandle resource, int xaresFlag);
80     
81     /**
82      * Unregister the resource from a transaction's list.
83      *
84      * @param h Resource to be unregistered.
85      */

86     public void unregisterResource(ResourceHandle resource, int xaresFlag);
87 }
88
Popular Tags