KickJava   Java API By Example, From Geeks To Geeks.

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


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 a collection of J2EEResources,
29  * ordered by type and keyed by name.
30  *
31  * @author Kenneth Saks
32  */

33 public interface J2EEResourceCollection {
34
35     /**
36      * Get all the resources of a given type.
37      * @return Shallow copy of resource set. If there
38      * are no resources of the given type, an
39      * empty set is returned.
40      */

41     Set JavaDoc getResourcesByType(int type);
42
43     /**
44      * Get all the resources.
45      */

46     Set JavaDoc getAllResources();
47
48     /**
49      * Add a resource. This resource will replace any
50      * existing one with the same type and name.
51      */

52     void addResource(J2EEResource resource);
53
54     /**
55      * Remove a resource.
56      * @return true if resource was removed, false if
57      * resource was not found
58      */

59     boolean removeResource(J2EEResource resource);
60
61     /**
62      * Remove all resources of the given type. After
63      * this call getResourcesByType(type) should return
64      * an empty set.
65      */

66     void removeAllResourcesByType(int type);
67
68     /**
69      * Direct-access resource lookup.
70      * @return J2EEResource if resource was found and
71      * null otherwise
72      */

73     J2EEResource getResourceByName(int type, String JavaDoc name);
74
75 }
76
Popular Tags