KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > resource > spi > BootstrapContext


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 package javax.resource.spi;
25
26 import java.util.Timer JavaDoc;
27 import javax.resource.spi.work.WorkManager JavaDoc;
28
29 /**
30  * This provides a mechanism to pass a bootstrap context to a resource adapter
31  * instance when it is bootstrapped. That is, when
32  * (<code>start(BootstrapContext)</code>) method on the
33  * <code>ResourceAdapter</code> class is invoked. The bootstrap
34  * context contains references to useful facilities that could be used by the
35  * resource adapter instance.
36  *
37  * @version 1.0
38  * @author Ram Jeyaraman
39  */

40 public interface BootstrapContext {
41     /**
42      * Provides a handle to a <code>WorkManager</code> instance. The
43      * <code>WorkManager</code> instance could be used by a resource adapter to
44      * do its work by submitting <code>Work</code> instances for execution.
45      *
46      * @return a <code>WorkManager</code> instance.
47      */

48     WorkManager JavaDoc getWorkManager();
49
50     /**
51      * Provides a handle to a <code>XATerminator</code> instance. The
52      * <code>XATerminator</code> instance could be used by a resource adapter
53      * to flow-in transaction completion and crash recovery calls from an EIS.
54      *
55      * @return a <code>XATerminator</code> instance.
56      */

57     XATerminator JavaDoc getXATerminator();
58
59     /**
60      * Creates a new <code>java.util.Timer</code> instance. The
61      * <code>Timer</code> instance could be used to perform periodic
62      * <code>Work</code> executions or other tasks.
63      *
64      * @throws UnavailableException indicates that a
65      * <code>Timer</code> instance is not available. The
66      * request may be retried later.
67      *
68      * @return a new <code>Timer</code> instance.
69      */

70     Timer JavaDoc createTimer() throws UnavailableException JavaDoc;
71 }
72
Popular Tags