Package org.apache.openejb.loader

Examples of org.apache.openejb.loader.SystemInstance


    public Assembler() {
        persistenceClassLoaderHandler = new PersistenceClassLoaderHandlerImpl();

        installNaming();

        SystemInstance system = SystemInstance.get();

        system.setComponent(Assembler.class, this);
       
        containerSystem = new CoreContainerSystem();
        system.setComponent(ContainerSystem.class, containerSystem);

        jndiBuilder = new JndiBuilder(containerSystem.getJNDIContext());

        setConfiguration(new OpenEjbConfiguration());

        ApplicationServer appServer = system.getComponent(ApplicationServer.class);
        if (appServer == null) {
            system.setComponent(ApplicationServer.class, new org.apache.openejb.core.ServerFederation());
        }


    }
View Full Code Here


    }

    public static File install(URL resource, String name, boolean overwrite) throws IOException {
        if (resource == null) return null;

        SystemInstance system = SystemInstance.get();
        FileUtils base = system.getBase();
        File conf = base.getDirectory("conf");

        if (!conf.exists()) return null;

        File file = new File(conf, name);
View Full Code Here

    // TODO: Remove it once init() suits our (initialisation) needs
    public void init(Properties props) throws Exception {
        this.props = props;

        SystemInstance system = SystemInstance.get();
        File home = system.getHome().getDirectory();
        system.setProperty("openejb.deployments.classpath.include", ".*/"+home.getName()+"/lib/.*");
        system.setProperty("openejb.deployments.classpath.require.descriptor", "true");
        system.setProperty("openejb.deployments.classpath.filter.systemapps", "false");

        OpenEJB.init(props, new ServerFederation());

        if (System.getProperty("openejb.nobanner") == null) {
            System.out.println("[init] OpenEJB Remote Server");
View Full Code Here

            }
        }

        // get SystemInstance (the only static class in the system)
        // so we'll set up all the props in it
        SystemInstance systemInstance = null;
        try {
            SystemInstance.init(System.getProperties());
            systemInstance = SystemInstance.get();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(2);
        }

        // Read in and apply the conf/system.properties
        try {
            File conf = systemInstance.getBase().getDirectory("conf");
            File file = new File(conf, "system.properties");
            if (file.exists()){
                Properties systemProperties = new Properties();
                FileInputStream fin = new FileInputStream(file);
                InputStream in = new BufferedInputStream(fin);
View Full Code Here

    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/?.*");

        httpServer = new HttpServer(registry);
View Full Code Here

    }

    public void printEjb(String name, PrintWriter out, HttpSession session)
        throws Exception {

        SystemInstance system = SystemInstance.get();
        ContainerSystem containerSystem = system.getComponent(ContainerSystem.class);

        String id = (name.startsWith("/")) ? name.substring(1, name.length()) : name;

        org.apache.openejb.DeploymentInfo ejb = containerSystem.getDeploymentInfo(id);
View Full Code Here

        skipLoaderIfPossible = "true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.classloader.skip-app-loader-if-possible", "true"));
        persistenceClassLoaderHandler = new PersistenceClassLoaderHandlerImpl();

        installNaming();

        final SystemInstance system = SystemInstance.get();

        system.setComponent(org.apache.openejb.spi.Assembler.class, this);
        system.setComponent(Assembler.class, this);

        containerSystem = new CoreContainerSystem(jndiFactory);
        system.setComponent(ContainerSystem.class, containerSystem);

        jndiBuilder = new JndiBuilder(containerSystem.getJNDIContext());

        setConfiguration(new OpenEjbConfiguration());

        final ApplicationServer appServer = system.getComponent(ApplicationServer.class);
        if (appServer == null) {
            system.setComponent(ApplicationServer.class, new ServerFederation());
        }

        system.setComponent(EjbResolver.class, new EjbResolver(null, EjbResolver.Scope.GLOBAL));

        installExtensions();

        system.fireEvent(new AssemblerCreated());
    }
View Full Code Here

                    logger.getChildLogger("client").info("createApplication.createLocalClient", clientClassName, clientInfo.moduleId);
                }
            }

            // WebApp
            final SystemInstance systemInstance = SystemInstance.get();

            final WebAppBuilder webAppBuilder = systemInstance.getComponent(WebAppBuilder.class);
            if (webAppBuilder != null) {
                webAppBuilder.deployWebApps(appInfo, classLoader);
            }

            if (start) {
                final EjbResolver globalEjbResolver = systemInstance.getComponent(EjbResolver.class);
                globalEjbResolver.addAll(appInfo.ejbJars);
            }

            // bind all global values on global context
            bindGlobals(appContext.getBindings());

            // deploy MBeans
            for (final String mbean : appInfo.mbeans) {
                deployMBean(appContext.getWebBeansContext(), classLoader, mbean, appInfo.jmx, appInfo.appId);
            }
            for (final EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
                for (final String mbean : ejbJarInfo.mbeans) {
                    deployMBean(appContext.getWebBeansContext(), classLoader, mbean, appInfo.jmx, ejbJarInfo.moduleName);
                }
            }
            for (final ConnectorInfo connectorInfo : appInfo.connectors) {
                for (final String mbean : connectorInfo.mbeans) {
                    deployMBean(appContext.getWebBeansContext(), classLoader, mbean, appInfo.jmx, appInfo.appId + ".add-lib");
                }
            }

            deployedApplications.put(appInfo.path, appInfo);
            resumePersistentSchedulers(appContext);

            systemInstance.fireEvent(new AssemblerAfterApplicationCreated(appInfo, appContext, allDeployments));
            logger.info("createApplication.success", appInfo.path);

            return appContext;
        } catch (final ValidationException ve) {
            throw ve;
View Full Code Here

    // TODO: Remove it once init() suits our (initialisation) needs
    @Override
    public void init(Properties props) throws Exception {
        this.props = props;

        SystemInstance system = SystemInstance.get();
        File home = system.getHome().getDirectory();
        system.setProperty("openejb.deployments.classpath.include", ".*/" + home.getName() + "/lib/.*");
        system.setProperty("openejb.deployments.classpath.require.descriptor", "true");
        system.setProperty("openejb.deployments.classpath.filter.systemapps", "false");

        OpenEJB.init(props, new ServerFederation());

        if (System.getProperty("openejb.nobanner") == null) {
            System.out.println("[init] OpenEJB Remote Server");
View Full Code Here

                }
            }
        }

        try {
            final SystemInstance system = SystemInstance.get();
            File libs = system.getHome().getDirectory("lib");
            system.getClassPath().addJarsToPath(libs);
            initServer(system);
        } catch (DontStartServerException ignored) {
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of org.apache.openejb.loader.SystemInstance

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.