KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > jmx > remote > server > rmi > RemoteJmxProtocol


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 /*
25  * RjmxProtocol.java
26  * Indentation Information:
27  * 0. Please (try to) preserve these settings.
28  * 1. No tabs are used, all spaces.
29  * 2. In vi/vim -
30  * :set tabstop=4 :set shiftwidth=4 :set softtabstop=4
31  * 3. In S1 Studio -
32  * 1. Tools->Options->Editor Settings->Java Editor->Tab Size = 4
33  * 2. Tools->Options->Indentation Engines->Java Indentation Engine->Expand Tabs to Spaces = True.
34  * 3. Tools->Options->Indentation Engines->Java Indentation Engine->Number of Spaces per Tab = 4.
35  * Unit Testing Information:
36  * 0. Is Standard Unit Test Written (y/n):
37  * 1. Unit Test Location: (The instructions should be in the Unit Test Class itself).
38  */

39
40 package com.sun.enterprise.admin.jmx.remote.server.rmi;
41
42 /** An enumerated type for the Remote Jmx protocol.
43  *
44  * @author mailto:Kedar.Mhaswade@Sun.Com
45  * @since Sun Java System Application Server 8
46  */

47 public class RemoteJmxProtocol {
48
49     private final String JavaDoc prtr;
50     /** Field */
51     public static final RemoteJmxProtocol RMIJRMP = new RemoteJmxProtocol("rmi_jrmp");
52     /** Field */
53     public static final RemoteJmxProtocol RMIIIOP = new RemoteJmxProtocol("rmi_iiop");
54     /** Field */
55     public static final RemoteJmxProtocol JMXMP = new RemoteJmxProtocol("jmxmp");
56     /*Implementation note: The fields above are defined per default values in DTD */
57     /** Creates a new instance of RemoteJmxProtocol */
58     private RemoteJmxProtocol(final String JavaDoc prtr) {
59         this.prtr = prtr;
60     }
61
62     public String JavaDoc getName() {
63         return ( this.prtr );
64     }
65
66     public static RemoteJmxProtocol instance(final String JavaDoc prtr) {
67         if (RMIJRMP.getName().equals(prtr))
68             return ( RMIJRMP );
69         else if (RMIIIOP.getName().equals(prtr))
70             return ( RMIIIOP );
71         else if (JMXMP.getName().equals(prtr))
72             return ( JMXMP );
73         else
74             throw new UnsupportedOperationException JavaDoc("Unsupported: " + prtr);
75     }
76 }
Popular Tags