KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > InvocationManager


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;
24
25 /**
26  * InvocationManager provides interface to keep track of
27  * component context on a per-thread basis
28  *
29  * @author Tony Ng
30  */

31 public interface InvocationManager {
32
33     /**
34      * To be called by a Container to indicate that the Container is
35      * about to invoke a method on a component.
36      * The preInvoke and postInvoke must be called in pairs and well-nested.
37      *
38      * @param inv the Invocation object
39      */

40     public void preInvoke(ComponentInvocation inv) throws InvocationException;
41
42     /**
43      * To be called by a Container to indicate that the Container has
44      * just completed the invocation of a method on a component.
45      * The preInvoke and postInvoke must be called in pairs and well-nested.
46      *
47      * @param inv the Invocation object
48      */

49     public void postInvoke(ComponentInvocation inv) throws InvocationException;
50
51     // BEGIN IASRI# 4646060
52
/**
53      * Returns the current Invocation object associated with the current thread
54      */

55     public ComponentInvocation getCurrentInvocation();
56     // END IASRI# 4646060
57

58     /**
59      * Returns the previous Invocation object associated with the current
60      * thread.
61      * Returns null if there is none. This is typically used when a component A
62      * calls another component B within the same VM. In this case, it might be
63      * necessary to obtain information related to both component A using
64      * getPreviousInvocation() and B using getCurrentInvocation()
65      */

66     public ComponentInvocation getPreviousInvocation()
67         throws InvocationException;
68
69     /**
70      * return true iff no invocations on the stack for this thread
71      */

72     public boolean isInvocationStackEmpty();
73     
74     public java.util.List JavaDoc getAllInvocations();
75 }
76
Popular Tags