KickJava   Java API By Example, From Geeks To Geeks.

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


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.Map JavaDoc;
26
27 import java.io.Serializable JavaDoc;
28
29
30
31 /**
32     Interface which states that the object can be converted into a Map.
33     Type parameter <T> must be Object or Serializable.
34  */

35 public interface MapCapable
36 {
37     /**
38         To be capable of being serialized and deserialized by generic clients, the following
39         rules must be observed for the resulting Map.
40         <p>
41         The Map itself and any items it references, directly or indirectly must be of a class
42         of one of the following:
43         <ul>
44         <li>any JMX OpenType</li>
45         <li>any serializable Collection in java.util whose items meet these rules</li>
46         <li>arrays of items whose values meet these rules</li>
47         <li>any Throwable found in java. or javax. </li>
48         <li>any MapCapable which can produce a Map following these rules</li>
49         </ul>
50         @return an equivalent Map representing the original object.
51      */

52     public Map JavaDoc<String JavaDoc,Serializable JavaDoc> asMap();
53     
54     /**
55         Return the interface that this Map represents
56         (the Java classname).
57      */

58     public String JavaDoc getMapClassName();
59     
60     /**
61         The key for the type of Object this Map represents;
62         all MapCapable objects will place their classname keyed by this key
63         as a String into the Map returned from asMap().
64      */

65     public static final String JavaDoc MAP_CAPABLE_CLASS_NAME_KEY = "MapCapableClassName";
66 }
67
68
69
70
71
72
73
74
75
Popular Tags