org.objectweb.jonas.jmx.vjadmin
Class ConnectorFactory

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

public class ConnectorFactory
extends java.lang.Object

Manages the current "jonas provided" RMIConnector used to communicate with the MBEanServer


Constructor Summary
ConnectorFactory()
           
 
Method Summary
static javax.naming.Context getContext()
           
static java.lang.String getCurrentRMIConnectorName()
           
static java.lang.String getJonasNamingServiceURL()
           
static RMIConnector getRMIConnector()
           
static java.util.Set getRMIConnectorsNames()
           
static void lookupRMIConnector()
          Lookup for the RMI connector registered with the currentRMIConnectorName JNDI name.
static void resetCurrentRMIConnectorName()
          Set the currentRMIConnectorName to null
static void setCurrentRMIConnectorName(java.lang.String name)
          Set the currentRMIConnectorName to the specified value, then lookup for the 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

ConnectorFactory

public ConnectorFactory()
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 javax.naming.NamingException
Set the currentRMIConnectorName to the specified value, then lookup for the 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 RMIConnector getRMIConnector()
                                    throws javax.naming.NamingException
Returns:
RMIConnector the current RMI connector, if null, lookup for a new one.

lookupRMIConnector

public static void lookupRMIConnector()
                               throws javax.naming.NamingException
Lookup for the RMI connector registered with the currentRMIConnectorName JNDI name.