org.norther.tammi.core.base
Class StaticDomain

java.lang.Object
  extended by org.norther.tammi.core.base.StaticDomain

public abstract class StaticDomain
extends Object

A convenience class to access domains and servers statically.

Author:
Ilkka Priha

Field Summary
static ObjectName FULL_QUERY
          A query pattern for all MBeans in the server.
static String LINE_SEPARATOR
          The line separator to apply.
 
Constructor Summary
StaticDomain()
           
 
Method Summary
static MBeanServer createMBeanServer(String domain)
          Creates a new shared MBean server.
static Object find(Class clazz)
          Finds the referent of the MBean in the default domain of the default MBean server implementing the specified class or interface.
static Object find(Class clazz, MBeanServer server)
          Finds the referent of the MBean in the default domain of the specified MBean server implementing the specified class or interface.
static Broker findBroker()
          Finds the referent of the default broker MBean.
static Broker findBroker(MBeanServer server)
          Finds the referent of the default broker MBean in the specified MBean server.
static Domain findDomain()
          Finds the referent of the default domain MBean.
static Domain findDomain(MBeanServer server)
          Finds the referent of the default domain MBean in the specified MBean server.
static Factory findFactory()
          Finds the referent of the default factory MBean.
static Factory findFactory(MBeanServer server)
          Finds the referent of the default factory MBean in the specified MBean server.
static LoaderMBean findLoader()
          Finds the referent of the default loader MBean.
static LoaderMBean findLoader(MBeanServer server)
          Finds the referent of the default loader MBean in the specified MBean server.
static MBeanServer findMBeanServer()
          Finds the default MBean server.
static MBeanServer findMBeanServer(String id)
          Finds the specified MBean server.
static MBeanServer[] findMBeanServers(String id)
          Finds the specified MBean servers.
static String getMBeanServerId()
          Gets the default MBean server id.
static String getMBeanServerId(MBeanServer server)
          Gets the specified MBean server id.
static MBeanServer newMBeanServer(String domain)
          Creates a new local MBean server.
static void releaseMBeanServer(MBeanServer server)
          Releases a shared MBean server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final String LINE_SEPARATOR
The line separator to apply.


FULL_QUERY

public static final ObjectName FULL_QUERY
A query pattern for all MBeans in the server.

Constructor Detail

StaticDomain

public StaticDomain()
Method Detail

findMBeanServer

public static MBeanServer findMBeanServer()
Finds the default MBean server.

Returns:
the default MBean server.
Throws:
RuntimeOperationsException - if the server is not available.

findMBeanServer

public static MBeanServer findMBeanServer(String id)
Finds the specified MBean server.

Parameters:
id - the agent id of the server, null for any.
Returns:
the specified MBean server, or null if not found.
Throws:
SecurityException - if not allowed.

findMBeanServers

public static MBeanServer[] findMBeanServers(String id)
Finds the specified MBean servers.

Parameters:
id - the agent id of the server, null for any.
Returns:
the specified MBean server, or null if not found.
Throws:
SecurityException - if not allowed.

newMBeanServer

public static MBeanServer newMBeanServer(String domain)
Creates a new local MBean server.

Parameters:
domain - the default domain.
Returns:
the new MBean server.
Throws:
SecurityException - if not allowed.

createMBeanServer

public static MBeanServer createMBeanServer(String domain)
Creates a new shared MBean server.

Parameters:
domain - the default domain.
Returns:
the new MBean server.
Throws:
SecurityException - if not allowed.

releaseMBeanServer

public static void releaseMBeanServer(MBeanServer server)
Releases a shared MBean server.

Parameters:
server - the MBean server.
Throws:
SecurityException - if not allowed.

getMBeanServerId

public static String getMBeanServerId()
Gets the default MBean server id.

Returns:
the MBean server id or null.
Throws:
RuntimeOperationsException - if the server is not available.

getMBeanServerId

public static String getMBeanServerId(MBeanServer server)
Gets the specified MBean server id.

Parameters:
server - the MBean server.
Returns:
the MBean server id or null.

find

public static Object find(Class clazz)
Finds the referent of the MBean in the default domain of the default MBean server implementing the specified class or interface.

Parameters:
clazz - the MBean interface.
Returns:
the referent of the default MBean or null.

findDomain

public static Domain findDomain()
Finds the referent of the default domain MBean.

Returns:
the referent of the domain MBean or null.

findLoader

public static LoaderMBean findLoader()
Finds the referent of the default loader MBean.

Returns:
the referent of the default loader MBean or null.

findBroker

public static Broker findBroker()
Finds the referent of the default broker MBean.

Returns:
the referent of the default broker MBean or null.

findFactory

public static Factory findFactory()
Finds the referent of the default factory MBean.

Returns:
the referent of the default factory MBean or null.

find

public static Object find(Class clazz,
                          MBeanServer server)
Finds the referent of the MBean in the default domain of the specified MBean server implementing the specified class or interface.

Parameters:
clazz - the MBean interface.
server - the MBean server.
Returns:
the referent of the default MBean or null.

findDomain

public static Domain findDomain(MBeanServer server)
Finds the referent of the default domain MBean in the specified MBean server.

Parameters:
server - the MBean server.
Returns:
the referent of the default domain MBean or null.

findLoader

public static LoaderMBean findLoader(MBeanServer server)
Finds the referent of the default loader MBean in the specified MBean server.

Parameters:
server - the MBean server.
Returns:
the referent of the default loader MBean or null.

findBroker

public static Broker findBroker(MBeanServer server)
Finds the referent of the default broker MBean in the specified MBean server.

Parameters:
server - the MBean server.
Returns:
the referent of the default broker MBean or null.

findFactory

public static Factory findFactory(MBeanServer server)
Finds the referent of the default factory MBean in the specified MBean server.

Parameters:
server - the MBean server.
Returns:
the referent of the default factory MBean or null.


Copyright © 2004 The Norther Organization. All rights reserved.