Java EE 5 SDK

com.sun.appserv.management.util.jmx
Class MBeanServerConnectionSource

java.lang.Object
  extended by com.sun.appserv.management.util.jmx.MBeanServerConnectionSource
All Implemented Interfaces:
ConnectionSource

public final class MBeanServerConnectionSource
extends Object
implements ConnectionSource

A ConnectionSource for in-process access where the MBeanServer is actually known and where later access to it may be desired.


Field Summary
protected  MBeanServer mServer
           
 
Constructor Summary
MBeanServerConnectionSource(MBeanServer server)
          Create a new instance for the specified MBeanServer
 
Method Summary
 MBeanServerConnection getExistingMBeanServerConnection()
           
 JMXConnector getJMXConnector(boolean forceNew)
           
 MBeanServer getMBeanServer()
          Return the internal MBeanServer
 MBeanServerConnection getMBeanServerConnection(boolean forceNew)
          Return a valid MBeanServerConnection, making a new connection if necessary, or returning an existing one if still valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mServer

protected MBeanServer mServer
Constructor Detail

MBeanServerConnectionSource

public MBeanServerConnectionSource(MBeanServer server)
Create a new instance for the specified MBeanServer

Method Detail

getMBeanServer

public MBeanServer getMBeanServer()
Return the internal MBeanServer


getExistingMBeanServerConnection

public MBeanServerConnection getExistingMBeanServerConnection()
Specified by:
getExistingMBeanServerConnection in interface ConnectionSource
Returns:
existing connection, valid or not, may be null

getMBeanServerConnection

public MBeanServerConnection getMBeanServerConnection(boolean forceNew)
Description copied from interface: ConnectionSource
Return a valid MBeanServerConnection, making a new connection if necessary, or returning an existing one if still valid. Some implementations may choose to not allow creation of a new connection (when 'forceNew' is specified).

Should not be called frequently, as the check for validity will make a remote call.

An implementation may choose to ignore the 'forceNew' parameter and always return the same connection.

Specified by:
getMBeanServerConnection in interface ConnectionSource
Parameters:
forceNew - creates a new connection instead of reusing an existing one
Returns:
the connection, or null if a new one is not possible

getJMXConnector

public JMXConnector getJMXConnector(boolean forceNew)
Specified by:
getJMXConnector in interface ConnectionSource
Returns:
a JMXConnector or null if not appropriate

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.