KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > base > Container


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.appserv.management.base;
24
25 import java.util.Set JavaDoc;
26 import java.util.Map JavaDoc;
27
28 /**
29     All MBeans which <i>logically contain</i> other MBeans implement this interface;
30     such an MBean is considered a Container, and the contained MBean is considered
31     a Containee. The interface indicates the <i>potential</i> to contain other
32     MBeans; at any given time MBeans may or may not be contained.
33  */

34 public interface Container extends AMX
35 {
36     /**
37         Attribute returned by getContaineeJ2EETypes().
38      */

39     public static final String JavaDoc ATTR_CONTAINEE_J2EE_TYPES = "ContaineeJ2EETypes";
40     
41     /**
42         @return Set of String of all <i>possible</i> j2eeTypes contained within this item
43         @see com.sun.appserv.management.base.Util#getNamesSet
44      */

45     public Set JavaDoc<String JavaDoc> getContaineeJ2EETypes();
46     
47     /**
48         Return a Map keyed by j2eeType. The <i>value</i> corresponding to each
49         key (j2eeType) is another Map, as returned from {@link #getContaineeMap}.
50         <p>
51         If the passed Set is null, then all types are obtained. Pass
52         the set returned from {@link #getContaineeJ2EETypes} to get all currently
53         present containees.
54         
55         @param j2eeTypes the j2eeTypes to look for, or null for all
56         @return Map (possibly empty) of <i>j2eeType</i>=&lt;Map of <i>name</i>=<i>AMX</i>&gt;
57      */

58     public <T extends AMX> Map JavaDoc<String JavaDoc,Map JavaDoc<String JavaDoc,T>> getMultiContaineeMap( final Set JavaDoc<String JavaDoc> j2eeTypes );
59     
60     /**
61         Each key in the resulting Map is a String which is the value of the
62         AMX.NAME_KEY for that {@link AMX}, which is the value.
63         
64         @param j2eeType the j2eeType to look for
65         @return Map <i>name</i>=<i>AMX</i>
66      */

67     public <T extends AMX> Map JavaDoc<String JavaDoc,T> getContaineeMap( final String JavaDoc j2eeType );
68     
69     /**
70         Obtain the singleton MBean having the specified type.
71         
72         @param j2eeType
73         @return {@link AMX} of specified j2eeType or null if not present
74         @throws IllegalArgumentException if there is more than one item of this type
75         @see Util#getNamesSet
76      */

77     public <T extends AMX> T getContainee( final String JavaDoc j2eeType );
78     
79     /**
80         @return all containees having the specified j2eeType.
81         @see Util#getNamesSet
82      */

83     public <T extends AMX> Set JavaDoc<T> getContaineeSet( final String JavaDoc j2eeType );
84     
85     /**
86         Same as getContaineeSet( getContaineeJ2EETypes() )
87         @return all containees of any j2eeType
88         @see Util#getNamesSet
89         @see #getContaineeSet(java.util.Set)
90      */

91     public <T extends AMX> Set JavaDoc<T> getContaineeSet( );
92     
93     /**
94         @return all containees having the specified j2eeType(s).
95         @see Util#getNamesSet
96         @see #getMultiContaineeMap
97      */

98     public <T extends AMX> Set JavaDoc<T> getContaineeSet( final Set JavaDoc<String JavaDoc> j2eeTypes );
99     
100     
101     /**
102         @return all containees having one of the specified types
103         and the specified name.
104         @see com.sun.appserv.management.base.Util#getNamesSet
105      */

106     public <T extends AMX> Set JavaDoc<T> getByNameContaineeSet(
107                                     final Set JavaDoc<String JavaDoc> j2eeTypes, final String JavaDoc name );
108     
109     /**
110         Get a singleton containee having the specified j2eeType and name.
111         @param j2eeType the j2eeType of the contained
112         @param name the name of the contained (as found in "name" property)
113         @return AMX or null if not found
114         @see Util#getNamesSet
115     */

116     public <T extends AMX> T getContainee( final String JavaDoc j2eeType, final String JavaDoc name );
117 }
118
119
120
121
Popular Tags