tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat Interceptor.java Lifecycle.java LifecycleException.java Loader.java Logger.java Manager.java
Date Thu, 20 Jan 2000 06:32:51 GMT
craigmcc    00/01/19 22:32:51

  Added:       proposals/catalina/src/share/org/apache/tomcat
                        Interceptor.java Lifecycle.java
                        LifecycleException.java Loader.java Logger.java
                        Manager.java
  Log:
  Check-in #2 of the basic interfaces for the "Catalina" proposal.
  
  Revision  Changes    Path
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Interceptor.java
  
  Index: Interceptor.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Interceptor.java,v
1.1 2000/01/20 06:32:51 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/20 06:32:51 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat;
  
  
  import java.io.IOException;
  import javax.servlet.ServletException;
  
  
  /**
   * An <b>Interceptor</b>, as the name implies, intercepts request processing
   * prior to, and after, the call to a Container's <code>service()</code>
   * method.  Conceptually, a stack of Interceptors can be associated with a
   * particular Container, which are processed as described for
   * <code>Container.invoke()</code>.
   * <p>
   * Note that Interceptors may be added to <b>any</b> type of Container, so it
   * is up to the Interceptor implementation to deal avoid class cast exceptions.
   * An Interceptor can refuse to be attached to a particular Container by
   * returning a <code>IllegalArgumentException</code> to the
   * <code>setContainer()</code> method.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:51 $
   */
  
  public interface Interceptor {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container to which this Interceptor was added, if any.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container to which this Interceptor is being added.  This method
       * must be called from within the <code>addInterceptor()</code> method of
       * the specified Container.  This Interceptor may refuse to become
       * attached to the specified Container by throwing an exception.
       *
       * @param container Container to which this Interceptor is being added
       *
       * @exception IllegalArgumentException if this Interceptor refuses to be
       *  attached to the specified Container
       * @exception IllegalStateException if this Interceptor is already
       *  attached to a different Container.
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Interceptor implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Perform pre-processing for this request.  The <code>preService()</code>
       * method of all Interceptors associated with a Container are called before
       * the Container's <code>service()</code> method is called, starting with
       * the most recently added one, until a <code>preService()</code> method
       * returns <code>false</code> or throws an Exception.  This method may
       * proceed in any of the following ways:
       * <ul>
       * <li>Do nothing, and return <code>true</code>  This would be normal
for
       *     an Interceptor that only required post-processing of the request.
       * <li>Examine and/or modify the properties of the specified Request and/or
       *     Response, and return <code>true</code>.  This would be normal for
       *     an Interceptor that performed pre-processing, but did not complete
       *     the response.
       * <li>Examine and/or modify the properties of the specified Request and/or
       *     Response, complete the generation of the Response, and return
       *     <code>false</code>.  This would be normal for an Interceptor that
       *     decided to pre-empt the normal processing cycle for this request,
       *     such as a security implementation that needs to challenge the user
       *     for credentials.
       * <li>Throw an <code>IOException</code> if encountered when processing
the
       *     specified Request or Response.  This will abort all further
       *     processing of this request.
       * <li>Throw a <code>ServletException</code> if an unacceptable condition
       *     is encountered.  This will abort all further processing of this
       *     request.
       * </ul>
       *
       * @param request Request to be processed
       * @param response Response to be produced
       *
       * @return <code>true</code> if processing of this request and response
       *  should continue, or <code>false</code> if creation of this response
       *  has been completed
       *
       * @exception IOException if an input/output error occurred while
       *  processing this request
       * @exception ServletException if a ServletException was thrown
       *  while processing this request
       */
      public boolean preService(Request request, Response response)
  	throws IOException, ServletException;
  
  
      /**
       * Perform post-processing for this request.  The
       * <code>postService()</code> method of all Interceptors associated with
       * a Container, where the <code>preService()</code> method was actually
       * called (i.e. for those Interceptors up to and including the one whose
       * <code>preService()</code> method returned <code>false</code>,
if any),
       * starting with the least recently added one.
       * <p>
       * The <code>postService()</code> method may examine, but not modify, the
       * properties of the specified Request and Response.  <b>FIXME:  Is this
       * requirement too restrictive?</b>.  It may, however, throw an exception,
       * which bypasses the call to <code>postService()</code> for any
       * remaining Interceptor associated with this Container.
       *
       * @param request Request that was processed
       * @param response Response that was produced
       *
       * @exception IOException if an input/output error occurred while
       *  processing this request
       * @exception ServletException if a ServletException was thrown
       *  while processing this request
       */
      public void postService(Request request, Response response)
  	throws IOException, ServletException;
  
  
  }
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Lifecycle.java
  
  Index: Lifecycle.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Lifecycle.java,v
