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/util InstanceSupport.java
Date Wed, 02 Aug 2000 18:53:48 GMT
craigmcc    00/08/02 11:53:48

  Modified:    proposals/catalina/src/share/org/apache/tomcat Wrapper.java
               proposals/catalina/src/share/org/apache/tomcat/core
                        StandardWrapper.java
  Added:       proposals/catalina/src/share/org/apache/tomcat
                        InstanceEvent.java InstanceListener.java
               proposals/catalina/src/share/org/apache/tomcat/util
                        InstanceSupport.java
  Log:
  Add support for interesting events related to specific instances of a servlet,
  rather than to the Wrapper component that contains it.  Listeners for these
  events can do things like save "thread local" information required to retrieve
  the correct JNDI Context information in a J2EE server.  The events which are
  supported include:
  * before init() is called
  * after init() returns
  * before destroy() is called
  * after destroy() returns.
  
  There is no mechanism yet to configure instance listeners from the server.xml
  configuration file yet.  That will come next.
  
  Revision  Changes    Path
  1.7       +20 -4     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java
  
  Index: Wrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Wrapper.java	2000/05/16 20:25:45	1.6
  +++ Wrapper.java	2000/08/02 18:53:46	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java,v
1.6 2000/05/16 20:25:45 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/05/16 20:25:45 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/Wrapper.java,v
1.7 2000/08/02 18:53:46 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/08/02 18:53:46 $
    *
    * ====================================================================
    *
  @@ -89,7 +89,7 @@
    * <code>IllegalArgumentException</code>.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/05/16 20:25:45 $
  + * @version $Revision: 1.7 $ $Date: 2000/08/02 18:53:46 $
    */
   
   public interface Wrapper extends Container {
  @@ -182,6 +182,14 @@
   
   
       /**
  +     * Add a new listener interested in InstanceEvents.
  +     *
  +     * @param listener The new listener
  +     */
  +    public void addInstanceListener(InstanceListener listener);
  +
  +
  +    /**
        * Add a new security role reference record to the set of records for
        * this servlet.
        *
  @@ -271,6 +279,14 @@
        * @param name Name of the initialization parameter to remove
        */
       public void removeInitParameter(String name);
  +
  +
  +    /**
  +     * Remove a listener no longer interested in InstanceEvents.
  +     *
  +     * @param listener The listener to remove
  +     */
  +    public void removeInstanceListener(InstanceListener listener);
   
   
       /**
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/InstanceEvent.java
  
  Index: InstanceEvent.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/InstanceEvent.java,v
1.1 2000/08/02 18:53:46 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/02 18:53:46 $
   *
   * ====================================================================
   *
   * 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.util.EventObject;
  import javax.servlet.Servlet;
  
  
  /**
   * General event for notifying listeners of significant events related to
   * a specific instance of a servlet, as opposed to the Wrapper component
   * that manages it.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/02 18:53:46 $
   */
  
  public final class InstanceEvent
      extends EventObject {
  
  
      // ----------------------------------------------------- Manifest Constants
  
  
      /**
       * The event indicating that the <code>init()</code> method is about
       * to be called for this instance.
       */
      public static final String BEFORE_INIT_EVENT = "beforeInit";
  
  
      /**
       * The event indicating that the <code>init()</code> method has returned.
       */
      public static final String AFTER_INIT_EVENT = "afterInit";
  
  
      /**
       * The event indicating that the <code>destroy</code> method is about
       * to be called for this instance.
       */
      public static final String BEFORE_DESTROY_EVENT = "beforeDestroy";
  
  
      /**
       * The event indicating that the <code>destroy()</code> method has
       * returned.
       */
      public static final String AFTER_DESTROY_EVENT = "afterDestroy";
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Construct a new InstanceEvent with the specified parameters.
       *
       * @param wrapper Wrapper managing this servlet instance
       * @param servlet Servlet instance for which this event occurred
       * @param type Event type (required)
       */
      public InstanceEvent(Wrapper wrapper, Servlet servlet, String type) {
  
        super(wrapper);
        this.wrapper = wrapper;
        this.servlet = servlet;
        this.type = type;
  
      }
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The Servlet instance for which this event occurred.
       */
      private Servlet servlet = null;
  
  
      /**
       * The event type this instance represents.
       */
      private String type = null;
  
  
      /**
       * The Wrapper managing the servlet instance for which this event occurred.
       */
      private Wrapper wrapper = null;
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * Return the servlet instance for which this event occurred.
       */
      public Servlet getServlet() {
  
  	return (this.servlet);
  
      }
  
  
      /**
       * Return the event type of this event.
       */
      public String getType() {
  
  	return (this.type);
  
      }
  
  
      /**
       * Return the Wrapper managing the servlet instance for which this
       * event occurred.
       */
      public Wrapper getWrapper() {
  
  	return (this.wrapper);
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/InstanceListener.java
  
  Index: InstanceListener.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/InstanceListener.java,v
1.1 2000/08/02 18:53:46 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/02 18:53:46 $
   *
   * ====================================================================
   *
   * 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;
  
  
  /**
   * Interface defining a listener for significant events related to a
   * specific servlet instance, rather than to the Wrapper component that
   * is managing that instance.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2000/08/02 18:53:46 $
   */
  
  public interface InstanceListener {
  
  
      /**
       * Acknowledge the occurrence of the specified event.
       *
       * @param event InstanceEvent that has occurred
       */
      public void instanceEvent(InstanceEvent event);
  
  
  }
  
  
  
  1.17      +53 -4     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- StandardWrapper.java	2000/07/29 18:21:51	1.16
  +++ StandardWrapper.java	2000/08/02 18:53:47	1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
1.16 2000/07/29 18:21:51 craigmcc Exp $
  - * $Revision: 1.16 $
  - * $Date: 2000/07/29 18:21:51 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
1.17 2000/08/02 18:53:47 craigmcc Exp $
  + * $Revision: 1.17 $
  + * $Date: 2000/08/02 18:53:47 $
    *
    * ====================================================================
    *
  @@ -77,6 +77,8 @@
   import javax.servlet.http.HttpServletResponse;
   import org.apache.tomcat.Container;
   import org.apache.tomcat.Context;
  +import org.apache.tomcat.InstanceEvent;
  +import org.apache.tomcat.InstanceListener;
   import org.apache.tomcat.Lifecycle;
   import org.apache.tomcat.LifecycleException;
   import org.apache.tomcat.Loader;
  @@ -84,6 +86,7 @@
   import org.apache.tomcat.Response;
   import org.apache.tomcat.Wrapper;
   import org.apache.tomcat.util.Enumerator;
  +import org.apache.tomcat.util.InstanceSupport;
   
   
   /**
  @@ -97,7 +100,7 @@
    * make them efficient are counter-productive.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.16 $ $Date: 2000/07/29 18:21:51 $
  + * @version $Revision: 1.17 $ $Date: 2000/08/02 18:53:47 $
    */
   
   public final class StandardWrapper
  @@ -157,6 +160,12 @@
   
   
       /**
  +     * The support object for our instance listeners.
  +     */
  +    private InstanceSupport instanceSupport = new InstanceSupport(this);
  +
  +
  +    /**
        * The context-relative URI of the JSP file for this servlet.
        */
       private String jspFile = null;
  @@ -445,6 +454,18 @@
   
   
       /**
  +     * Add a new listener interested in InstanceEvents.
  +     *
  +     * @param listener The new listener
  +     */
  +    public void addInstanceListener(InstanceListener listener) {
  +
  +        instanceSupport.addInstanceListener(listener);
  +
  +    }
  +
  +
  +    /**
        * Add a new security role reference record to the set of records for
        * this servlet.
        *
  @@ -681,15 +702,25 @@
   
   	// Call the initialization method of this servlet
   	try {
  +	    instanceSupport.fireInstanceEvent(InstanceEvent.BEFORE_INIT_EVENT,
  +					      servlet);
   	    servlet.init((ServletConfig) this);
  +	    instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
  +					      servlet);
   	} catch (UnavailableException f) {
  +	    instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
  +					      servlet);
   	    unavailable(f);
   	    throw f;
   	} catch (ServletException f) {
  +	    instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
  +					      servlet);
   	    // If the servlet wanted to be unavailable it would have
   	    // said so, so do not call unavailable(null).
   	    throw f;
   	} catch (Throwable f) {
  +	    instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
  +					      servlet);
   	    // If the servlet wanted to be unavailable it would have
   	    // said so, so do not call unavailable(null).
   	    throw new ServletException
  @@ -720,6 +751,18 @@
   
   
       /**
  +     * Remove a listener no longer interested in InstanceEvents.
  +     *
  +     * @param listener The listener to remove
  +     */
  +    public void removeInstanceListener(InstanceListener listener) {
  +
  +        instanceSupport.removeInstanceListener(listener);
  +
  +    }
  +
  +
  +    /**
        * Remove any security role reference for the specified role name.
        *
        * @param name Security role used within this servlet to be removed
  @@ -770,8 +813,14 @@
   
   	// Call the servlet destroy() method
   	try {
  +	    instanceSupport.fireInstanceEvent
  +	      (InstanceEvent.BEFORE_DESTROY_EVENT, instance);
   	    instance.destroy();
  +	    instanceSupport.fireInstanceEvent
  +	      (InstanceEvent.AFTER_DESTROY_EVENT, instance);
   	} catch (Throwable t) {
  +	    instanceSupport.fireInstanceEvent
  +	      (InstanceEvent.AFTER_DESTROY_EVENT, instance);
   	    instance = null;
   	    fireContainerEvent("unload", this);
   	    throw new ServletException
  
  
  
  1.1                  jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util/InstanceSupport.java
  
  Index: InstanceSupport.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/util/InstanceSupport.java,v
1.1 2000/08/02 18:53:47 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/08/02 18:53:47 $
   *
   * ====================================================================
   *
   * 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.util;
  
  
  import javax.servlet.Servlet;
  import org.apache.tomcat.InstanceEvent;
  import org.apache.tomcat.InstanceListener;
  import org.apache.tomcat.Wrapper;
  
  
  /**
   * Support class to assist in firing InstanceEvent notifications to
   * registered InstanceListeners.
   *
   * @author Craig R. McClanahan
   * @version $Id: InstanceSupport.java,v 1.1 2000/08/02 18:53:47 craigmcc Exp $
   */
  
  public final class InstanceSupport {
  
  
      // ----------------------------------------------------------- Constructors
  
  
      /**
       * Construct a new InstanceSupport object associated with the specified
       * Instance component.
       *
       * @param lifecycle The Instance component that will be the source
       *  of events that we fire
       */
      public InstanceSupport(Wrapper wrapper) {
  
  	super();
  	this.wrapper = wrapper;
  
      }
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The set of registered InstanceListeners for event notifications.
       */
      private InstanceListener listeners[] = new InstanceListener[0];
  
  
      /**
       * The source component for instance events that we will fire.
       */
      private Wrapper wrapper = null;
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add a lifecycle event listener to this component.
       *
       * @param listener The listener to add
       */
      public void addInstanceListener(InstanceListener listener) {
  
        synchronized (listeners) {
  	  InstanceListener results[] =
  	    new InstanceListener[listeners.length + 1];
  	  for (int i = 0; i < listeners.length; i++)
  	      results[i] = listeners[i];
  	  results[listeners.length] = listener;
  	  listeners = results;
        }
  
      }
  
  
      /**
       * Notify all lifecycle event listeners that a particular event has
       * occurred for this Container.  The default implementation performs
       * this notification synchronously using the calling thread.
       *
       * @param type Event type
       * @param data Event data
       */
      public void fireInstanceEvent(String type, Servlet servlet) {
  
  	InstanceEvent event = new InstanceEvent(wrapper, servlet, type);
  	InstanceListener interested[] = null;
  	synchronized (listeners) {
  	    interested = (InstanceListener[]) listeners.clone();
  	}
  	for (int i = 0; i < interested.length; i++)
  	    interested[i].instanceEvent(event);
  
      }
  
  
      /**
       * Remove a lifecycle event listener from this component.
       *
       * @param listener The listener to remove
       */
      public void removeInstanceListener(InstanceListener listener) {
  
          synchronized (listeners) {
  	    int n = -1;
  	    for (int i = 0; i < listeners.length; i++) {
  	        if (listeners[i] == listener) {
  		    n = i;
  		    break;
  		}
  	    }
  	    if (n < 0)
  	        return;
  	    InstanceListener results[] =
  	      new InstanceListener[listeners.length - 1];
  	    int j = 0;
  	    for (int i = 0; i < listeners.length; i++) {
  	        if (i != n)
  		    results[j++] = listeners[i];
  	    }
  	    listeners = results;
  	}
  
      }
  
  
  }
  
  
  

Mime
View raw message