Package org.apache.openejb.config

Examples of org.apache.openejb.config.RemoteServer$Pipe


                final String baseUrl = "http://" + configuration.getHost() + ":" + configuration.getHttpPort() + "/tomee/installer";

                assert installer != null;
                installer.addTomEEAdminConfInTomcatUsers(true);

                final RemoteServer tmpContainer = new RemoteServer();
                tmpContainer.start();

                final URL url = new URL(baseUrl);
                logger.info("Calling TomEE Installer Servlet on " + url);

                for (int i = 0; i < 3; i++) {
                    final URLConnection uc = url.openConnection();
                    // dG9tZWU6dG9tZWU= --> Base64 of tomee:tomee
                    final String authorizationString = "Basic dG9tZWU6dG9tZWU=";
                    uc.setRequestProperty ("Authorization", authorizationString);
                    try {
                        final InputStream is = uc.getInputStream();
                        org.apache.openejb.loader.IO.slurp(is);
                        is.close();
                        break;
                    } catch (final Exception e) {
                        logger.warning(e.getMessage());
                        Thread.sleep(1000);
                    }
                }

                tmpContainer.stop();
                tmpContainer.getServer().waitFor();
            }

            container = new RemoteServer();
            container.start(Arrays.asList("-Dorg.apache.openejb.servlet.filters=" + ArquillianFilterRunner.class.getName() + "=" + ServletMethodExecutor.ARQUILLIAN_SERVLET_MAPPING), "start", true);
            container.killOnExit();
        } catch (Exception e) {
            throw new LifecycleException("Unable to start remote container", e);
        }
View Full Code Here


            System.setProperty("openejb.server.debug", "true");
            System.setProperty("server.debug.port", Integer.toString(debugPort));
        }
        System.setProperty("server.shutdown.port", Integer.toString(tomeeShutdownPort));

        server = new RemoteServer(getConnectAttempts(), false);
        server.setAdditionalClasspath(getAdditionalClasspath());

        addShutdownHooks(server); // some shutdown hooks are always added (see UpdatableTomEEMojo)

        if (!getWaitTomEE()) {
View Full Code Here

            System.setProperty(RemoteServer.SERVER_SHUTDOWN_HOST, configuration.getStopHost());
            if (configuration.isDebug()) {
                System.setProperty(RemoteServer.OPENEJB_SERVER_DEBUG, "true");
                System.setProperty(RemoteServer.SERVER_DEBUG_PORT, Integer.toString(configuration.getDebugPort()));
            }
            container = new RemoteServer();

            container.setAdditionalClasspath(InstallationEnrichers.addOneLineFormatter(tomeeHome));
            container.start(args(), "start", true);
            container.killOnExit();
View Full Code Here

        }

        System.out.println(currentFile);
        writeToFile(currentFile, archive);

        server = new RemoteServer(100, true);
        try {
            server.start();
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
View Full Code Here

        }
    }
    public ContainersImplTomEE() {
        System.out.println("ContainersImpl=" + ContainersImplTomEE.class.getName());
        System.out.println("Initialized ContainersImplTomEE " + (++count));
        server = new RemoteServer();
    }
View Full Code Here

        }
    }
    public ContainersImplTomEE() {
        System.out.println("ContainersImpl=" + ContainersImplTomEE.class.getName());
        System.out.println("Initialized ContainersImplTomEE " + (++count));
        server = new RemoteServer();
    }
View Full Code Here

                String baseUrl = "http://" + configuration.getHost() + ":" + configuration.getHttpPort() + "/tomee/installer";

                assert installer != null;
                installer.addTomEEAdminConfInTomcatUsers(true);

                RemoteServer tmpContainer = new RemoteServer();
                tmpContainer.start();

                URL url = new URL(baseUrl);
                URLConnection uc = url.openConnection();
                // dG9tZWU6dG9tZWU= --> Base64 of tomee:tomee
                String authorizationString = "Basic dG9tZWU6dG9tZWU=";
                uc.setRequestProperty ("Authorization", authorizationString);
                InputStream is = uc.getInputStream();
                org.apache.openejb.loader.IO.slurp(is);
                is.close();

                tmpContainer.stop();
                tmpContainer.getServer().waitFor();
            }

            container = new RemoteServer();
            container.start();
        } catch (Exception e) {
            throw new LifecycleException("Unable to start remote container", e);
        }
    }
View Full Code Here

            System.setProperty(RemoteServer.SERVER_SHUTDOWN_HOST, configuration.getStopHost());
            if (configuration.isDebug()) {
                System.setProperty(RemoteServer.OPENEJB_SERVER_DEBUG, "true");
                System.setProperty(RemoteServer.SERVER_DEBUG_PORT, Integer.toString(configuration.getDebugPort()));
            }
            container = new RemoteServer();

            container.setAdditionalClasspath(InstallationEnrichers.addOneLineFormatter(tomeeHome));
            container.start(args(), "start", true);
            container.killOnExit();
View Full Code Here

            System.setProperty("openejb.server.debug", "true");
            System.setProperty("server.debug.port", Integer.toString(debugPort));
        }
        System.setProperty("server.shutdown.port", Integer.toString(tomeeShutdownPort));

        final RemoteServer server = new RemoteServer(getConnectAttempts(), false);
        if (additionalCp != null) {
            server.setAdditionalClasspath(additionalCp);
        }
        addShutdownHooks(server); // some shutdown hooks are always added (see UpdatableTomEEMojo)

        final CountDownLatch stopCondition;
        if (getWaitTomEE()) {
            stopCondition = new CountDownLatch(1);
            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    try {
                        server.stop();
                    } catch (Exception e) {
                        // no-op
                    }
                    try {
                        server.getServer().waitFor();
                        getLog().info("TomEE stopped");
                        stopCondition.countDown();
                    } catch (Exception e) {
                        getLog().error("Can't stop TomEE", e);
                    }
View Full Code Here

        if (quickSession) {
            strings.add("-Dopenejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager");
        }

        System.setProperty("server.shutdown.port", Integer.toString(tomeeShutdownPort));
        final RemoteServer server = new RemoteServer(getConnectAttempts(), false);
        if (!getNoShutdownHook()) {
            addShutdownHooks(server);
        }

        getLog().info("Running '" + getClass().getSimpleName().replace("TomEEMojo", "").toLowerCase(Locale.ENGLISH)
                + "'. Configured TomEE in plugin is " + tomeeHost + ":" + tomeeHttpPort
                + " (plugin shutdown port is " + tomeeShutdownPort + ")");

        server.start(strings, getCmd(), false);

        if (!getNoShutdownHook()) {
            try {
                server.getServer().waitFor(); // connect attempts = 0
            } catch (InterruptedException e) {
                // ignored
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.config.RemoteServer$Pipe

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.