FileDocCategorySizeDatePackage
SunOneHttpJmxConnectorFactory.javaAPI DocGlassfish v2 API4176Fri May 04 22:36:22 BST 2007com.sun.enterprise.admin.jmx.remote

SunOneHttpJmxConnectorFactory

public class SunOneHttpJmxConnectorFactory extends Object
A convenience class that knows how to setup the client side to get the reference of JMXConnector. This class is specific to Sun ONE Application Server 8.0. Any client can use the following to initialize the S1AS 8.0 JSR 160 client. This class lets the clients to do this under the hood and provide a {@link JMXConnectorFactory} like API.
author
Kedar Mhaswade
since
S1AS8.0
version
1.0

Fields Summary
Constructors Summary
private SunOneHttpJmxConnectorFactory()
Creates a new instance of SunOneHttpJmxConnectorFactory

    
Methods Summary
public static javax.management.remote.JMXConnectorconnect(javax.management.remote.JMXServiceURL url, java.lang.String user, java.lang.String password)

        return connect(url, user, password, null);
    
public static javax.management.remote.JMXConnectorconnect(javax.management.remote.JMXServiceURL url, java.lang.String user, java.lang.String password, java.util.Map extraEnv)

        final Map env = initEnvironment();
        if (user != null) 
            env.put(DefaultConfiguration.ADMIN_USER_ENV_PROPERTY_NAME, user);
        if (password != null)
            env.put(DefaultConfiguration.ADMIN_PASSWORD_ENV_PROPERTY_NAME, password);
        if (extraEnv != null) env.putAll(extraEnv);
        
        return ( JMXConnectorFactory.connect(url, env) );
    
private static java.util.MapinitEnvironment()

        final Map env = new HashMap();
        final String PKGS = "com.sun.enterprise.admin.jmx.remote.protocol";
        env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PKGS);
        env.put(DefaultConfiguration.HTTP_AUTH_PROPERTY_NAME, DefaultConfiguration.DEFAULT_HTTP_AUTH_SCHEME);
        
        return ( env );