1.1 2000/01/20 06:32:51 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/20 06:32:51 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat;
  
  
  import org.w3c.dom.Node;
  
  
  /**
   * Common interface for component life cycle methods.  Tomcat components
   * may, but are not required to, implement this interface (as well as the
   * appropriate interface(s) for the functionality they support) in order to
   * provide a consistent mechanism to configure, start, and stop the component.
   * <p>
   * <b>FIXME:  Consider using the Avalon framework architecture instead.</b>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:51 $
   */
  
  public interface Lifecycle {
  
  
      // --------------------------------------------------------- Public Methods
  
  
  
      /**
       * Configure this component, based on the specified configuration
       * parameters.  This method should be called immediately after the
       * component instance is created, and before <code>start()</code>
       * is called.
       *
       * @param parameters Configuration parameters for this component
       *  (<B>FIXME: What object type should this really be?)
       *
       * @exception IllegalStateException if this component has already been
       *  configured and/or started
       * @exception LifecycleException if this component detects a fatal error
       *  in the configuration parameters it was given
       */
      public void configure(Node parameters)
  	throws LifecycleException;
  
  
      /**
       * Prepare for the beginning of active use of the public methods of this
       * component.  This method should be called after <code>configure()</code>,
       * and before any of the public methods of the component are utilized.
       *
       * @exception IllegalStateException if this component has not yet been
       *  configured (if required for this component)
       * @exception IllegalStateException if this component has already been
       *  started
       * @exception LifecycleException if this component detects a fatal error
       *  that prevents this component from being used
       */
      public void start() throws LifecycleException;
  
  
      /**
       * Gracefully terminate the active use of the public methods of this
       * component.  This method should be the last one called on a given
       * instance of this component.
       *
       * @exception IllegalStateException if this component has not been started
       * @exception IllegalStateException if this component has already
       *  been stopped
       * @exception LifecycleException if this component detects a fatal error
       *  that needs to be reported
       */
      public void stop() throws LifecycleException;
  
  
  }
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/LifecycleException.java
  
  Index: LifecycleException.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/LifecycleException.java,v
