Package org.apache.openejb.assembler.classic

Examples of org.apache.openejb.assembler.classic.Assembler.createResource()


        assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("DeFAultDataSource", "DataSource", null), ResourceInfo.class));
        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("YeLLowDataSource", "DataSource", null), ResourceInfo.class));
        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("PurpLEDataSource", "DataSource", null), ResourceInfo.class));

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));
View Full Code Here


        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("DeFAultDataSource", "DataSource", null), ResourceInfo.class));
        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("YeLLowDataSource", "DataSource", null), ResourceInfo.class));
        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("PurpLEDataSource", "DataSource", null), ResourceInfo.class));

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));

        EjbJarInfo ejbJarInfo = config.configureApplication(ejbJar);
View Full Code Here

            resources.add((ResourceProvider) resourceProvider);
        }
        for (ResourceProvider resourceProvider : getResources()) {
            ResourceInfo info = configurationFactory.configureService(resourceProvider.getResourceDefinition(), ResourceInfo.class);
            importedResourceIds.add(info.id);
            assembler.createResource(info);
        }
        if (isImportContext() && applicationContext != null) {
            for (String beanName : applicationContext.getBeanDefinitionNames()) {
                if (!importedResourceIds.contains(beanName)) {
                    Class beanType = applicationContext.getType(beanName);
View Full Code Here

                    if (isImportableType(beanType, factoryType)) {
                        SpringReference factory = new SpringReference(applicationContext, beanName, beanType);

                        ResourceInfo info = initPassthrough(beanName, new ResourceInfo(), "Resource", factory);
                        info.types = getTypes(beanType);
                        assembler.createResource(info);
                    }
                }
            }
        }
View Full Code Here

        PassthroughFactory.add(resourceInfo, value);
        Assembler assembler = (Assembler) SystemInstance.get().getComponent(org.apache.openejb.spi.Assembler.class);

        logger.info("Importing a Tomcat Resource with id '" + resourceInfo.id +  "' of type '" + type + "'.");
        try {
            assembler.createResource(resourceInfo);
        } catch (OpenEJBException e) {
            logger.error("Unable to bind Global Tomcat resource " + name + " into OpenEJB", e);
        }
    }
View Full Code Here

        resourceInfo.types.add(type);
        PassthroughFactory.add(resourceInfo, value);

        logger.info("Importing a Tomcat Resource with id '" + resourceInfo.id + "' of type '" + type + "'.");
        try {
            assembler.createResource(resourceInfo);
        } catch (final OpenEJBException e) {
            logger.error("Unable to bind Global Tomcat resource " + name + " into OpenEJB", e);
        }
    }
View Full Code Here

        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        final ResourceInfo serviceInfo = config.configureService(resource, ResourceInfo.class);
//        serviceInfo.classpath = new URI[]{jar.toURI()};
        assembler.createResource(serviceInfo);

        final InitialContext initialContext = new InitialContext();
        final Color color = (Color) initialContext.lookup("openejb:Resource/Orange");

        assertNotNull(color);
View Full Code Here

        props.put("BrokerXmlConfig", brokerXmlConfig);
        props.put("StartupTimeout", 10000);

        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
        assembler.createResource(config.configureService(ResourceInfo.class, "Default Unmanaged JDBC Database",
            new Properties(), "Default Unmanaged JDBC Database", "DataSource"));
        assembler.createResource(config.configureService(ResourceInfo.class, "Default JMS Resource Adapter",
            props, "Default JMS Resource Adapter", "ActiveMQResourceAdapter"));

        // Setup the descriptor information
View Full Code Here

        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
        assembler.createResource(config.configureService(ResourceInfo.class, "Default Unmanaged JDBC Database",
            new Properties(), "Default Unmanaged JDBC Database", "DataSource"));
        assembler.createResource(config.configureService(ResourceInfo.class, "Default JMS Resource Adapter",
            props, "Default JMS Resource Adapter", "ActiveMQResourceAdapter"));

        // Setup the descriptor information

        WidgetBean.lifecycle.clear();
View Full Code Here

        assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("defaultDataSource", "DataSource", null), ResourceInfo.class));
        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("yellowDataSource", "DataSource", null), ResourceInfo.class));
        assembler.createResource(config.configureService(new org.apache.openejb.config.sys.Resource("PurpleDataSource", "DataSource", null), ResourceInfo.class));

        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(WidgetBean.class));
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.