details:   https://code.openbravo.com/erp/devel/pi/rev/faf7ea329834
changeset: 34838:faf7ea329834
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Oct 11 09:26:50 2018 +0200
summary:   fixed issue 39141: removed ant tomcat.reload task

  This task is unused for years now.

details:   https://code.openbravo.com/erp/devel/pi/rev/44a01083360d
changeset: 34839:44a01083360d
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Oct 11 10:01:13 2018 +0200
summary:   fixed issue 39140: removed restart option from smartbuild

diffstat:

 build.xml                                           |  32 +--------
 src/org/openbravo/service/system/ReloadContext.java |  78 ---------------------
 2 files changed, 2 insertions(+), 108 deletions(-)

diffs (152 lines):

diff -r cd8309678ebc -r 44a01083360d build.xml
--- a/build.xml Thu Oct 11 08:57:47 2018 +0200
+++ b/build.xml Thu Oct 11 10:01:13 2018 +0200
@@ -426,11 +426,6 @@
     <ant dir="${base.db}" target="setApplied" inheritAll="true" 
inheritRefs="true" />
     <antcall target="build.deploy" />
     <updatesystemstatuswhennot v="RB51" previous="RB12"/>
-    <!-- only restart tomcat if the restart prop was set to true -->
-    <condition property="dorestart">
-      <istrue value="${restart}" />
-    </condition>
-    <antcall target="if.restart.tomcat" />
   </target>
 
   <target name="update.database.if.no.local" if="no.local">
@@ -459,10 +454,6 @@
     <antcall target="war" />
   </target>
 
-  <target name="if.restart.tomcat" if="dorestart">
-    <antcall target="tomcat.restart" />
-  </target>
-
   <target name="compile" depends="init,core.lib, wad.lib, trl.lib">
     <ant dir="${base.src}" target="compile" inheritAll="true" 
inheritRefs="true" />
   </target>
@@ -807,7 +798,7 @@
                This task is called from the Openbravo ui, it spawns a java 
call which again
                calls the restart.tomcat.do task as a spawned task.
        -->
-  <target name="tomcat.restart" description="Restart the tomcat server 
process">
+  <target name="tomcat.restart">
     <echo message="Restarting tomcat..." />
     <java classname="org.openbravo.service.system.RestartTomcat" spawn="true" 
fork="true" maxmemory="${build.maxmemory}">
       <arg line="${base.src}" />
@@ -818,7 +809,7 @@
   <!--
                Is called by the org.openbravo.service.system.RestartTomcat 
class.
        -->
-  <target name="tomcat.restart.do" description="Restart the tomcat server 
process">
+  <target name="tomcat.restart.do">
     <echo message="Restarting Tomcat at ${env.CATALINA_HOME}" />
     <java classname="org.apache.catalina.startup.Bootstrap" fork="true">
       <classpath 
path=":${env.CATALINA_HOME}/bin/bootstrap.jar:${env.CATALINA_HOME}/bin/commons-logging-api.jar:${env.CATALINA_HOME}/bin/tomcat-juli.jar"
 />
@@ -844,25 +835,6 @@
     </java>
   </target>
 
-  <!-- 
-               This task is called from the Openbravo ui, it spawns a java 
call which again
-               calls the tomcat.reload.do task as a spawned task.
-       -->
-  <target name="tomcat.reload" description="Reload the Openbravo context">
-    <echo message="Reloading webapp..." />
-    <java classname="org.openbravo.service.system.ReloadContext" 
jvm="${env.JAVA_HOME}/bin/java" maxmemory="${build.maxmemory}" spawn="true" 
fork="true">
-      <arg line="${base.src}" />
-      <classpath refid="project.class.path" />
-    </java>
-  </target>
-
-  <target name="tomcat.reload.do">
-    <taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
-      <classpath refid="project.class.path" />
-    </taskdef>
-    <reload url="${tomcat.manager.url}" username="${tomcat.manager.username}" 
password="${tomcat.manager.password}" path="/${context.name}" />
-  </target>
-
   <target name="tomcat.list">
     <taskdef name="list" classname="org.apache.catalina.ant.ListTask">
       <classpath refid="project.class.path" />
diff -r cd8309678ebc -r 44a01083360d 
src/org/openbravo/service/system/ReloadContext.java
--- a/src/org/openbravo/service/system/ReloadContext.java       Thu Oct 11 
08:57:47 2018 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
- *************************************************************************
- * The contents of this file are subject to the Openbravo  Public  License
- * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
- * Version 1.1  with a permitted attribution clause; you may not  use this
- * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
- * Software distributed under the License  is  distributed  on  an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2010 Openbravo SLU 
- * All Rights Reserved. 
- * Contributor(s):  ______________________________________.
- ************************************************************************
- */
-
-package org.openbravo.service.system;
-
-import java.io.File;
-
-import org.apache.log4j.Logger;
-import org.openbravo.base.exception.OBException;
-import org.openbravo.base.session.OBPropertiesProvider;
-
-/**
- * Reloads the tomcat using the tomcat reload ant task.
- * 
- * @author mtaal
- */
-public class ReloadContext {
-  private static final Logger log = Logger.getLogger(ReloadContext.class);
-
-  /**
-   * Method is called from the tomcat.reload tasks, this method again starts 
the tomcat.reload.do
-   * task.Note: this method should always use the AntExecutor in 
org.openbravo.erpCommon.utility, to
-   * prevent problems when upgrading Core to a newer version
-   * 
-   * @param args
-   *          arg[0] contains the source path
-   * @throws Exception
-   */
-  @SuppressWarnings("deprecation")
-  public static void main(String[] args) throws Exception {
-    final String srcPath = args[0];
-    final File srcDir = new File(srcPath);
-    final File baseDir = srcDir.getParentFile();
-    try {
-      log.debug("Reloading context with basedir " + baseDir);
-      final org.openbravo.erpCommon.utility.AntExecutor antExecutor = new 
org.openbravo.erpCommon.utility.AntExecutor(
-          baseDir.getAbsolutePath());
-      antExecutor.runTask("tomcat.reload.do");
-    } catch (final Exception e) {
-      throw new OBException(e);
-    }
-  }
-
-  /**
-   * Restarts the tomcat server. Assumes the the Openbravo.properties are 
available through the
-   * {@link OBPropertiesProvider}.Note: this method should always use the 
AntExecutor in
-   * org.openbravo.erpCommon.utility, to prevent problems when upgrading Core 
to a newer version
-   */
-  @SuppressWarnings("deprecation")
-  public static void reload() {
-    final String baseDirPath = 
OBPropertiesProvider.getInstance().getOpenbravoProperties()
-        .getProperty("source.path");
-    try {
-      log.debug("Reloading context with basedir " + baseDirPath);
-      final org.openbravo.erpCommon.utility.AntExecutor antExecutor = new 
org.openbravo.erpCommon.utility.AntExecutor(
-          baseDirPath);
-      antExecutor.runTask("tomcat.reload");
-    } catch (final Exception e) {
-      throw new OBException(e);
-    }
-  }
-}


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to