costin      2003/01/16 14:15:05

  Modified:    jk/java/org/apache/jk/core JkHandler.java
  Log:
  Let the handlers know their names.
  
  A handler is a notification listener - right now the method is not
  implemented, but will eventually call ( or replace ) invoke.
  
  Revision  Changes    Path
  1.10      +45 -3     
jakarta-tomcat-connectors/jk/java/org/apache/jk/core/JkHandler.java
  
  Index: JkHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/JkHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JkHandler.java    9 Aug 2002 20:54:24 -0000       1.9
  +++ JkHandler.java    16 Jan 2003 22:15:05 -0000      1.10
  @@ -60,15 +60,18 @@
   
   import java.io.*;
   import java.util.*;
  -import java.security.*;
   
  -import org.apache.tomcat.util.handler.*;
  +import javax.management.Notification;
  +import javax.management.MBeanRegistration;
  +import javax.management.ObjectName;
  +import javax.management.MBeanServer;
  +import javax.management.NotificationListener;
   
   /**
    *
    * @author Costin Manolache
    */
  -public class JkHandler {
  +public class JkHandler implements MBeanRegistration, NotificationListener {
       public static final int OK=0;
       public static final int LAST=1;
       public static final int ERROR=2;
  @@ -166,6 +169,45 @@
        */
       public void addHandlerCallback( JkHandler w ) {
   
  +    }
  +
  +    public void handleNotification(Notification notification, Object handback)
  +    {
  +//        BaseNotification bNot=(BaseNotification)notification;
  +//        int code=bNot.getCode();
  +//
  +//        MsgContext ctx=(MsgContext)bNot.getSource();
  +
  +
  +    }
  +
  +    protected String domain;
  +    protected ObjectName oname;
  +    protected MBeanServer mserver;
  +
  +    public ObjectName getObjectName() {
  +        return oname;
  +    }
  +
  +    public String getDomain() {
  +        return domain;
  +    }
  +
  +    public ObjectName preRegister(MBeanServer server,
  +                                  ObjectName name) throws Exception {
  +        oname=name;
  +        mserver=server;
  +        domain=name.getDomain();
  +        return name;
  +    }
  +
  +    public void postRegister(Boolean registrationDone) {
  +    }
  +
  +    public void preDeregister() throws Exception {
  +    }
  +
  +    public void postDeregister() {
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to