org.objectweb.jonas.jmx.vjadmin
Class Mx4jConnectorFactory

java.lang.Object
  |
  +--org.objectweb.jonas.jmx.vjadmin.Mx4jConnectorFactory

public class Mx4jConnectorFactory
extends java.lang.Object

Manages the current mx4j RMIConnector used to communicate with the MBEanServer


Constructor Summary
Mx4jConnectorFactory()
           
 
Method Summary
static void createRMIConnector()
          Create a RMI connector connected to the RMI adaptor created by the JOnAS jmxService
static javax.naming.Context getContext()
           
static java.lang.String getCurrentRMIConnectorName()
           
static java.lang.String getJonasNamingServiceURL()
           
static mx4j.connector.rmi.RMIConnector getRMIConnector()
           
static java.util.Set getRMIConnectorsNames()
           
static void resetCurrentRMIConnectorName()
          Set the currentRMIConnectorName to null
static void setCurrentRMIConnectorName(java.lang.String name)
          Set the currentRMIConnectorName to the specified value, then create an RMI connector
static void setJonasNamingServiceURL(java.lang.String url)
          Sets the PROVIDER_URL property to the specified value.
static void setNamingEnvCtx(java.util.Properties env)
          Create a new naming context based on the given env. properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mx4jConnectorFactory

public Mx4jConnectorFactory()
Method Detail

getContext

public static javax.naming.Context getContext()
                                       throws javax.naming.NamingException
Returns:
Context the current application context, create an initial context if there is no current context.

getCurrentRMIConnectorName

public static java.lang.String getCurrentRMIConnectorName()
Returns:
String the name of the current RMI connector. If no RMI connector is selected, returns the first RMI connector found with the getRMIConnectorsNames method. Return null if no RMI connector is available.

setCurrentRMIConnectorName

public static void setCurrentRMIConnectorName(java.lang.String name)
                                       throws java.lang.Exception
Set the currentRMIConnectorName to the specified value, then create an RMI connector

resetCurrentRMIConnectorName

public static void resetCurrentRMIConnectorName()
Set the currentRMIConnectorName to null

getRMIConnectorsNames

public static java.util.Set getRMIConnectorsNames()
                                           throws javax.naming.NamingException
Returns:
Set a set containning all RMI connector names available in the current context.

getJonasNamingServiceURL

public static java.lang.String getJonasNamingServiceURL()
Returns:
String the value of the PROVIDER_URL property in the current context. If a javax.naming.NamingException is catch, the exception message is returned.

setNamingEnvCtx

public static void setNamingEnvCtx(java.util.Properties env)
                            throws javax.naming.NamingException
Create a new naming context based on the given env. properties
Parameters:
env - properties to create a new naming context

setJonasNamingServiceURL

public static void setJonasNamingServiceURL(java.lang.String url)
                                     throws javax.naming.NamingException
Sets the PROVIDER_URL property to the specified value. Then, sets the current RMI connector to null.

getRMIConnector

public static mx4j.connector.rmi.RMIConnector getRMIConnector()
                                                       throws java.lang.Exception
Returns:
the current RMI connector. If null (not set yet), create it.

createRMIConnector

public static void createRMIConnector()
                               throws java.lang.Exception
Create a RMI connector connected to the RMI adaptor created by the JOnAS jmxService