Package org.apache.geronimo.mavenplugins.geronimo

Examples of org.apache.geronimo.mavenplugins.geronimo.ServerProxy


    static {
        geronimoHome = getGeronimoHome();
    }
       
    private static String getGeronimoHome() {
        ServerProxy server = null;
        try {
            server = new ServerProxy("localhost", 1099, "system", "manager");          
        } catch (Exception e) {
            throw new RuntimeException("Unable to setup ServerProxy", e);
        }
       
        String home = server.getGeronimoHome();
        Throwable exception = server.getLastError();
       
        server.closeConnection();
       
        if (exception != null) {
            throw new RuntimeException("Failed to get Geronimo home", exception);
        } else {
            return home;
View Full Code Here


    static {
        geronimoHome = getGeronimoHome();
    }
       
    private static String getGeronimoHome() {
        ServerProxy server = null;
        try {
            server = new ServerProxy("localhost", 1099, "system", "manager");          
        } catch (Exception e) {
            throw new RuntimeException("Unable to setup ServerProxy", e);
        }
       
        String home = server.getGeronimoHome();
        Throwable exception = server.getLastError();
       
        server.closeConnection();
       
        if (exception != null) {
            throw new RuntimeException("Failed to get Geronimo home", exception);
        } else {
            return home;
View Full Code Here

            }
            timer.schedule(timeoutTask, verifyTimeout * 1000);
        }

        // Verify server started
        ServerProxy server = new ServerProxy(hostname, port, username, password);
        boolean started = false;
        while (!started) {
            if (verifyTimedOut.isSet()) {
                throw new MojoExecutionException("Unable to verify if the server was started in the given time (" + verifyTimeout + " seconds)");
            }

            if (errorHolder.isSet()) {
                throw new MojoExecutionException("Failed to start Geronimo server", (Throwable)errorHolder.get());
            }

            started = server.isFullyStarted();

            if (!started) {
                Throwable error = server.getLastError();
                if ((error != null) && (log.isDebugEnabled())) {
                    log.debug("Server query failed; ignoring", error);
                }

                Thread.sleep(5 * 1000);
            }
        }
        server.closeConnection();

        // Stop the timer, server should be up now
        timeoutTask.cancel();

        log.info("Geronimo server started in " + watch);
View Full Code Here

            log.debug("Starting verify timeout task; triggers in: " + timeout + "s");
            timer.schedule(timeoutTask, timeout * 1000);
        }

        // Verify server started
        ServerProxy server = new ServerProxy(hostname, port, username, password);
        boolean started = false;
        while (!started) {
            if (verifyTimedOut.isSet()) {
                throw new MojoExecutionException("Unable to verify if the server was started in the given time");
            }

            started = server.isFullyStarted();

            if (!started) {
                Throwable error = server.getLastError();
                if (error != null) {
                    log.debug("Server query failed; ignoring", error);
                }

                Thread.sleep(1000);
            }
        }
        server.closeConnection();

        // Stop the timer, server should be up now
        timeoutTask.cancel();

        log.info("Geronimo server started");
View Full Code Here

     * @optional
     */
    protected String[] arg = null;

    protected void doExecute() throws Exception {
        ServerProxy server =
            new ServerProxy(hostname, port, username, password);

        String geronimoHomeStr = server.getGeronimoHome();

        server.closeConnection();
       
        log.info("Geronimo Home: " + geronimoHomeStr);

        if (geronimoHomeStr == null) {
            throw new MojoExecutionException("Unable to determine Geronimo installation directory");
View Full Code Here

     * @parameter expression="${failIfNotStarted}" default-value="true"
     */
    private boolean failIfNotStarted = true;
   
    protected void doExecute() throws Exception {
        ServerProxy server = new ServerProxy(hostname, port, username, password);

        //
        // TODO: Maybe we just need isStarted() not need to be fully started?
        //
       
        if (!server.isFullyStarted()) {
            String msg = "Server does not appear to be started";
           
            if (failIfNotStarted) {
                throw new MojoExecutionException(msg);
            }
            else {
                log.warn(msg);
            }
        }
        else {
            log.info("Stopping Geronimo server...");
           
            server.shutdown();
            server.waitForStop();
            server.closeConnection();

            //
            // TODO: Verify its down?
            //
        }
View Full Code Here

            log.debug("Starting verify timeout task; triggers in: " + verifyTimeout + "s");
            timer.schedule(timeoutTask, verifyTimeout * 1000);
        }

        // Verify server started
        ServerProxy server = new ServerProxy(hostname, port, username, password);
        boolean started = false;
        while (!started) {
            if (verifyTimedOut.isSet()) {
                throw new MojoExecutionException("Unable to verify if the server was started in the given time");
            }

            if (errorHolder.isSet()) {
                throw new MojoExecutionException("Failed to start Geronimo server", (Throwable)errorHolder.get());
            }

            started = server.isFullyStarted();

            if (!started) {
                Throwable error = server.getLastError();
                if (error != null) {
                    log.debug("Server query failed; ignoring", error);
                }

                Thread.sleep(1000);
View Full Code Here

            log.debug("Starting verify timeout task; triggers in: " + timeout + "s");
            timer.schedule(timeoutTask, timeout * 1000);
        }

        // Verify server started
        ServerProxy server = new ServerProxy(hostname, port, username, password);
        boolean started = false;
        while (!started) {
            if (verifyTimedOut.isSet()) {
                throw new MojoExecutionException("Unable to verify if the server was started in the given time");
            }

            started = server.isFullyStarted();

            if (!started) {
                Throwable error = server.getLastError();
                if (error != null) {
                    log.debug("Server query failed; ignoring", error);
                }

                Thread.sleep(1000);
View Full Code Here

*/
public class StopServerMojo
    extends ReportingMojoSupport
{
    protected void doExecute() throws Exception {
        ServerProxy server = new ServerProxy(hostname, port, username, password);

        //
        // TODO: Maybe we just need isStarted() not need to be fully started?
        //
       
        if (!server.isFullyStarted()) {
            throw new MojoExecutionException("Server does not appear to be started");
        }
        else {
            log.info("Stopping Geronimo server...");
           
            server.shutdown();

            //
            // TODO: Verify its down?
            //
        }
View Full Code Here

            log.debug("Starting verify timeout task; triggers in: " + verifyTimeout + " seconds");
            timer.schedule(timeoutTask, verifyTimeout * 1000);
        }

        // Verify server started
        ServerProxy server = new ServerProxy(hostname, port, username, password);
        boolean started = false;
        while (!started) {
            if (verifyTimedOut.isSet()) {
                throw new MojoExecutionException("Unable to verify if the server was started in the given time (" + verifyTimeout + " seconds)");
            }

            if (errorHolder.isSet()) {
                throw new MojoExecutionException("Failed to start Geronimo server", (Throwable)errorHolder.get());
            }

            started = server.isFullyStarted();

            if (!started) {
                Throwable error = server.getLastError();
                if (error != null) {
                    log.debug("Server query failed; ignoring", error);
                }

                Thread.sleep(1000);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.mavenplugins.geronimo.ServerProxy

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.