User: jung    
  Date: 01/03/15 12:10:01

  Modified:    src/org/jboss/zoap HttpServer.java HttpServerMBean.java
  Log:
  org.jboss.zoap.HttpServer is now a proper ServiceMbean
  
  Revision  Changes    Path
  1.5       +18 -35    zoap/src/org/jboss/zoap/HttpServer.java
  
  Index: HttpServer.java
  ===================================================================
  RCS file: /products/cvs/ejboss/zoap/src/org/jboss/zoap/HttpServer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HttpServer.java   2001/02/08 09:06:09     1.4
  +++ HttpServer.java   2001/03/15 20:10:00     1.5
  @@ -34,27 +34,29 @@
   import org.zoap.soap.SoapObject;
   
   import org.jboss.logging.Log;
  +import org.jboss.util.ServiceMBeanSupport;
   
   /** JMX/Jboss Service Wrapper around the SOAP HTTP Server */
   
  -public class HttpServer implements HttpServerMBean, MBeanRegistration {
  +public class HttpServer extends ServiceMBeanSupport implements HttpServerMBean
  + {
   
        /** the wrapped server */
   
        org.zoap.soap.HttpServer server;
   
  -    Log log = Log.createLog("HttpServer");
  -
  -
        /** construct server */
   
        public HttpServer() throws java.net.MalformedURLException, 
java.net.UnknownHostException {
                server = new org.zoap.soap.HttpServer(Environment.HTTP_PORT);
        }
   
  +    public void initService() {
  +    }
  +
        /** start the server */
   
  -     public void start() throws java.io.IOException {
  +     public void startService() throws java.io.IOException {
   
                server.start();
        log.log("start(): SOAP Server started.");
  @@ -63,44 +65,25 @@
   
        /** stop the server */
   
  -     public void stop() {
  +     public void stopService() {
   
   
        log.log("stop(): About to stop SOAP Server.");
                server.stop();
        }
  -
  -     /** called after the HttpServer is deregistered from JMX. default is to stop 
the HttpServer */
  -
  -     public void postDeregister() {
  -
  -
  -
  -     log.log("postDeregister(): About to stop SOAP Server.");
  -             server.stop();
  -     }
   
  -     /**
  -      * called after the HttpRegister has been registered in JMX
  -      * mabye we should restrict registrations to happen only after that state
  -      */
  -     public void postRegister(Boolean p0) {
  +    
  +   public ObjectName getObjectName(MBeanServer server, ObjectName name)
  +      throws javax.management.MalformedObjectNameException
  +   {
  +      return new ObjectName(OBJECT_NAME);
  +   }
   
   
  -
  -     }
  -
  -     /** called before the service is deregistered maybe we should lock the server 
not accept anymore registrations? */
  -     public void preDeregister() throws Exception {
  -
  -
  -
  -     }
  -
  -     /** called before the service is registered in the MBeanserver with a given 
name default is to start the HttpServer */
  -     public ObjectName preRegister(MBeanServer p0, ObjectName p1) throws Exception {
  -             return new ObjectName(Environment.JMX_NAME);
  -     }
  +      public String getName()
  +   {
  +      return "*** HttpServer ***";
  +   }
   
        public java.net.URL getURL() {
                return server.getURL();
  
  
  
  1.4       +8 -5      zoap/src/org/jboss/zoap/HttpServerMBean.java
  
  Index: HttpServerMBean.java
  ===================================================================
  RCS file: /products/cvs/ejboss/zoap/src/org/jboss/zoap/HttpServerMBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HttpServerMBean.java      2001/01/04 14:45:06     1.3
  +++ HttpServerMBean.java      2001/03/15 20:10:00     1.4
  @@ -30,14 +30,17 @@
    *
    *   @see HttpServer
    *   @author $Author: jung $
  - *   @version $Revision: 1.3 $
  + *   @version $Revision: 1.4 $
    */
   
  -public interface HttpServerMBean extends SoapServer {
  +public interface HttpServerMBean extends SoapServer, org.jboss.util.ServiceMBean
  +{
  +   // Constants -----------------------------------------------------
  +   public static final String OBJECT_NAME = Environment.JMX_NAME;
   
  -     public void start() throws Exception;
  +   public void start() throws Exception;
   
  -     public void stop();
  +   public void stop();
   
   }
   
  
  
  

Reply via email to