org.objectweb.jonas.jmx.oname.JoramObjectName Maven / Gradle / Ivy
/**
* JOnAS: Java(TM) Open Application Server
* Copyright (C) 2005-2007 Bull S.A.S.
* Contact: [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* --------------------------------------------------------------------------
* $Id: JoramObjectName.java 10737 2007-06-25 15:52:25Z danesa $
* --------------------------------------------------------------------------
*/
package org.objectweb.jonas.jmx.oname;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
/**
* A set of static classes used to build the names of proprietary MBeans used in Joram.
* @author Adriana Danes
*/
public class JoramObjectName {
/**
* JORAM MOM Domain.
*/
static final String JORAM_DOMAIN = "Joram";
/**
* JORAM Client Domain.
*/
static final String JORAM_CLIENT_DOMAIN = "joramClient";
/**
* @return Returns an ObjectName pattern for JORAM Client MBeans.
* @throws MalformedObjectNameException Could not create {@link ObjectName}
*/
public static ObjectName joramClientMBeans() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":*");
}
/**
* @return ObjectName for the current JoramAdapter MBean
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramAdapter() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=JoramAdapter,*");
}
/**
* @return ObjectName for the JoramPlatform MBean
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramPlatform() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=PlatformAdmin");
}
/**
* @return ObjectName for the JoramAdmin MBean
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramAdmin() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=JoramAdmin");
}
/**
* Create ObjectName for a Joram managed queue.
* @param name queue name
* @return ObjectName for a Joram managed queue
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramQueue(String name) throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=queue,name=" + name);
}
/**
* Create ObjectName for all Joram managed queues
* @return ObjectName for a Joram managed queue
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramQueues() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=queue,*");
}
/**
* Create ObjectName for a Joram managed dead message queue.
* @param name queue name
* @return ObjectName for a Joram managed dead message queue
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramDmQueue(String name) throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=queue.dmq,name=" + name);
}
/**
* Create ObjectName for all Joram managed dead message queues
* @return ObjectName for a Joram managed dead message queue
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramDmQueues() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=queue.dmq,*");
}
/**
* Create ObjectName for a Joram managed topic
* @param name topic name
* @return ObjectName for a Joram managed topic
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramTopic(String name) throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=topic,name=" + name);
}
/**
* Create ObjectName for all Joram managed topics
* @return ObjectName for a Joram managed topic
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramTopics() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=topic,*");
}
/**
* Create ObjectName for a Joram managed user
* @param name user name
* @return ObjectName for a Joram managed user
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramUser(String name) throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=User,name=" + name);
}
/**
* Create ObjectName for all Joram managed users
* @return ObjectName for a Joram managed user
* @exception MalformedObjectNameException Could not create ObjectName with the given String
*/
public static ObjectName joramUsers() throws MalformedObjectNameException {
return ObjectName.getInstance(JORAM_CLIENT_DOMAIN + ":type=User,*");
}
}