You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/05/10 01:59:41 UTC
cvs commit: jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/orion AbstractOrionContainer.java Orion1xContainer.java
cmlenz 2003/05/09 16:59:41
Modified: integration/ant/src/java/org/apache/cactus/integration/ant/container/orion
Tag: CACTUS_14_ANT_BRANCH Orion1xContainer.java
Added: integration/ant/src/java/org/apache/cactus/integration/ant/container/orion
Tag: CACTUS_14_ANT_BRANCH
AbstractOrionContainer.java
Log:
Add a base Orion support container
Revision Changes Path
No revision
No revision
1.1.2.3 +4 -162 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/orion/Attic/Orion1xContainer.java
Index: Orion1xContainer.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/orion/Attic/Orion1xContainer.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Orion1xContainer.java 7 May 2003 11:02:45 -0000 1.1.2.2
+++ Orion1xContainer.java 9 May 2003 23:59:41 -0000 1.1.2.3
@@ -56,18 +56,9 @@
*/
package org.apache.cactus.integration.ant.container.orion;
-import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
-import org.apache.cactus.integration.ant.container.AbstractJavaContainer;
-import org.apache.cactus.integration.ant.util.ResourceUtils;
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Java;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.FilterChain;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.util.FileUtils;
/**
* Special container support for the Orin 1.x application server.
@@ -76,48 +67,9 @@
*
* @version $Id$
*/
-public class Orion1xContainer extends AbstractJavaContainer
+public class Orion1xContainer extends AbstractOrionContainer
{
- // Instance Variables ------------------------------------------------------
-
- /**
- * The Orion 1.x installation directory.
- */
- private File dir;
-
- /**
- * The port to which the container should be bound.
- */
- private int port = 8080;
-
- /**
- * The temporary directory from which the container will be started.
- */
- private transient File tmpDir;
-
- // Public Methods ----------------------------------------------------------
-
- /**
- * Sets the Tomcat 4.x installation directory.
- *
- * @param theDir The directory to set
- */
- public final void setDir(File theDir)
- {
- this.dir = theDir;
- }
-
- /**
- * Sets the port to which the container should listen.
- *
- * @param thePort The port to set
- */
- public final void setPort(int thePort)
- {
- this.port = thePort;
- }
-
// AbstractContainer Implementation ----------------------------------------
/**
@@ -129,129 +81,19 @@
}
/**
- * Returns the port to which the container should listen.
- *
- * @return The port
- */
- public final int getPort()
- {
- return this.port;
- }
-
- /**
- * @see org.apache.cactus.integration.ant.container.Container#init
- */
- public final void init()
- {
- if (!this.dir.isDirectory())
- {
- throw new BuildException(this.dir + " is not a directory");
- }
- }
-
- /**
* @see org.apache.cactus.integration.ant.container.Container#startUp
*/
public final void startUp()
{
try
{
- prepare("cactus/orion1x");
-
- // invoke the main class
- Java java = createJavaForStartUp();
- Path classpath = java.createClasspath();
- FileSet fileSet = new FileSet();
- fileSet.setDir(this.dir);
- fileSet.createInclude().setName("*.jar");
- classpath.addFileset(fileSet);
- try
- {
- classpath.createPathElement().setLocation(getToolsJar());
- }
- catch (FileNotFoundException fnfe)
- {
- getLog().warn(
- "Couldn't find tools.jar (needed for JSP compilation)");
- }
- java.setClassname("com.evermind.server.ApplicationServer");
- java.createArg().setValue("-config");
- java.createArg().setFile(new File(tmpDir, "conf/server.xml"));
- java.execute();
+ prepare("orion1x", "cactus/orion1x");
+ invokeServer();
}
catch (IOException ioe)
{
throw new BuildException(ioe);
}
- }
-
- /**
- * @see org.apache.cactus.integration.ant.container.Container#shutDown
- */
- public final void shutDown()
- {
- // invoke the main class
- Java java = createJavaForShutDown();
- Path classpath = java.createClasspath();
- FileSet fileSet = new FileSet();
- fileSet.setDir(this.dir);
- fileSet.createInclude().setName("*.jar");
- classpath.addFileset(fileSet);
- java.setClassname("com.evermind.client.orion.OrionConsoleAdmin");
- java.createArg().setValue("ormi://localhost:23791/");
- java.createArg().setValue("admin");
- java.createArg().setValue("password");
- java.createArg().setValue("-shutdown");
- java.execute();
- }
-
- // Private Methods ---------------------------------------------------------
-
- /**
- * Prepares a temporary installation of the container and deploys the
- * web-application.
- *
- * @param theDirName The name of the temporary container installation
- * directory
- * @throws IOException If an I/O error occurs
- */
- private void prepare(String theDirName) throws IOException
- {
- FileUtils fileUtils = FileUtils.newFileUtils();
- FilterChain filterChain = createFilterChain();
-
- this.tmpDir = createTempDirectory(theDirName);
-
- // copy configuration files into the temporary container directory
- File confDir = createDirectory(tmpDir, "conf");
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/application.xml",
- new File(confDir, "application.xml"), filterChain);
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/default-web-site.xml",
- new File(confDir, "default-web-site.xml"), filterChain);
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/global-web-application.xml",
- new File(confDir, "global-web-application.xml"), filterChain);
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/mime.types",
- new File(confDir, "mime.types"), filterChain);
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/principals.xml",
- new File(confDir, "principals.xml"), filterChain);
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/rmi.xml",
- new File(confDir, "rmi.xml"), filterChain);
- ResourceUtils.copyResource(getProject(),
- RESOURCE_PATH + "orion1x/server.xml",
- new File(confDir, "server.xml"), filterChain);
-
- // Orion need to have a /persistence directory created, otherwise it
- // throws an error
- createDirectory(tmpDir, "persistence");
-
- fileUtils.copyFile(getWarFile(),
- new File(tmpDir, getWarFile().getName()), null, true);
}
}
No revision
No revision
1.1.2.1 +243 -0 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/container/orion/Attic/AbstractOrionContainer.java
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org