remm        2004/07/28 11:02:15

  Modified:    modules/cluster/src/share/org/apache/catalina/cluster/deploy
                        FarmWarDeployer.java
               catalina/src/share/org/apache/catalina Context.java
               catalina/src/share/org/apache/catalina/core
                        StandardHost.java
               modules/cluster/src/share/org/apache/catalina/cluster
                        ClusterDeployer.java
               modules/cluster/src/share/org/apache/catalina/cluster/tcp
                        SimpleTcpCluster.java
  Removed:     catalina/src/share/org/apache/catalina Deployer.java
               catalina/src/share/org/apache/catalina/core
                        StandardHostDeployer.java
  Log:
  - Remove Deployer.
  - The cluster farm code will needs some updates.
  
  Revision  Changes    Path
  1.2       +12 -10    
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java
  
  Index: FarmWarDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FarmWarDeployer.java      4 Jun 2004 20:22:27 -0000       1.1
  +++ FarmWarDeployer.java      28 Jul 2004 18:02:15 -0000      1.2
  @@ -20,7 +20,6 @@
   import org.apache.catalina.cluster.ClusterMessage;
   import org.apache.catalina.cluster.CatalinaCluster;
   import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.Deployer;
   import java.io.File;
   import java.net.URL;
   import java.io.IOException;
  @@ -51,7 +50,6 @@
           org.apache.commons.logging.LogFactory.getLog(FarmWarDeployer.class);
       /*--Instance Variables--------------------------------------*/
       protected CatalinaCluster cluster = null;
  -    protected Deployer deployer = null;
       protected boolean started = false; //default 5 seconds
       protected HashMap fileFactories = new HashMap();
       protected String deployDir;
  @@ -108,6 +106,8 @@
                           name = name + ".war";
                       File deployable = new File(getDeployDir(), name);
                       factory.getFile().renameTo(deployable);
  +                    // FIXME
  +                    /*
                       try {
                           if (getDeployer().findDeployedApp(fmsg.getContextPath()) != 
null)
                               getDeployer().remove(fmsg.getContextPath(), true);
  @@ -118,13 +118,17 @@
                       }
                       getDeployer().install(fmsg.getContextPath(),
                                             deployable.toURL());
  +                                          */
                       removeFactory(fmsg);
                   } //end if
               } else if (msg instanceof UndeployMessage && msg != null) {
                   UndeployMessage umsg = (UndeployMessage) msg;
  +                // FIXME
  +                /*
                   if (getDeployer().findDeployedApp(umsg.getContextPath()) != null)
                       getDeployer().remove(umsg.getContextPath(),
                                            umsg.getUndeploy());
  +                                         */
               } //end if
           } catch (java.io.IOException x) {
               log.error("Unable to read farm deploy file message.", x);
  @@ -190,10 +194,13 @@
        *  during installation
        */
       public void install(String contextPath, URL war) throws IOException {
  +     // FIXME
  +     /*
           if (getDeployer().findDeployedApp(contextPath) != null)
               getDeployer().remove(contextPath, true);
               //step 1. Install it locally
           getDeployer().install(contextPath, war);
  +        */
           //step 2. Send it to each member in the cluster
           Member[] members = getCluster().getMembers();
           Member localMember = getCluster().getLocalMember();
  @@ -231,8 +238,11 @@
       public void remove(String contextPath, boolean undeploy) throws IOException {
           log.info("Cluster wide remove of web app " + contextPath);
           //step 1. Remove it locally
  +        // FIXME
  +        /*
           if (getDeployer().findDeployedApp(contextPath) != null)
               getDeployer().remove(contextPath, undeploy);
  +            */
               //step 2. Send it to each member in the cluster
           Member[] members = getCluster().getMembers();
           Member localMember = getCluster().getLocalMember();
  @@ -284,10 +294,6 @@
           this.cluster = cluster;
       }
   
  -    public void setDeployer(Deployer deployer) {
  -        this.deployer = deployer;
  -    }
  -
       public boolean equals(Object listener) {
           return super.equals(listener);
       }
  @@ -310,10 +316,6 @@
   
       public void setTempDir(String tempDir) {
           this.tempDir = tempDir;
  -    }
  -
  -    public Deployer getDeployer() {
  -        return deployer;
       }
   
       public String getWatchDir() {
  
  
  
  1.17      +1 -6      
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Context.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Context.java      26 Jul 2004 16:04:02 -0000      1.16
  +++ Context.java      28 Jul 2004 18:02:15 -0000      1.17
  @@ -23,11 +23,6 @@
   import org.apache.tomcat.util.http.mapper.Mapper;
   
   import org.apache.catalina.deploy.ApplicationParameter;
  -import org.apache.catalina.deploy.ContextEjb;
  -import org.apache.catalina.deploy.ContextEnvironment;
  -import org.apache.catalina.deploy.ContextLocalEjb;
  -import org.apache.catalina.deploy.ContextResource;
  -import org.apache.catalina.deploy.ContextResourceLink;
   import org.apache.catalina.deploy.ErrorPage;
   import org.apache.catalina.deploy.FilterDef;
   import org.apache.catalina.deploy.FilterMap;
  
  
  
  1.32      +2 -246    
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- StandardHost.java 26 May 2004 15:41:07 -0000      1.31
  +++ StandardHost.java 28 Jul 2004 18:02:15 -0000      1.32
  @@ -28,7 +28,6 @@
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
   import org.apache.catalina.DefaultContext;
  -import org.apache.catalina.Deployer;
   import org.apache.catalina.Host;
   import org.apache.catalina.LifecycleException;
   import org.apache.catalina.Valve;
  @@ -48,7 +47,7 @@
   
   public class StandardHost
       extends ContainerBase
  -    implements Deployer, Host  
  +    implements Host  
    {
       /* Why do we implement deployer and delegate to deployer ??? */
   
  @@ -107,13 +106,6 @@
   
   
       /**
  -     * The <code>Deployer</code> to whom we delegate application
  -     * deployment requests.
  -     */
  -    private Deployer deployer = null;
  -
  -
  -    /**
        * The deploy on startup flag for this Host.
        */
       private boolean deployOnStartup = true;
  @@ -800,242 +792,6 @@
           lifecycle.fireLifecycleEvent("check", null);
       }
   
  -
  -    // ------------------------------------------------------- Deployer Methods
  -
  -
  -    /**
  -     * Install a new web application, whose web application archive is at the
  -     * specified URL, into this container with the specified context path.
  -     * A context path of "" (the empty string) should be used for the root
  -     * application for this container.  Otherwise, the context path must
  -     * start with a slash.
  -     * <p>
  -     * If this application is successfully installed, a ContainerEvent of type
  -     * <code>INSTALL_EVENT</code> will be sent to all registered listeners,
  -     * with the newly created <code>Context</code> as an argument.
  -     *
  -     * @param contextPath The context path to which this application should
  -     *  be installed (must be unique)
  -     * @param war A URL of type "jar:" that points to a WAR file, or type
  -     *  "file:" that points to an unpacked directory structure containing
  -     *  the web application to be installed
  -     *
  -     * @exception IllegalArgumentException if the specified context path
  -     *  is malformed (it must be "" or start with a slash)
  -     * @exception IllegalStateException if the specified context path
  -     *  is already attached to an existing web application
  -     * @exception IOException if an input/output error was encountered
  -     *  during install
  -     */
  -    public void install(String contextPath, URL war) throws IOException {
  -        getDeployer().install(contextPath, war);
  -
  -    }
  -
  -
  -    /**
  -     * <p>Install a new web application, whose context configuration file
  -     * (consisting of a <code>&lt;Context&gt;</code> element) and web
  -     * application archive are at the specified URLs.</p>
  -     *
  -     * <p>If this application is successfully installed, a ContainerEvent
  -     * of type <code>INSTALL_EVENT</code> will be sent to all registered
  -     * listeners, with the newly created <code>Context</code> as an argument.
  -     * </p>
  -     *
  -     * @param config A URL that points to the context configuration file to
  -     *  be used for configuring the new Context
  -     * @param war A URL of type "jar:" that points to a WAR file, or type
  -     *  "file:" that points to an unpacked directory structure containing
  -     *  the web application to be installed
  -     *
  -     * @exception IllegalArgumentException if one of the specified URLs is
  -     *  null
  -     * @exception IllegalStateException if the context path specified in the
  -     *  context configuration file is already attached to an existing web
  -     *  application
  -     * @exception IOException if an input/output error was encountered
  -     *  during installation
  -     */
  -    public synchronized void install(URL config, URL war) throws IOException {
  -
  -        getDeployer().install(config, war);
  -
  -    }
  -
  -
  -    /**
  -     * Installs a new web application from the web application archive at the
  -     * specified URL, which must contain a META-INF/context.xml context
  -     * configuration file (consisting of a <code>&lt;Context&gt;</code>
  -     * element).
  -     *
  -     * <p>The web application is installed at the path specified inside the 
  -     * embedded META-INF/context.xml. The docBase (if any) specified inside the
  -     * embedded META-INF/context.xml is overridden with the web application's
  -     * location.
  -     *
  -     * <p>If the installation succeeds, a ContainerEvent of type
  -     * <code>INSTALL_EVENT</code> is sent to all registered listeners,
  -     * with the newly created <code>Context</code> as its argument.
  -     *
  -     * @param war URL pointing to web application location (WAR-packaged or
  -     *        unpacked directory)
  -     *
  -     * @exception IllegalArgumentException if <code>war</code> is null, or if
  -     *            this StandardHost does not support any context.xml
  -     *            configuration files
  -     * @exception IllegalStateException if the context path specified in the
  -     *            context configuration file is already in use by an existing
  -     *            web application
  -     * @exception IOException if an input/output error was encountered
  -     *            during installation
  -     */
  -    public synchronized void install(URL war) throws IOException {
  -
  -        getDeployer().install(war);
  -
  -    }
  -
  -
  -    /**
  -     * Return the Context for the deployed application that is associated
  -     * with the specified context path (if any); otherwise return
  -     * <code>null</code>.
  -     *
  -     * @param contextPath The context path of the requested web application
  -     */
  -    public Context findDeployedApp(String contextPath) {
  -
  -        return (getDeployer().findDeployedApp(contextPath));
  -
  -    }
  -
  -
  -    /**
  -     * Return the context paths of all deployed web applications in this
  -     * Container.  If there are no deployed applications, a zero-length
  -     * array is returned.
  -     */
  -    public String[] findDeployedApps() {
  -
  -        return (getDeployer().findDeployedApps());
  -
  -    }
  -
  -
  -    /**
  -     * Remove an existing web application, attached to the specified context
  -     * path.  If this application is successfully removed, a
  -     * ContainerEvent of type <code>REMOVE_EVENT</code> will be sent to all
  -     * registered listeners, with the removed <code>Context</code> as
  -     * an argument.
  -     *
  -     * @param contextPath The context path of the application to be removed
  -     *
  -     * @exception IllegalArgumentException if the specified context path
  -     *  is malformed (it must be "" or start with a slash)
  -     * @exception IllegalArgumentException if the specified context path does
  -     *  not identify a currently installed web application
  -     * @exception IOException if an input/output error occurs during
  -     *  removal
  -     */
  -    public void remove(String contextPath) throws IOException {
  -
  -        getDeployer().remove(contextPath);
  -
  -    }
  -
  -
  -    /**
  -     * Remove an existing web application, attached to the specified context
  -     * path.  If this application is successfully removed, a
  -     * ContainerEvent of type <code>REMOVE_EVENT</code> will be sent to all
  -     * registered listeners, with the removed <code>Context</code> as
  -     * an argument. Deletes the web application war file and/or directory
  -     * if they exist in the Host's appBase.
  -     *
  -     * @param contextPath The context path of the application to be removed
  -     * @param undeploy boolean flag to remove web application from server
  -     *
  -     * @exception IllegalArgumentException if the specified context path
  -     *  is malformed (it must be "" or start with a slash)
  -     * @exception IllegalArgumentException if the specified context path does
  -     *  not identify a currently installed web application
  -     * @exception IOException if an input/output error occurs during
  -     *  removal
  -     */
  -    public void remove(String contextPath, boolean undeploy) throws IOException {
  -
  -        getDeployer().remove(contextPath,undeploy);
  -
  -    }
  -
  -
  -    /**
  -     * Start an existing web application, attached to the specified context
  -     * path.  Only starts a web application if it is not running.
  -     *
  -     * @param contextPath The context path of the application to be started
  -     *
  -     * @exception IllegalArgumentException if the specified context path
  -     *  is malformed (it must be "" or start with a slash)
  -     * @exception IllegalArgumentException if the specified context path does
  -     *  not identify a currently installed web application
  -     * @exception IOException if an input/output error occurs during
  -     *  startup
  -     */
  -    public void start(String contextPath) throws IOException {
  -
  -        getDeployer().start(contextPath);
  -
  -    }
  -
  -
  -    /**
  -     * Stop an existing web application, attached to the specified context
  -     * path.  Only stops a web application if it is running.
  -     *
  -     * @param contextPath The context path of the application to be stopped
  -     *
  -     * @exception IllegalArgumentException if the specified context path
  -     *  is malformed (it must be "" or start with a slash)
  -     * @exception IllegalArgumentException if the specified context path does
  -     *  not identify a currently installed web application
  -     * @exception IOException if an input/output error occurs while stopping
  -     *  the web application
  -     */
  -    public void stop(String contextPath) throws IOException {
  -
  -        getDeployer().stop(contextPath);
  -
  -    }
  -
  -
  -    // ------------------------------------------------------ Protected Methods
  -
  -
  -    static String 
STANDARD_HOST_DEPLOYER="org.apache.catalina.core.StandardHostDeployer";
  -    
  -    public Deployer getDeployer() {
  -        if( deployer!= null )
  -            return deployer;
  -        log.info( "Create Host deployer for direct deployment ( non-jmx ) ");
  -        try {
  -            Class c=Class.forName( STANDARD_HOST_DEPLOYER );
  -            deployer=(Deployer)c.newInstance();
  -            Method m=c.getMethod("setHost", new Class[] {Host.class} );
  -            m.invoke( deployer,  new Object[] { this } );
  -        } catch( Throwable t ) {
  -            log.error( "Error creating deployer ", t);
  -        }
  -        return deployer;
  -    }
  -    
  -    public void setDeployer(Deployer d) {
  -        this.deployer=d;
  -    }
   
       // -------------------- JMX  --------------------
       /**
  
  
  
  1.2       +3 -3      
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterDeployer.java
  
  Index: ClusterDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterDeployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClusterDeployer.java      4 Jun 2004 20:22:27 -0000       1.1
  +++ ClusterDeployer.java      28 Jul 2004 18:02:15 -0000      1.2
  @@ -24,7 +24,6 @@
    * @version $Revision$, $Date$
    */
   import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.Deployer;
   import java.io.IOException;
   import java.net.URL;
   
  @@ -61,7 +60,8 @@
        * Sets the deployer for this cluster deployer to use.
        * @param deployer Deployer
        */
  -    public void setDeployer(Deployer deployer);
  +    // FIXME
  +    //public void setDeployer(Deployer deployer);
   
       /**
        * Install a new web application, whose web application archive is at the
  
  
  
  1.46      +2 -3      
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java
  
  Index: SimpleTcpCluster.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/SimpleTcpCluster.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- SimpleTcpCluster.java     22 Jul 2004 15:41:15 -0000      1.45
  +++ SimpleTcpCluster.java     28 Jul 2004 18:02:15 -0000      1.46
  @@ -366,8 +366,7 @@
                   if ( clusterDeployer != null ) {
                       clusterDeployer.setCluster(this);
                       Object deployer = 
IntrospectionUtils.getProperty(getContainer(), "deployer");
  -                    clusterDeployer.setDeployer( (org.apache.catalina.Deployer)
  -                                                deployer);
  +                    // FIXME: clusterDeployer.setDeployer( 
(org.apache.catalina.Deployer) deployer);
                      clusterDeployer.start();
                   }
               } catch (Throwable x) {
  
  
  

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

Reply via email to