Package org.apache.openejb.loader

Examples of org.apache.openejb.loader.SystemInstance


public class TomeeJaxWsService implements Service, WebDeploymentListener {

    @Override
    public void init(Properties props) throws Exception {
        // Install the Tomcat webservice registry
        final SystemInstance system = SystemInstance.get();

        TomcatWsRegistry tomcatSoapHandler = (TomcatWsRegistry) system.getComponent(WsRegistry.class);
        if (tomcatSoapHandler == null) {
            tomcatSoapHandler = new TomcatWsRegistry();
            system.setComponent(WsRegistry.class, tomcatSoapHandler);
        }

        system.getComponent(WebDeploymentListeners.class).add(this);
    }
View Full Code Here


*/
public class TomeeJaxRsService implements Service, WebDeploymentListener {

    @Override
    public void init(Properties props) throws Exception {
        final SystemInstance system = SystemInstance.get();

        TomcatRsRegistry tomcatRestHandler = (TomcatRsRegistry) system.getComponent(RsRegistry.class);
        if (tomcatRestHandler == null) {
            tomcatRestHandler = new TomcatRsRegistry();
            system.setComponent(RsRegistry.class, tomcatRestHandler);
        }

        system.getComponent(WebDeploymentListeners.class).add(this);
    }
View Full Code Here

    public OpenEJBHttpServer() {
        this(getHttpListenerRegistry());
    }

    public static HttpListenerRegistry getHttpListenerRegistry() {
        SystemInstance systemInstance = SystemInstance.get();
        HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class);
        if (registry == null){
            registry = new HttpListenerRegistry();
            systemInstance.setComponent(HttpListenerRegistry.class, registry);
        }
        return registry;
    }
View Full Code Here

            throw new ApplicationException(new NoSuchEJBException("Singleton initialization failed").initCause(e.getCause()));
        }
    }

    private void initializeDependencies(BeanContext beanContext) throws OpenEJBException {
        SystemInstance systemInstance = SystemInstance.get();
        ContainerSystem containerSystem = systemInstance.getComponent(ContainerSystem.class);
        for (String dependencyId : beanContext.getDependsOn()) {
            BeanContext dependencyContext = containerSystem.getBeanContext(dependencyId);
            if (dependencyContext == null) {
                throw new OpenEJBException("Deployment does not exist. Deployment(id='"+dependencyContext+"')");
            }
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

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

        installNaming();

        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());

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

        system.setComponent(EjbResolver.class, new EjbResolver(null, EjbResolver.Scope.GLOBAL));
    }
View Full Code Here

                    containerSystemContext.bind("openejb/client/" + clientClassName, clientInfo.moduleId);
                    logger.getChildLogger("client").info("createApplication.createLocalClient", clientClassName, clientInfo.moduleId);
                }
            }

            SystemInstance systemInstance = SystemInstance.get();

            // WebApp

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

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

            logger.info("createApplication.success", appInfo.path);
View Full Code Here

        starting = true;

        //
        // System Instance
        //
        SystemInstance system = SystemInstance.get();
        system.getProperties().putAll(properties);

        // do not deploy applications in claspath
        system.setProperty("openejb.deployments.classpath", "false");

        // we are in embedded mode
        system.setProperty("openejb.embedded", "true");

        //
        // Add TransactionManager and SecurityService to OpenEJB
        //
        ConfigurationFactory configurationFactory = new ConfigurationFactory();
View Full Code Here

    public Object getObject() throws NamingException {
        if (reference != null){
            return reference.getObject();
        }

        SystemInstance systemInstance = SystemInstance.get();


        EjbResolver resolver = systemInstance.getComponent(EjbResolver.class);

        String deploymentId = resolver.resolve(info, moduleUri);

        if (deploymentId == null) {
            String key = "lazyEjbRefNotResolved";
            if (info.getHome() != null){
                key += ".home";
            }
            String message = messages.format(key, info.getName(), info.getEjbLink(), info.getHome(), info.getInterface());
            throw new NameNotFoundException(message);
        }

        ContainerSystem containerSystem = systemInstance.getComponent(ContainerSystem.class);

        BeanContext beanContext = containerSystem.getBeanContext(deploymentId);

        if (beanContext == null) {
            String message = messages.format("deploymentNotFound", info.getName(), deploymentId);
View Full Code Here

    }

    private static void configureInternal() throws IOException {

        System.setProperty("openjpa.Log", "log4j");
        SystemInstance system = SystemInstance.get();
        FileUtils base = system.getBase();
        File confDir = base.getDirectory("conf");
        File loggingPropertiesFile = new File(confDir, LOGGING_PROPERTIES_FILE);
        if (confDir.exists()) {
            if (loggingPropertiesFile.exists()) {
                BufferedInputStream bis = new BufferedInputStream(new FileInputStream(loggingPropertiesFile));
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.