KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > repository > J2EEResource


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.repository;
24
25 import java.util.Set JavaDoc;
26
27 /**
28  * Interface representing J2EE Resource info.
29  *
30  * @author Kenneth Saks
31  */

32 public interface J2EEResource {
33
34     /**
35      * Resource Types
36      */

37     int JMS_DESTINATION = 1;
38     int JMS_CNX_FACTORY = 2;
39     int JDBC_RESOURCE = 3;
40     int JDBC_XA_RESOURCE = 4;
41     int JDBC_DRIVER = 5;
42     int CONNECTOR_RESOURCE = 6;
43     int RESOURCE_ADAPTER = 7;
44
45     // START OF IASRI #4626188
46
int JDBC_CONNECTION_POOL = 8;
47     int PMF_RESOURCE = 9;
48     int EXTERNAL_JNDI_RESOURCE = 10;
49     int CUSTOM_RESOURCE = 11;
50     // START OF IASRI #4650786
51
int MAIL_RESOURCE = 12;
52     // END OF IASRI #4650786
53
// END OF IASRI #4626188
54

55     /**
56      * Resource name. Immutable.
57      */

58     String JavaDoc getName();
59
60     /**
61      * Resource type. Defined above. Immutable.
62      */

63     int getType();
64
65     /**
66      * Set containing elements of type ResourceProperty.
67      * Actual property names are resource type specific.
68      * @return Shallow copy of resource property set. If
69      * resource has 0 properties, empty set is
70      * returned.
71      */

72     Set JavaDoc getProperties();
73
74     /**
75      * Add a property. Underlying set is keyed by
76      * property name. The new property overrides any
77      * existing property with same name.
78      */

79     void addProperty(ResourceProperty property);
80
81     /**
82      * Remove a property. Underlying set is keyed by
83      * property name.
84      * @return true if property was removed, false if
85      * property was not found
86      */

87     boolean removeProperty(ResourceProperty property);
88
89      /**
90      * Get a property with the given name.
91      * @return ResourceProperty or null if not found.
92      */

93     ResourceProperty getProperty(String JavaDoc propertyName);
94     
95     /**
96      * Create a new resource with the given name
97      * that has the same attribute and property
98      * settings as the invoked object.
99      */

100     J2EEResource makeClone(String JavaDoc name);
101     
102     // START OF IASRI #4626188
103
void setEnabled(boolean value);
104     boolean isEnabled();
105     void setDescription(String JavaDoc value);
106     String JavaDoc getDescription();
107     // END OF IASRI #4626188
108
}
109
Popular Tags