tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans ServerLifecycleListener.java
Date Fri, 26 Oct 2001 22:53:27 GMT
remm        01/10/26 15:53:27

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        ServerLifecycleListener.java
  Log:
  - Add support for basic authentication to the HTML adaptor.
  
  Revision  Changes    Path
  1.2       +39 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java
  
  Index: ServerLifecycleListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerLifecycleListener.java	2001/10/26 02:03:28	1.1
  +++ ServerLifecycleListener.java	2001/10/26 22:53:26	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v
1.1 2001/10/26 02:03:28 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/10/26 02:03:28 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v
1.2 2001/10/26 22:53:26 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/10/26 22:53:26 $
    *
    * ====================================================================
    *
  @@ -70,6 +70,7 @@
   import java.util.Iterator;
   import javax.management.MBeanException;
   import javax.management.ObjectName;
  +import com.sun.jdmk.comm.AuthInfo;
   import com.sun.jdmk.comm.HtmlAdaptorServer;
   import org.apache.catalina.Connector;
   import org.apache.catalina.Container;
  @@ -94,7 +95,7 @@
    *
    * @author Craig R. McClanahan
    * @author Amy Roh
  - * @version $Revision: 1.1 $ $Date: 2001/10/26 02:03:28 $
  + * @version $Revision: 1.2 $ $Date: 2001/10/26 22:53:26 $
    */
   
   public class ServerLifecycleListener
  @@ -142,6 +143,36 @@
       }
   
   
  +    /**
  +     * The login used for the authentication by the 
  +     * <code>HtmlAdaptorServer</code>.
  +     */
  +    protected String login = null;
  +
  +    public String getLogin() {
  +        return (this.login);
  +    }
  +
  +    public void setLogin(String login) {
  +        this.login = login;
  +    }
  +
  +
  +    /**
  +     * The password used for the authentication by the 
  +     * <code>HtmlAdaptorServer</code>.
  +     */
  +    protected String password = null;
  +
  +    public String getPassword() {
  +        return (this.password);
  +    }
  +
  +    public void setPassword(String password) {
  +        this.password = password;
  +    }
  +
  +
       // ---------------------------------------------- ContainerListener Methods
   
   
  @@ -204,6 +235,10 @@
   
           try {
               adaptor = new HtmlAdaptorServer(port);
  +            if (login != null) {
  +                adaptor.addUserAuthenticationInfo
  +                    (new AuthInfo(getLogin(), getPassword()));
  +            }
               ObjectName name =
                   new ObjectName("Adaptor:name=html,port=" + port);
               MBeanUtils.createServer().registerMBean(adaptor, name);
  
  
  

Mime
View raw message