KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > InvocationInfo


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

24
25 package com.sun.ejb;
26
27 import java.lang.reflect.Method JavaDoc;
28
29 import com.sun.enterprise.deployment.EjbRemovalInfo;
30 import com.sun.enterprise.security.CachedPermission;
31
32 /**
33  * InvocationInfo caches various attributes of the method that
34  * is currently held in the invocation object (that is currently executed)
35  * This avoids some of the expensive operations like (for example)
36  * method.getName().startsWith("findByPrimaryKey")
37  *
38  * Every container maintains a HashMap of method VS invocationInfo that
39  * is populated during container initialization
40  *
41  * @author Mahesh Kannan
42  */

43
44 public class InvocationInfo {
45
46     public String JavaDoc ejbName;
47     public Method JavaDoc method;
48     public String JavaDoc methodIntf;
49
50
51     public int txAttr;
52     public int securityPermissions;
53     public CachedPermission cachedPermission;
54
55     public boolean isBusinessMethod;
56     public boolean isHomeFinder;
57     public boolean isCreateHomeFinder;
58     public boolean startsWithCreate;
59     public boolean startsWithFind;
60     public boolean startsWithRemove;
61     public boolean startsWithFindByPrimaryKey;
62     
63     // Used by InvocationHandlers to cache bean class methods that
64
// correspond to ejb interface methods.
65
public Method JavaDoc targetMethod1;
66     public Method JavaDoc targetMethod2;
67     public boolean ejbIntfOverride;
68
69     public boolean flushEnabled;
70     public boolean checkpointEnabled;
71
72     public Invocation.InterceptorChain interceptorChain;
73
74     // Only applies to EJB 3.0 SFSBs
75
public EjbRemovalInfo removalInfo;
76
77     public InvocationInfo(Method JavaDoc method) {
78         this.method = method;
79     }
80
81     public String JavaDoc toString() {
82         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
83         sb.append("Invocation Info for ejb " + ejbName + "\t");
84         sb.append("method = " + method + "\t");
85         sb.append("methodIntf = " + methodIntf + "\t");
86         sb.append("tx attr = " + Container.txAttrStrings[txAttr] + "\t");
87         sb.append("Cached permission = " + cachedPermission + "\t");
88         sb.append("target method 1 = " + targetMethod1 + "\t");
89         sb.append("target method 2 = " + targetMethod2 + "\t");
90         sb.append("ejbIntfOverride = " + ejbIntfOverride + "\t");
91         sb.append("flushenabled = " + flushEnabled + "\t");
92         sb.append("checkpointenabled = " + checkpointEnabled + "\t");
93         sb.append("removalInfo = " + removalInfo + "\t");
94         sb.append("\n");
95         return sb.toString();
96     }
97 }
98
Popular Tags