Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.jmx.HttpAdaptor Class Reference

Collaboration diagram for org.objectweb.cjdbc.controller.jmx.HttpAdaptor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HttpAdaptor (String hostName, int port, JMXAuthenticator authenticator, SSLConfiguration sslConfig) throws JmxException
void start () throws JmxException
void stop () throws JmxException

Static Public Member Functions

List getHttpAdaptors ()

Static Package Attributes

Trace logger

Detailed Description

This class defines a HttpAdaptor

Author:
Marc Wick
Version:
1.0

Definition at line 48 of file HttpAdaptor.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.jmx.HttpAdaptor.HttpAdaptor String  hostName,
int  port,
JMXAuthenticator  authenticator,
SSLConfiguration  sslConfig
throws JmxException
 

Creates a new HttpAdaptor.java object

Parameters:
hostName the host name the adaptor binds to
port the http port
authenticator the authenticator used for the connection, if null no authentication on the connection
sslConfig the ssl configuration, if null ssl is disabled
Exceptions:
JmxException problems to get name of localhost

TODO: dssmith - determine applicability of getLocalHost()

Definition at line 75 of file HttpAdaptor.java.

00077   {
00078     if (hostName != null)
00079     {
00080       this.hostName = hostName;
00081     }
00082     else
00083     {
00084       try
00085       {
00086         /** TODO: dssmith - determine applicability of getLocalHost() */
00087         this.hostName = InetAddress.getLocalHost().getHostName();
00088       }
00089       catch (UnknownHostException ex)
00090       {
00091         throw new JmxException(ex);
00092       }
00093     }
00094     this.port = port;
00095     //this.authenticator = authenticator;
00096     this.sslConfig = sslConfig;
00097     addHttpAdaptor(this);
00098   }


Member Function Documentation

List org.objectweb.cjdbc.controller.jmx.HttpAdaptor.getHttpAdaptors  )  [static]
 

Returns a list of HttpAdaptor .

Returns:
Returns list of HttpAdaptor.

Definition at line 165 of file HttpAdaptor.java.

00166   {
00167     return httpAdaptors;
00168   }

void org.objectweb.cjdbc.controller.jmx.HttpAdaptor.start  )  throws JmxException
 

start the http adaptor

Exceptions:
JmxException the adaptor could not be started

Definition at line 105 of file HttpAdaptor.java.

Referenced by org.objectweb.cjdbc.controller.core.ControllerFactory.setUpJmx().

00106   {
00107     try
00108     {
00109 
00110       MBeanServer server = MBeanServerManager.getInstance();
00111       // register the HTTP adaptor MBean to the agent
00112       logger.info(Translate.get("jmx.create.http.adaptor", new Object[]{
00113           hostName, String.valueOf(port)}));
00114       adaptor = new mx4j.tools.adaptor.http.HttpAdaptor();
00115       objectName = new ObjectName("Server:name=HttpAdaptor");
00116       server.registerMBean(adaptor, objectName);
00117       adaptor.setHost(hostName);
00118       adaptor.setPort(port);
00119       // set XSLT processor
00120       logger.debug(Translate.get("jmx.create.xslt.processor"));
00121       processorName = new ObjectName("Server:name=XSLTProcessor");
00122       server.createMBean(mx4j.tools.adaptor.http.XSLTProcessor.class.getName(),
00123           processorName, null);
00124       server.setAttribute(objectName, new Attribute("ProcessorName",
00125           processorName));
00126       if (this.sslConfig != null)
00127       {
00128         //:TODO
00129         throw new JmxException("ssl for http not implemented");
00130       }
00131       adaptor.start();
00132     }
00133     catch (Exception e)
00134     {
00135       e.printStackTrace();
00136       throw new JmxException(e);
00137     }
00138   }

void org.objectweb.cjdbc.controller.jmx.HttpAdaptor.stop  )  throws JmxException
 

stop the http adaptor

Exceptions:
JmxException problems stoping the adaptor

Definition at line 145 of file HttpAdaptor.java.

Referenced by org.objectweb.cjdbc.controller.jmx.MBeanServerManager.setJmxEnabled().

00146   {
00147     try
00148     {
00149       MBeanServer server = MBeanServerManager.getInstance();
00150       adaptor.stop();
00151       server.unregisterMBean(objectName);
00152       server.unregisterMBean(processorName);
00153     }
00154     catch (Exception e)
00155     {
00156       throw new JmxException(e);
00157     }
00158   }


Member Data Documentation

Trace org.objectweb.cjdbc.controller.jmx.HttpAdaptor.logger [static, package]
 

Initial value:

 Trace
                                                               .getLogger("org.objectweb.cjdbc.controller.jmx")

Definition at line 51 of file HttpAdaptor.java.


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:51 2005 for C-JDBC by  doxygen 1.3.9.1