Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.Java


    {
        try
        {
            prepare("cactus/weblogic7x");
           
            Java java = createJavaForStartUp();
            java.setDir(new File(this.tmpDir, "testdomain"));
           
            java.createJvmarg().setValue("-hotspot");
            java.createJvmarg().setValue("-Xms32m");
            java.createJvmarg().setValue("-Xmx200m");
           
            File serverDir = new File(this.dir, "server");
           
            java.addSysproperty(
                createSysProperty("weblogic.Name", "testserver"));
            java.addSysproperty(
                createSysProperty("bea.home", this.beaHome));
            java.addSysproperty(
                createSysProperty("weblogic.management.username", "weblogic"));
            java.addSysproperty(
                createSysProperty("weblogic.management.password", "weblogic"));
            java.addSysproperty(
                createSysProperty("java.security.policy",
                    "=./server/lib/weblogic.policy"));

            Path classpath = java.createClasspath();
            classpath.createPathElement().setLocation(
                new File(serverDir, "lib/weblogic_sp.jar"));
            classpath.createPathElement().setLocation(
                new File(serverDir, "lib/weblogic.jar"));

            java.setClassname("weblogic.Server");
            java.execute();
        }
        catch (IOException ioe)
        {
            getLog().error("Failed to startup the container", ioe);
            throw new BuildException(ioe);
View Full Code Here


    /**
     * @see org.apache.cactus.integration.ant.container.Container#shutDown
     */
    public final void shutDown()
    {
        Java java = createJavaForShutDown();
           
        File serverDir = new File(this.dir, "server");

        Path classpath = java.createClasspath();
        classpath.createPathElement().setLocation(
            new File(serverDir, "lib/weblogic_sp.jar"));
        classpath.createPathElement().setLocation(
            new File(serverDir, "lib/weblogic.jar"));

        java.setClassname("weblogic.Admin");
        java.createArg().setValue("-url");
        java.createArg().setValue("t3://localhost:" + getPort());
        java.createArg().setValue("-username");
        java.createArg().setValue("weblogic");
        java.createArg().setValue("-password");
        java.createArg().setValue("weblogic");
        java.createArg().setValue("SHUTDOWN");
        java.execute();
    }
View Full Code Here

     * @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();
    }
View Full Code Here

     * Invokes the command to start the Orion application server.
     */
    protected final void invokeServer()
    {
        // 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();
    }
View Full Code Here

     *
     * @param theArg Either 'start' or 'stop'
     */
    protected final void invokeBootstrap(String theArg)
    {
        Java java = null;
        if ("start".equals(theArg))
        {
            java = createJavaForStartUp();
        }
        else
        {
            java = createJavaForShutDown();
        }
        java.addSysproperty(createSysProperty("catalina.home", getDir()));
        java.addSysproperty(createSysProperty("catalina.base", this.tmpDir));
        Path classpath = java.createClasspath();
        classpath.createPathElement().setLocation(
            new File(getDir(), "bin/bootstrap.jar"));
        try
        {
            classpath.createPathElement().setLocation(getToolsJar());
        }
        catch (FileNotFoundException fnfe)
        {
            getLog().warn(
                "Couldn't find tools.jar (needed for JSP compilation)");
        }
        java.setClassname("org.apache.catalina.startup.Bootstrap");
        java.createArg().setValue(theArg);
        java.execute();
    }
View Full Code Here

        try
        {
            prepare("cactus/resin2x");
           
            // invoke the main class
            Java java = createJavaForStartUp();
            java.addSysproperty(createSysProperty("resin.home", this.tmpDir));
            Path classpath = java.createClasspath();
            classpath.createPathElement().setLocation(
                ResourceUtils.getResourceLocation("/"
                    + ResinRun.class.getName().replace('.', '/') + ".class"));
            FileSet fileSet = new FileSet();
            fileSet.setDir(this.dir);
            fileSet.createInclude().setName("lib/*.jar");
            classpath.addFileset(fileSet);
            java.setClassname(ResinRun.class.getName());
            java.createArg().setValue("-start");
            java.createArg().setValue("-conf");
            java.createArg().setFile(new File(tmpDir, "resin.conf"));
            java.execute();
        }
        catch (IOException ioe)
        {
            getLog().error("Failed to startup the container", ioe);
            throw new BuildException(ioe);
View Full Code Here

     * @see org.apache.cactus.integration.ant.container.Container#shutDown
     */
    public final void shutDown()
    {
        // invoke the main class
        Java java = createJavaForShutDown();
        java.setFork(true);
        java.addSysproperty(createSysProperty("resin.home", this.tmpDir));
        Path classpath = java.createClasspath();
        classpath.createPathElement().setLocation(
            ResourceUtils.getResourceLocation("/"
                + ResinRun.class.getName().replace('.', '/') + ".class"));
        FileSet fileSet = new FileSet();
        fileSet.setDir(this.dir);
        fileSet.createInclude().setName("lib/*.jar");
        classpath.addFileset(fileSet);
        java.setClassname(ResinRun.class.getName());
        java.createArg().setValue("-stop");
        java.execute();
    }
View Full Code Here

            prepare("cactus/jboss3x");
           
            File binDir = new File(this.dir, "bin");
            File configDir = new File(this.dir, "server");
           
            Java java = createJavaForStartUp();
            java.setDir(binDir);
           
            java.addSysproperty(
                createSysProperty("program.name",
                    new File(binDir, "run.bat")));
            java.addSysproperty(
                createSysProperty("jboss.server.home.dir",
                    new File(configDir, this.config)));
            java.addSysproperty(
                createSysProperty("jboss.server.home.url",
                    new File(configDir, this.config).toURL().toString()));

            Path classPath = java.createClasspath();
            classPath.createPathElement().setLocation(
                new File(binDir, "run.jar"));
            try
            {
                classPath.createPathElement().setLocation(getToolsJar());
            }
            catch (FileNotFoundException fnfe)
            {
                getLog().warn(
                    "Couldn't find tools.jar (needed for JSP compilation)");
            }

            java.setClassname("org.jboss.Main");
            java.createArg().setValue("-c");
            java.createArg().setValue(this.config);
            java.execute();
        }
        catch (IOException ioe)
        {
            getLog().error("Failed to startup the container", ioe);
            throw new BuildException(ioe);
View Full Code Here

     */
    public final void shutDown()
    {
        File binDir = new File(this.dir, "bin");
           
        Java java = createJavaForShutDown();
        java.setFork(true);

        Path classPath = java.createClasspath();
        classPath.createPathElement().setLocation(
            new File(binDir, "shutdown.jar"));

        java.setClassname("org.jboss.Shutdown");
        if (this.version.startsWith("3.2"))
        {
            java.createArg().setValue("--shutdown");
        }
        else
        {
            java.createArg().setValue("localhost");
            java.createArg().setValue(String.valueOf(getPort()));
        }
        java.execute();
    }
View Full Code Here

     *
     * @return The created task instance
     */
    protected final Java createJavaForShutDown()
    {
        Java java = (Java) createAntTask("java");
        java.setFork(true);
        return java;
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.Java

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.