KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > connectors > ConnectorConstants


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 com.sun.enterprise.connectors;
25
26 /**
27  * This interface contains all the constants referenced and used in the
28  * connector module.
29  * As a design principal all the constants needs to be placed here.
30  * This will enable tracking all the constants easily.
31  */

32
33 public interface ConnectorConstants {
34
35     /**
36      * List of system resource adapter names
37      */

38
39     public static final String JavaDoc systemRarNames[] = {
40                "jaxr-ra",
41                "__ds",
42                "__cp",
43                "__xa",
44                "jmsra"
45     };
46
47     /**
48      * JAXR system resource adapter name.
49      */

50
51     public static final String JavaDoc JAXR_RA_NAME = systemRarNames[0];
52
53     /**
54      * JDBC datasource system resource adapter name.
55      */

56
57     public static final String JavaDoc JDBCDATASOURCE_RA_NAME = systemRarNames[1];
58
59     /**
60      * JDBC connectionpool datasource system resource adapter name.
61      */

62
63     public static final String JavaDoc JDBCCONNECTIONPOOLDATASOURCE_RA_NAME =
64                                   systemRarNames[2];
65
66     /**
67      * JDBC XA datasource system resource adapter name.
68      */

69
70     public static final String JavaDoc JDBCXA_RA_NAME = systemRarNames[3];
71
72     /**
73      * Reserver JNDI context under which sub contexts for default resources
74      * and all connector connection pools are created
75      * Subcontext for connector descriptors bounding is also done under
76      * this context.
77      */

78
79     public static String JavaDoc RESERVE_PREFIX = "__SYSTEM";
80     
81     /**
82      * Sub context for binding connector descriptors.
83      */

84
85     public static final String JavaDoc DD_PREFIX= RESERVE_PREFIX+"/descriptors/";
86
87     /**
88      * JMS datasource system resource adapter name.
89      */

90
91     public static final String JavaDoc DEFAULT_JMS_ADAPTER = systemRarNames[4];
92
93     /**
94      * Constant used to determine whether execution environment is appserver
95      * runtime.
96      */

97    
98     public static final int SERVER = 1;
99
100     /**
101      * Constant used to determine whether execution environment is application
102      * client container.
103      */

104
105     public static final int CLIENT = 2;
106
107     /**
108      * Token used for generation of poolname pertaining to sun-ra.xml.
109      * Generated pool name will be
110      * rarName+POOLNAME_APPENDER+connectionDefName+SUN_RA_POOL.
111      * SUNRA connector connections pools are are named and bound after
112      * this name. Pool object will be bound under POOLS_JNDINAME_PREFIX
113      * subcontext. To lookup a pool the jndi name should be
114      * POOLS_JNDINAME_PREFIX/rarName+POOLNAME_APPENDER+connectionDefName
115      * +SUN_RA_POOL
116      */

117
118     public static final String JavaDoc SUN_RA_POOL = "sunRAPool";
119     public static final String JavaDoc ADMINISTERED_OBJECT_FACTORY =
120         "com.sun.enterprise.naming.factory.AdministeredObjectFactory";
121
122     /**
123      * Meta char for mapping the security for connection pools
124      */

125
126     public static String JavaDoc SECURITYMAPMETACHAR="*";
127
128     /**
129      * Token used for default poolname generation. Generated pool name will be
130      * rarName+POOLNAME_APPENDER+connectionDefName.Default connector connections
131      * pools are are named and bound after this name. Pool object will be bound
132      * under POOLS_JNDINAME_PREFIX subcontext. To lookup a pool the jndi name
133      * should be
134      * POOLS_JNDINAME_PREFIX/rarName+POOLNAME_APPENDER+connectionDefName
135      */

136
137     public static String JavaDoc POOLNAME_APPENDER="#";
138
139     /**
140      * Token used for default connector resource generation.Generated connector
141      * resource name and JNDI names will be
142      * RESOURCE_JNDINAME_PREFIX+rarName+RESOURCENAME_APPENDER+connectionDefName
143      * This name should be used to lookup connector resource.
144      */

145
146     public static String JavaDoc RESOURCENAME_APPENDER="#";
147
148     /**
149      * Reserved sub-context where pool objets are bound with generated names.
150      */

151
152     public static String JavaDoc POOLS_JNDINAME_PREFIX=RESERVE_PREFIX+"/pools/";
153
154     /**
155      * Reserved sub-context where connector resource objects are bound with
156      * generated names.
157      */

158
159     public static String JavaDoc RESOURCE_JNDINAME_PREFIX=RESERVE_PREFIX+"/resource/";
160     public static String JavaDoc USERGROUPDISTINGUISHER="#";
161     public static String JavaDoc CAUTION_MESSAGE="Please add the following permissions to the server.policy file and restart the appserver.";
162     
163     /**
164      * Token used for generating the name to refer to the embedded rars.
165      * It will be AppName+EMBEDDEDRAR_NAME_DELIMITER+embeddedRarName.
166      */

167
168     public static String JavaDoc EMBEDDEDRAR_NAME_DELIMITER="#";
169
170     /**
171      * Property name for distinguishing the transaction exceptions
172      * propagation capability.
173      */

174     public final static String JavaDoc THROW_TRANSACTED_EXCEPTIONS_PROP
175         = "resourceadapter.throw.transacted.exceptions";
176  
177     /**
178      * System Property value for distinguishing the transaction exceptions
179      * propagation capability.
180      */

181     static String JavaDoc sysThrowExcp
182         = System.getProperty(THROW_TRANSACTED_EXCEPTIONS_PROP);
183
184     /**
185      * Property value for distinguishing the transaction exceptions
186      * propagation capability.
187      */

188     public static boolean THROW_TRANSACTED_EXCEPTIONS
189         = sysThrowExcp != null && !(sysThrowExcp.trim().equals("true")) ?
190           false : true;
191     
192     public static final int DEFAULT_RESOURCE_ADAPTER_SHUTDOWN_TIMEOUT = 30;
193
194    /**
195      * Property value for defining NoTransaction transaction-support in
196      * a connector-connection-pool
197      */

198     public String JavaDoc NO_TRANSACTION_TX_SUPPORT_STRING = "NoTransaction";
199                                                                                                               
200     /**
201      * Property value for defining LocalTransaction transaction-support in
202      * a connector-connection-pool
203      */

204     public String JavaDoc LOCAL_TRANSACTION_TX_SUPPORT_STRING = "LocalTransaction";
205                                                                                                               
206     /**
207      * Property value for defining XATransaction transaction-support in
208      * a connector-connection-pool
209      */

210     public String JavaDoc XA_TRANSACTION_TX_SUPPORT_STRING = "XATransaction";
211                                                                                                               
212     /**
213      * Property value defining the NoTransaction transaction-support value
214      * as an integer
215      */

216                                                                                                               
217     public int NO_TRANSACTION_INT = 0;
218     /**
219      * Property value defining the LocalTransaction transaction-support value
220      * as an integer
221      */

222                                                                                                               
223     public int LOCAL_TRANSACTION_INT = 1;
224                                                                                                               
225     /**
226      * Property value defining the XATransaction transaction-support value
227      * as an integer
228      */

229     public int XA_TRANSACTION_INT = 2;
230                                                                                                               
231     /**
232      * Property value defining an undefined transaction-support value
233      * as an integer
234      */

235     public int UNDEFINED_TRANSACTION_INT = -1;
236
237     /**
238      * Min pool size for JMS connection pools.
239      */

240     public static int JMS_POOL_MINSIZE = 1;
241
242     /**
243      * Min pool size for JMS connection pools.
244      */

245     public static int JMS_POOL_MAXSIZE = 250;
246     
247     public static enum PoolType { ASSOCIATE_WITH_THREAD_POOL, STANDARD_POOL }
248
249     public static int NON_ACC_CLIENT = 0;
250
251     public static String JavaDoc PM_JNDI_SUFFIX = "__pm";
252
253     public static String JavaDoc NON_TX_JNDI_SUFFIX = "__nontx" ;
254
255     /**
256      * Name of the JNDI environment property that can be provided so that the
257      * <code>ObjectFactory</code> can decide which type of datasource create.
258      */

259     public static String JavaDoc JNDI_SUFFIX_PROPERTY = "com.sun.enterprise.connectors.jndisuffix";
260    
261     /**
262      * Valid values that can be provided to the JNDI property.
263      */

264     public static String JavaDoc[] JNDI_SUFFIX_VALUES = { PM_JNDI_SUFFIX , NON_TX_JNDI_SUFFIX };
265 }
266
Popular Tags