Examples of EjbServer


Examples of org.apache.openejb.server.ejbd.EjbServer

/**
* @version $Rev: 1090081 $ $Date: 2011-04-07 18:30:11 -0700 (Thu, 07 Apr 2011) $
*/
public class JndiTest extends TestCase {
    public void test() throws Exception {
        EjbServer ejbServer = new EjbServer();

        Properties initProps = new Properties();
        initProps.put(DeploymentsResolver.DEPLOYMENTS_CLASSPATH_PROPERTY, Boolean.toString(false));
        OpenEJB.init(initProps, new ServerFederation());
        ejbServer.init(new Properties());

        ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        int port = serviceDaemon.getPort();
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

        optionalService(properties, "org.apache.tomee.webservices.TomeeJaxRsService");
        optionalService(properties, "org.apache.tomee.webservices.TomeeJaxWsService");

        // Start OpenEJB
        ejbServer = new EjbServer();
        SystemInstance.get().setComponent(EjbServer.class, ejbServer);
        OpenEJB.init(properties, new ServerFederation());

        Properties ejbServerProps = new Properties();
        ejbServerProps.putAll(properties);
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

    private String name;

    @Override
    public void init(final Properties props) throws Exception {
        name = props.getProperty("name");
        final EjbServer ejbServer = new EjbServer();
        final ServerServiceAdapter adapter = new ServerServiceAdapter(ejbServer);

        final SystemInstance systemInstance = SystemInstance.get();
        HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class);
        if (registry == null) {
            registry = new HttpListenerRegistry();
            systemInstance.setComponent(HttpListenerRegistry.class, registry);
        }

        registry.addHttpListener(adapter, "/ejb/?.*");

        // register the http server
        systemInstance.setComponent(HttpServer.class, httpServer);

        httpServer.init(props);
        ejbServer.init(props);
    }
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

            assertThat(e.getCause().getMessage(), startsWith("Object is not serializable"));
        }
    }

    private void invokeRemote(final Properties serverProps, final String serializer) throws Exception {
        final EjbServer ejbServer = new EjbServer();

        final Properties initProps = new Properties();
        initProps.put(DeploymentsResolver.DEPLOYMENTS_CLASSPATH_PROPERTY, "false");
        OpenEJB.init(initProps, new ServerFederation());
        ejbServer.init(serverProps);

        final ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        final int port = serviceDaemon.getPort();
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

        System.clearProperty("java.security.auth.login.config");
    }

    @Test
    public void invoke() throws Exception {
        final EjbServer ejbServer = new EjbServer();

        OpenEJB.init(new PropertiesBuilder().p(DeploymentsResolver.DEPLOYMENTS_CLASSPATH_PROPERTY, "false").build(), new ServerFederation());
        ejbServer.init(new Properties());

        final ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        final int port = serviceDaemon.getPort();
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

* @version $Rev: 1611274 $ $Date: 2014-07-17 09:52:58 +0200 (Thu, 17 Jul 2014) $
*/
public class AuthTest extends TestCase {

    public void test() throws Exception {
        final EjbServer ejbServer = new EjbServer();

        final Properties initProps = new Properties();
        initProps.put(DeploymentsResolver.DEPLOYMENTS_CLASSPATH_PROPERTY, Boolean.toString(false));
        OpenEJB.init(initProps, new ServerFederation());
        ejbServer.init(new Properties());

        final ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        final int port = serviceDaemon.getPort();
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

        private ServiceDaemon serviceDaemon;
        private int port;

        public void init(final Properties props) {
            try {
                final EjbServer ejbServer = new EjbServer();
                // classpath should be scanned...
                props.put("openejb.deployments.classpath", "true");
                // ...and only the openejb-itests-beans should be considered as a deployment
                props.put("openejb.deployments.classpath.include", ".*openejb-itests-beans.*");
                // ...and have the openejb-itests-beans included in the deployments (it's a system app)
                props.put("openejb.deployments.classpath.filter.systemapps", "false");
                //                props.put("openejb.debuggable-vm-hackery", "true");
                OpenEJB.init(props, new ServerFederation());
                ejbServer.init(props);

                serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");

            } catch (final Exception e) {
                throw new RuntimeException("Unable to initialize Test Server.", e);
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

* @version $Rev: 1611274 $ $Date: 2014-07-17 09:52:58 +0200 (Thu, 17 Jul 2014) $
*/
public class JndiTest extends TestCase {

    public void test() throws Exception {
        final EjbServer ejbServer = new EjbServer();

        final Properties initProps = new Properties();
        initProps.put(DeploymentsResolver.DEPLOYMENTS_CLASSPATH_PROPERTY, Boolean.toString(false));
        OpenEJB.init(initProps, new ServerFederation());
        ejbServer.init(new Properties());

        final ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        final int port = serviceDaemon.getPort();
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

    private HttpServer httpServer;
    private String name;

    public void init(Properties props) throws Exception {
        name = props.getProperty("name");
        EjbServer ejbServer = new EjbServer();
        ServerServiceAdapter adapter = new ServerServiceAdapter(ejbServer);

        SystemInstance systemInstance = SystemInstance.get();
        HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class);
        if (registry == null){
            registry = new HttpListenerRegistry();
            systemInstance.setComponent(HttpListenerRegistry.class, registry);
        }

        registry.addHttpListener(adapter, "/ejb/?.*");

        // todo this breaks the http ejb server impl
        // the service manage makes a static decision based on the interface of this class to create
        // a service daemon socket or not.  Since jetty is "self managed" and throws an exception from
        // service socket, this breaks this code
//        // props can name an implementation
//        // if implementation is not named, use jetty if jetty classes are present; otherwise use openejb
//        String impl = props.getProperty("impl");
//        if ("Jetty".equalsIgnoreCase(impl)) {
//            httpServer = (HttpServer) getClass().getClassLoader().loadClass("org.apache.openejb.server.httpd.JettyHttpServer").newInstance();
//        } else if ("OpenEJB".equalsIgnoreCase(impl)) {
            httpServer = new OpenEJBHttpServer(registry);
//        } else if (impl == null) {
//            try {
//                getClass().getClassLoader().loadClass("org.mortbay.jetty.Server");
//                httpServer = (HttpServer) getClass().getClassLoader().loadClass("org.apache.openejb.server.httpd.JettyHttpServer").newInstance();
//            } catch (Exception ignored) {
//                // Jetty classes not available
//                httpServer = new OpenEJBHttpServer(registry);
//            }
//        } else {
//            throw new IllegalArgumentException("Unknown HTTP server impl '" + impl + "'. Valid implementation are OpenEJB and Jetty.");
//        }

        // register the http server
        systemInstance.setComponent(HttpServer.class, httpServer);

        httpServer.init(props);
        ejbServer.init(props);
    }
View Full Code Here

Examples of org.apache.openejb.server.ejbd.EjbServer

        private ServiceDaemon serviceDaemon;
        private int port;

        public void init(Properties props) {
            try {
                EjbServer ejbServer = new EjbServer();
                props.put("openejb.deployments.classpath", "true");
                OpenEJB.init(props, new ServerFederation());
                ejbServer.init(props);

                serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");

            } catch (Exception e) {
                throw new RuntimeException("Unable to initialize Test Server.", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.