FileDocCategorySizeDatePackage
SunOneHttpProvider.javaAPI DocGlassfish v2 API4896Fri May 04 22:24:50 BST 2007com.sun.cli.jmx.spi

SunOneHttpProvider

public class SunOneHttpProvider extends Object implements com.sun.cli.jmx.spi.JMXConnectorProvider
Implements the provider to Generic CLI for the protocol "s1ashttp".
author
kedar
version
1.0

Fields Summary
public static final String
MY_PROTOCOL
Constructors Summary
public SunOneHttpProvider()

	
Methods Summary
public javax.management.remote.JMXConnectorconnect(java.util.Map m)

		final String user		= (String) m.get(DefaultConfiguration.ADMIN_USER_ENV_PROPERTY_NAME);
		final String password	= (String) m.get(DefaultConfiguration.ADMIN_PASSWORD_ENV_PROPERTY_NAME);
		final JMXServiceURL url	= env2JmxServiceUrl(m);
		System.out.println("User = " + user);
		System.out.println("Password = " + password);
		return ( SunOneHttpJmxConnectorFactory.connect(url, user, password) );
	
private javax.management.remote.JMXServiceURLenv2JmxServiceUrl(java.util.Map m)

		final String protocol	= (String) m.get(JMXConnectorProvider.PROTOCOL);
		final String host		= (String) m.get(JMXConnectorProvider.HOST);
		final int port			= Integer.parseInt((String)m.get(JMXConnectorProvider.PORT));
		return ( new JMXServiceURL(protocol, host, port) );
	
public static JMXConnectorProviderInfogetInfo()

		return( new Info() );
	
public booleanisSupported(java.util.Map m)

	
	    
		final boolean hostPresent = m.get(JMXConnectorProvider.HOST) != null;
		final boolean portPresent = m.get(JMXConnectorProvider.PORT) != null;
		
		final String	protocol	= (String)m.get(JMXConnectorProvider.PROTOCOL);
		final boolean	protocolPresent = protocol != null;
		final boolean	userPresent = m.get(DefaultConfiguration.ADMIN_USER_ENV_PROPERTY_NAME) != null;
		final boolean	passwordPresent = m.get(DefaultConfiguration.ADMIN_PASSWORD_ENV_PROPERTY_NAME) != null;
		return ( hostPresent && portPresent && protocolPresent && protocol.equals( MY_PROTOCOL ) &&
				 userPresent && passwordPresent );