KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jmx > JoramObjectName


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JoramObjectName.java,v 1.1 2005/06/27 09:21:10 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jmx;
27
28 import javax.management.MalformedObjectNameException JavaDoc;
29 import javax.management.ObjectName JavaDoc;
30
31 /**
32  * A set of static classes used to build the names of proprietary MBeans used in Joram.
33  * @author Adriana Danes
34  */

35 public class JoramObjectName {
36
37     static final String JavaDoc joramDomain = "Joram";
38     static final String JavaDoc joramClientDomain = "joramClient";
39     /**
40      * @return ObjectName for the current JoramAdapter MBean
41      * @exception MalformedObjectNameException Could not create ObjectName with the given String
42      */

43     public static ObjectName JavaDoc joramAdapter() throws MalformedObjectNameException JavaDoc {
44         return ObjectName.getInstance(joramClientDomain + ":type=JoramAdapter,*");
45     }
46
47     /**
48      * @return ObjectName for the JoramPlatform MBean
49      * @exception MalformedObjectNameException Could not create ObjectName with the given String
50      */

51     public static ObjectName JavaDoc joramPlatform() throws MalformedObjectNameException JavaDoc {
52         return ObjectName.getInstance(joramClientDomain + ":type=PlatformAdmin");
53     }
54
55     /**
56      * @return ObjectName for the JoramAdmin MBean
57      * @exception MalformedObjectNameException Could not create ObjectName with the given String
58      */

59     public static ObjectName JavaDoc joramAdmin() throws MalformedObjectNameException JavaDoc {
60         return ObjectName.getInstance(joramClientDomain + ":type=JoramAdmin");
61     }
62
63     /**
64      * Create ObjectName for a Joram managed queue
65      * @param name queue name
66      * @return ObjectName for a Joram managed queue
67      * @exception MalformedObjectNameException Could not create ObjectName with the given String
68      */

69     public static ObjectName JavaDoc joramQueue(String JavaDoc name) throws MalformedObjectNameException JavaDoc {
70         return ObjectName.getInstance(joramClientDomain + ":type=queue,name=" + name);
71     }
72
73     /**
74      * Create ObjectName for all Joram managed queues
75      * @return ObjectName for a Joram managed queue
76      * @exception MalformedObjectNameException Could not create ObjectName with the given String
77      */

78     public static ObjectName JavaDoc joramQueues() throws MalformedObjectNameException JavaDoc {
79         return ObjectName.getInstance(joramClientDomain + ":type=queue,*");
80     }
81
82     /**
83      * Create ObjectName for a Joram managed topic
84      * @param name topic name
85      * @return ObjectName for a Joram managed topic
86      * @exception MalformedObjectNameException Could not create ObjectName with the given String
87      */

88     public static ObjectName JavaDoc joramTopic(String JavaDoc name) throws MalformedObjectNameException JavaDoc {
89         return ObjectName.getInstance(joramClientDomain + ":type=topic,name=" + name);
90     }
91
92     /**
93      * Create ObjectName for all Joram managed topics
94      * @return ObjectName for a Joram managed topic
95      * @exception MalformedObjectNameException Could not create ObjectName with the given String
96      */

97     public static ObjectName JavaDoc joramTopics() throws MalformedObjectNameException JavaDoc {
98         return ObjectName.getInstance(joramClientDomain + ":type=topic,*");
99     }
100
101     /**
102      * Create ObjectName for a Joram managed user
103      * @param name user name
104      * @return ObjectName for a Joram managed user
105      * @exception MalformedObjectNameException Could not create ObjectName with the given String
106      */

107     public static ObjectName JavaDoc joramUser(String JavaDoc name) throws MalformedObjectNameException JavaDoc {
108         return ObjectName.getInstance(joramClientDomain + ":type=User,name=" + name);
109     }
110
111     /**
112      * Create ObjectName for all Joram managed users
113      * @return ObjectName for a Joram managed user
114      * @exception MalformedObjectNameException Could not create ObjectName with the given String
115      */

116     public static ObjectName JavaDoc joramUsers() throws MalformedObjectNameException JavaDoc {
117         return ObjectName.getInstance(joramClientDomain + ":type=User,*");
118     }
119 }
120
Popular Tags