org.ow2.jonas.commands.admin
Class UtilAdmin

java.lang.Object
  extended by org.ow2.jonas.commands.admin.UtilAdmin

public class UtilAdmin
extends Object

Utility class allowing MBean manipulations on the managed server.

Author:
Adriana.Danes@bull.net

Field Summary
static String ALL
          Constant used in pattern ObjectNames.
static String J2EEServer
           
static String J2EEType
           
static String ServerProxy
           
static String ServiceType
           
static String Type
           
 
Method Summary
static String dumpCustom(String domain, String server, MBeanServerConnection conn)
           
protected static ObjectName getJ2eeMBean(String domain, String server, String type, String name)
          Construct ObjectName for an MBean associated with a manageable object in a J2EEServer.
static ObjectName getJonasServiceMBean(String domain, String server, String service)
           
static ObjectName getJonasServiceMBean(String domain, String server, String service, Properties keyProps)
           
static String getTopicLevel(String domain, String server, MBeanServerConnection conn, String topic)
           
static String[] getTopics(String domain, String server, MBeanServerConnection conn)
           
static ObjectName J2EEServer(String serverName)
          Create ObjectName for J2EEServer MBean without knowing domain name
protected static ArrayList<String> listApps(String domain, String server, MBeanServerConnection conn)
          Get the application name list in a given server
static ArrayList<String> listBeans(String domain, String server, MBeanServerConnection conn)
          Get the beans name list in a given server
static ArrayList<ObjectName> listJNDIResources(String domain, String server, MBeanServerConnection conn)
           
protected static ArrayList<String> listModules(String domain, String server, MBeanServerConnection conn)
          Get the modules name list in a given server
static ObjectName ServerProxy(String serverName)
          Create ObjectName for ServerProxy MBean without knowing domain name
static void setTopicLevel(String domain, String server, MBeanServerConnection conn, String topic, String level)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final String ALL
Constant used in pattern ObjectNames.

See Also:
Constant Field Values

J2EEServer

public static final String J2EEServer
See Also:
Constant Field Values

ServerProxy

public static final String ServerProxy
See Also:
Constant Field Values

J2EEType

public static final String J2EEType
See Also:
Constant Field Values

Type

public static final String Type
See Also:
Constant Field Values

ServiceType

public static final String ServiceType
See Also:
Constant Field Values
Method Detail

getJ2eeMBean

protected static ObjectName getJ2eeMBean(String domain,
                                         String server,
                                         String type,
                                         String name)
                                  throws MalformedObjectNameException
Construct ObjectName for an MBean associated with a manageable object in a J2EEServer.

Parameters:
domain - management domain name
server - J2EE server name
type - manageable object type
name - MBean name
Returns:
created ObjectName
Throws:
MalformedObjectNameException - Could not create the ObjectName as

J2EEServer

public static ObjectName J2EEServer(String serverName)
                             throws MalformedObjectNameException,
                                    NullPointerException
Create ObjectName for J2EEServer MBean without knowing domain name

Parameters:
serverName - the server name
Returns:
ObjectName for J2EEServer MBean
Throws:
MalformedObjectNameException - Format exception
NullPointerException - null parameter

ServerProxy

public static ObjectName ServerProxy(String serverName)
                              throws MalformedObjectNameException,
                                     NullPointerException
Create ObjectName for ServerProxy MBean without knowing domain name

Parameters:
serverName - the server name
Returns:
ObjectName for ServerProxy MBean
Throws:
MalformedObjectNameException - Format exception
NullPointerException - null parameter

getJonasServiceMBean

public static ObjectName getJonasServiceMBean(String domain,
                                              String server,
                                              String service)
                                       throws MalformedObjectNameException,
                                              NullPointerException
Throws:
MalformedObjectNameException
NullPointerException

getJonasServiceMBean

public static ObjectName getJonasServiceMBean(String domain,
                                              String server,
                                              String service,
                                              Properties keyProps)
                                       throws MalformedObjectNameException,
                                              NullPointerException
Throws:
MalformedObjectNameException
NullPointerException

listBeans

public static ArrayList<String> listBeans(String domain,
                                          String server,
                                          MBeanServerConnection conn)
                                   throws MalformedObjectNameException,
                                          IOException
Get the beans name list in a given server

Parameters:
domain - the server's domain
server - the server name
conn - the MBeanServer connection for this server
Returns:
the list of the bean names
Throws:
MalformedObjectNameException - should not arrive if we construct correct ObjectName
IOException - A communication problem occurred when talking to the MBean server

listModules

protected static ArrayList<String> listModules(String domain,
                                               String server,
                                               MBeanServerConnection conn)
                                        throws MalformedObjectNameException,
                                               IOException
Get the modules name list in a given server

Parameters:
domain - the server's domain
server - the server name
conn - the MBeanServer connection for this server
Returns:
the list of the module names
Throws:
MalformedObjectNameException - should not arrive if we construct correct ObjectName
IOException - A communication problem occurred when talking to the MBean server

listApps

protected static ArrayList<String> listApps(String domain,
                                            String server,
                                            MBeanServerConnection conn)
                                     throws MalformedObjectNameException,
                                            IOException
Get the application name list in a given server

Parameters:
domain - the server's domain
server - the server name
conn - the MBeanServer connection for this server
Returns:
the list of the application names
Throws:
MalformedObjectNameException - should not arrive if we construct correct ObjectName
IOException - A communication problem occurred when talking to the MBean server

dumpCustom

public static String dumpCustom(String domain,
                                String server,
                                MBeanServerConnection conn)
                         throws Exception
Throws:
Exception

listJNDIResources

public static ArrayList<ObjectName> listJNDIResources(String domain,
                                                      String server,
                                                      MBeanServerConnection conn)
                                               throws Exception
Throws:
Exception

getTopics

public static String[] getTopics(String domain,
                                 String server,
                                 MBeanServerConnection conn)
                          throws Exception
Throws:
Exception

getTopicLevel

public static String getTopicLevel(String domain,
                                   String server,
                                   MBeanServerConnection conn,
                                   String topic)
                            throws Exception
Throws:
Exception

setTopicLevel

public static void setTopicLevel(String domain,
                                 String server,
                                 MBeanServerConnection conn,
                                 String topic,
                                 String level)
                          throws Exception
Throws:
Exception


Copyright © 2010 OW2 Consortium. All Rights Reserved.