Examples of JndiConsumer


Examples of org.apache.openejb.jee.JndiConsumer

        return appModule;
    }

    private void merge(EjbModule ejbModule, WebModule webModule) {
        final JndiConsumer webApp = webModule.getWebApp();

        final EjbJar ejbJar = ejbModule.getEjbJar();

        for (EnterpriseBean bean : ejbJar.getEnterpriseBeans()) {
            merge(bean.getEnvEntryMap(), webApp.getEnvEntryMap());
            merge(bean.getEjbRefMap(), webApp.getEjbRefMap());
            merge(bean.getEjbLocalRefMap(), webApp.getEjbLocalRefMap());
            merge(bean.getServiceRefMap(), webApp.getServiceRefMap());
            merge(bean.getResourceRefMap(), webApp.getResourceRefMap());
            merge(bean.getResourceEnvRefMap(), webApp.getResourceEnvRefMap());
            merge(bean.getMessageDestinationRefMap(), webApp.getMessageDestinationRefMap());
            merge(bean.getPersistenceContextRefMap(), webApp.getPersistenceContextRefMap());
            merge(bean.getPersistenceUnitRefMap(), webApp.getPersistenceUnitRefMap());

            mergeUserTransaction(bean.getResourceRefMap(), webApp.getResourceRefMap(), webApp);
            mergeUserTransaction(bean.getResourceEnvRefMap(), webApp.getResourceEnvRefMap(), webApp);
            mergeUserTransaction(webApp.getResourceRefMap(), bean.getResourceRefMap(), bean);
            mergeUserTransaction(webApp.getResourceEnvRefMap(), bean.getResourceEnvRefMap(), bean);
        }

        for (EnterpriseBean a : ejbJar.getEnterpriseBeans()) {

            // Merge the bean namespaces together too
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

    private List<JndiConsumer> collectConsumers(AppModule appModule) {

        final List<JndiConsumer> jndiConsumers = new ArrayList<JndiConsumer>();

        for (ClientModule module : appModule.getClientModules()) {
            final JndiConsumer consumer = module.getApplicationClient();
            if (consumer == null) continue;
            jndiConsumers.add(consumer);
        }

        for (WebModule webModule : appModule.getWebModules()) {
            final JndiConsumer consumer = webModule.getWebApp();
            if (consumer == null) continue;
            jndiConsumers.add(consumer);
        }

        for (EjbModule ejbModule : appModule.getEjbModules()) {
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

        if (resources.size() == 0) return;

        List<JndiConsumer> jndiConsumers = new ArrayList<JndiConsumer>();
        for (WebModule webModule : module.getWebModules()) {
            final JndiConsumer consumer = webModule.getWebApp();
            jndiConsumers.add(consumer);
        }

        for (EjbModule ejbModule : module.getEjbModules()) {
            Collections.addAll(jndiConsumers, ejbModule.getEjbJar().getEnterpriseBeans());
        }

        for (Resource resource : resources) {
            Properties properties = resource.getProperties();

            if (DataSource.class.getName().equals(resource.getType())
                || DataSource.class.getSimpleName().equals(resource.getType())) {
                trimNotSupportedDataSourceProperties(properties);
            }

            ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
            final ResourceRef resourceRef = new ResourceRef();
            resourceRef.setResType(resource.getType());

            if (DataSource.class.getName().equals(resource.getType())
                    && resource.getProperties().containsKey(ORIGIN_FLAG)
                    && resource.getProperties().getProperty(ORIGIN_FLAG).equals(ORIGIN_ANNOTATION)) {
                properties.remove(ORIGIN_FLAG);

                resourceInfo.id = module.getModuleId() + "/" + resourceInfo.id;

                if (properties.get("JdbcUrl") == null) {
                    final String url = getVendorUrl(properties);
                    if (url != null) {
                        properties.put("JdbcUrl", url);
                    }
                }

                resourceRef.setResRefName(dataSourceLookupName(resource));
            } else {
                resourceRef.setResRefName(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id);
            }

            resourceRef.setMappedName(resourceInfo.id);

            for (JndiConsumer consumer : jndiConsumers) {
                final ResourceRef existing = consumer.getResourceRefMap().get(resourceRef.getKey());
                if (existing != null) {
                    existing.setMappedName(resourceRef.getMappedName());
                } else {
                    consumer.getResourceRef().add(resourceRef);
                }
            }

            installResource(module.getModuleId(), resourceInfo);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

        // todo move namingBuilders.buildEnvironment() here when geronimo naming supports it

        // initialize the naming builders
        if (ejbJar.getAssemblyDescriptor() != null) {
            final List<MessageDestination> specMessageDestinations = ejbJar.getAssemblyDescriptor().getMessageDestination();
            final JndiConsumer  jndiConsumer = new MessageDestinationInfo(specMessageDestinations);
                namingBuilder.initContext(jndiConsumer,
                        (XmlObject)module.getVendorDD(),
                        ejbModule);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

        if (resources.size() == 0) return;

        List<JndiConsumer> jndiConsumers = new ArrayList<JndiConsumer>();
        for (WebModule webModule : module.getWebModules()) {
            final JndiConsumer consumer = webModule.getWebApp();
            jndiConsumers.add(consumer);
        }

        for (EjbModule ejbModule : module.getEjbModules()) {
            Collections.addAll(jndiConsumers, ejbModule.getEjbJar().getEnterpriseBeans());
        }

        for (Resource resource : resources) {
            Properties properties = resource.getProperties();

            if (DataSource.class.getName().equals(resource.getType())
                || DataSource.class.getSimpleName().equals(resource.getType())) {
                trimNotSupportedDataSourceProperties(properties);
            }

            ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
            final ResourceRef resourceRef = new ResourceRef();
            resourceRef.setResType(resource.getType());

            if (DataSource.class.getName().equals(resource.getType())
                    && resource.getProperties().containsKey(ORIGIN_FLAG)
                    && resource.getProperties().getProperty(ORIGIN_FLAG).equals(ORIGIN_ANNOTATION)) {
                properties.remove(ORIGIN_FLAG);

                resourceInfo.id = module.getModuleId() + "/" + resourceInfo.id;

                if (properties.get("JdbcUrl") == null) {
                    final String url = getVendorUrl(properties);
                    if (url != null) {
                        properties.put("JdbcUrl", url);
                    }
                }

                resourceRef.setResRefName(dataSourceLookupName(resource));
            } else {
                resourceRef.setResRefName(OPENEJB_RESOURCE_JNDI_PREFIX + resourceInfo.id);
            }

            resourceRef.setMappedName(resourceInfo.id);

            for (JndiConsumer consumer : jndiConsumers) {
                final ResourceRef existing = consumer.getResourceRefMap().get(resourceRef.getKey());
                if (existing != null) {
                    existing.setMappedName(resourceRef.getMappedName());
                } else {
                    consumer.getResourceRef().add(resourceRef);
                }
            }

            installResource(module.getModuleId(), resourceInfo);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

    }

    public AppModule removeUnsetEnvEntries(AppModule appModule) throws OpenEJBException {

        for (ClientModule module : appModule.getClientModules()) {
            final JndiConsumer consumer = module.getApplicationClient();
            if (consumer == null) continue;

            removeUnsetEnvEntries(consumer);
        }

        for (WebModule module : appModule.getWebModules()) {
            final JndiConsumer consumer = module.getWebApp();
            if (consumer == null) continue;

            removeUnsetEnvEntries(consumer);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer


    public AppModule fillInMissingType(AppModule appModule) throws OpenEJBException {

        for (ClientModule module : appModule.getClientModules()) {
            final JndiConsumer consumer = module.getApplicationClient();
            if (consumer == null) continue;

            fillInMissingType(consumer, module);
        }

        for (WebModule module : appModule.getWebModules()) {
            final JndiConsumer consumer = module.getWebApp();
            if (consumer == null) continue;

            fillInMissingType(consumer, module);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

        // map the refs declared in the vendor plan, so we can match them to the spec references
        Map<String, GerEjbRefType> refMap = mapEjbRefs(plan);
        Map<String, GerEjbLocalRefType> localRefMap = mapEjbLocalRefs(plan);

        // JndiConsumer holds the ref objects that OpenEJB needs
        JndiConsumer consumer = new SessionBean();

        // Add the refs declaraed the the spec deployment descriptor (e.g., ejb-jar.xml or web.xml)
        List<EjbRefType> ejbRefs = convert(specDD.selectChildren(ejbRefQNameSet), JEE_CONVERTER, EjbRefType.class, EjbRefType.type);
        List<EjbLocalRefType> ejbLocalRefs = convert(specDD.selectChildren(ejbLocalRefQNameSet), JEE_CONVERTER, EjbLocalRefType.class, EjbLocalRefType.type);
        addRefs(consumer, ejbRefs, refMap, ejbLocalRefs, localRefMap, componentContext);
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

    private List<JndiConsumer> collectConsumers(final AppModule appModule) {

        final List<JndiConsumer> jndiConsumers = new ArrayList<JndiConsumer>();

        for (final ClientModule module : appModule.getClientModules()) {
            final JndiConsumer consumer = module.getApplicationClient();
            if (consumer == null) {
                continue;
            }
            jndiConsumers.add(consumer);
        }

        for (final WebModule webModule : appModule.getWebModules()) {
            final JndiConsumer consumer = webModule.getWebApp();
            if (consumer == null) {
                continue;
            }
            jndiConsumers.add(consumer);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

    public AppModule removeUnsetEnvEntries(final AppModule appModule) throws OpenEJBException {
        final Map<String, EnvEntry> appEnvEntryMap = getAppEnvEntryMap(appModule);

        for (final ClientModule module : appModule.getClientModules()) {
            final JndiConsumer consumer = module.getApplicationClient();
            if (consumer == null) {
                continue;
            }

            removeUnsetEnvEntries(appEnvEntryMap, consumer);
        }

        for (final WebModule module : appModule.getWebModules()) {
            final JndiConsumer consumer = module.getWebApp();
            if (consumer == null) {
                continue;
            }

            removeUnsetEnvEntries(appEnvEntryMap, consumer);
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.