1.1 2000/01/20 06:32:51 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/20 06:32:51 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat;
  
  
  /**
   * General purpose exception that is thrown to indicate a lifecycle related
   * problem.  Such exceptions should generally be considered fatal to the
   * operation of the application containing this component.
   * <p>
   * <b>FIXME:  Consider using the Avalon framework architecture instead.</b>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:51 $
   */
  
  public final class LifecycleException extends Exception {
  
  
      //------------------------------------------------------------ Constructors
  
  
      /**
       * Construct a new LifecycleException with no other information.
       */
      public LifecycleException() {
  
  	this(null, null);
  
      }
  
  
      /**
       * Construct a new LifecycleException for the specified message.
       *
       * @param message Message describing this exception
       */
      public LifecycleException(String message) {
  
  	this(message, null);
  
      }
  
  
      /**
       * Construct a new LifecycleException for the specified throwable.
       *
       * @param throwable Throwable that caused this exception
       */
      public LifecycleException(Throwable throwable) {
  
  	this(null, throwable);
  
      }
  
  
      /**
       * Construct a new LifecycleException for the specified message
       * and throwable.
       *
       * @param message Message describing this exception
       * @param throwable Throwable that caused this exception
       */
      public LifecycleException(String message, Throwable throwable) {
  
  	super();
  	this.message = message;
  	this.throwable = throwable;
  
      }
  
  
      //------------------------------------------------------ Instance Variables
  
  
      /**
       * The error message passed to our constructor (if any)
       */
      protected String message = null;
  
  
      /**
       * The underlying exception or error passed to our constructor (if any)
       */
      protected Throwable throwable = null;
  
  
      //---------------------------------------------------------- Public Methods
  
  
      /**
       * Returns the message associated with this exception, if any.
       */
      public String getMessage() {
  
  	return (message);
  
      }
  
  
      /**
       * Returns the throwable that caused this exception, if any.
       */
      public Throwable getThrowable() {
  
  	return (throwable);
  
      }
  
  
      /**
       * Return a formatted string that describes this exception.
       */
      public String toString() {
  
  	StringBuffer sb = new StringBuffer("LifecycleException:  ");
  	if (message != null) {
  	    sb.append(message);
  	    if (throwable != null) {
  		sb.append(":  ");
  	    }
  	}
  	if (throwable != null) {
  	    sb.append(throwable.toString());
  	}
  	return (sb.toString());
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Loader.java
  
  Index: Loader.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Loader.java,v
1.1 2000/01/20 06:32:51 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/20 06:32:51 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat;
  
  
  /**
   * A <b>Loader</b> represents a Java ClassLoader implementation that can
   * be used by a Container to load class files (within a repository associated
   * with the Loader) that are designed to be reloaded upon request, as well as
   * a mechanism to detect whether changes have occurred in the underlying
   * repository.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:51 $
   */
  
  public interface Loader {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Java class loader to be used by this Container.
       */
      public ClassLoader getClassLoader();
  
  
      /**
       * Return the Container with which this Logger has been associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Logger has been associated.
       *
       * @param container The associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Loader implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Has the internal repository associated with this Loader been modified,
       * such that the loaded classes should be reloaded?
       */
      public boolean modified();
  
  
      /**
       * Cause the underlying class loader (and therefore all of the classes
       * loaded by that class loader) to be thrown away, and creates a new one.
       */
      public void reload();
  
  
  }
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Logger.java
  
  Index: Logger.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Logger.java,v
1.1 2000/01/20 06:32:51 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/20 06:32:51 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat;
  
  
  /**
   * A <b>Logger</b> is a generic interface for the message and exception
   * logging methods of the ServletContext interface.  Loggers can be
   * attached at any Container level, but will typically only be attached
   * to a Context, or higher level, Container.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:51 $
   */
  
  public interface Logger {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Logger has been associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Logger has been associated.
       *
       * @param container The associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return descriptive information about this Logger implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Writes the specified message to a servlet log file, usually an event
       * log.  The name and type of the servlet log is specific to the
       * servlet container.
       *
       * @param msg A <code>String</code> specifying the message to be written
       *  to the log file
       */
      public void log(String msg);
  
  
      /**
       * Writes the specified exception, and message, to a servlet log file.
       * The implementation of this method should call
       * <code>log(msg, exception)</code> instead.  This method is deprecated
       * in the ServletContext interface, but not deprecated here to avoid
       * many useless compiler warnings.
       *
       * @param exception An <code>Exception</code> to be reported
       * @param msg The associated message string
       */
      public void log(Exception exception, String msg);
  
  
      /**
       * Writes an explanatory message and a stack trace for a given
       * <code>Throwable</code> exception to the servlet log file.  The name
       * and type of the servlet log file is specific to the servlet container,
       * usually an event log.
       *
       * @param message A <code>String</code> that describes the error or
       *  exception
       * @param throwable The <code>Throwable</code> error or exception
       */
      public void log(String message, Throwable throwable);
  
  
  }
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Manager.java
  
  Index: Manager.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Manager.java,v
1.1 2000/01/20 06:32:51 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/01/20 06:32:51 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:  
   *       "This product includes software developed by the 
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written 
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */ 
  
  
  package org.apache.tomcat;
  
  
  import java.io.IOException;
  import javax.servlet.http.Cookie;
  import javax.servlet.http.HttpSession;
  
  
  /**
   * A <b>Manager</b> manages the pool of Sessions that are associated with a
   * particular Container.  Different Manager implementations may support
   * value-added features such as the persistent storage of session data,
   * as well as migrating sessions for distributable web applications.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/01/20 06:32:51 $
   */
  
  public interface Manager {
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the Container with which this Manager is associated.
       */
      public Container getContainer();
  
  
      /**
       * Set the Container with which this Manager is associated.
       *
       * @param container The newly associated Container
       */
      public void setContainer(Container container);
  
  
      /**
       * Return the distributable flag for the sessions supported by
       * this Manager.
       */
      public boolean getDistributable();
  
  
      /**
       * Set the distributable flag for the sessions supported by this
       * Manager.  If this flag is set, all user data objects added to
       * sessions associated with this manager must implement Serializable.
       *
       * @param distributable The new distributable flag
       */
      public void setDistributable(boolean distributable);
  
  
      /**
       * Return descriptive information about this Manager implementation and
       * the corresponding version number, in the format
       * <code>&lt;description&gt;/&lt;version&gt;</code>.
       */
      public String getInfo();
  
  
      /**
       * Return the default maximum inactive interval (in seconds)
       * for Sessions created by this Manager.
       */
      public int getMaxInactiveInterval();
  
  
      /**
       * Set the default maximum inactive interval (in seconds)
       * for Sessions created by this Manager.
       *
       * @param interval The new default value
       */
      public void setMaxInactiveInterval(int interval);
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Construct and return a new session object, based on the default
       * settings specified by this Manager's properties.  The session
       * id will be assigned by this method, and available via the getId()
       * method of the returned session.  If a new session cannot be created
       * for any reason, return <code>null</code>.
       *
       * @exception IllegalStateException if a new session cannot be
       *  instantiated for any reason
       */
      public Session createSession();
  
  
      /**
       * Return the active Session, associated with this Manager, with the
       * specified session id (if any); otherwise return <code>null</code>.
       *
       * @param id The session id for the session to be returned
       *
       * @exception ClassNotFoundException if a deserialization error occurs
       *  while processing this request
       * @exception IllegalStateException if a new session cannot be
       *  instantiated for any reason
       * @exception IOException if an input/output error occurs while
       *  processing this request
       */
      public Session findSession(String id) throws IOException;
  
  
      /**
       * Return the set of active Sessions associated with this Manager.
       * If this Manager has no active Sessions, a zero-length array is returned.
       */
      public Session[] findSessions();
  
  
  }
  
  
  

Mime
View raw message