Examples of JndiConsumer


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

        final List<ResourceInfo> resourceInfos = new ArrayList<ResourceInfo>();
        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);
                }
            }

            resourceInfos.add(resourceInfo);
        }
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

        // 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

    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) {
        return specDD.selectChildren(ejbRefQNameSet).length > 0 || specDD.selectChildren(ejbLocalRefQNameSet).length > 0;
    }

    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
        JndiConsumer consumer = createJndiConsumer(specDD);
        processWebEjbAnnotations(module, consumer);

        Map<String, Object> map = null;
        try {
            EjbModuleBuilder.EarData earData = (EjbModuleBuilder.EarData) module.getRootEarContext().getGeneralData().get(EjbModuleBuilder.EarData.class);
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

    protected JndiConsumer createJndiConsumer(XmlObject specDD) throws DeploymentException {
        List<EjbRefType> ejbRefs = convert(specDD.selectChildren(ejbRefQNameSet), J2EE_CONVERTER, EjbRefType.class, EjbRefType.type);
        List<EjbLocalRefType> ejbLocalRefs = convert(specDD.selectChildren(ejbLocalRefQNameSet), J2EE_CONVERTER, EjbLocalRefType.class, EjbLocalRefType.type);

        // build jndi consumer
        JndiConsumer jndiConsumer = new SessionBean();
        for (EjbRefType xmlbeansRef : ejbRefs) {
            // create the ejb-ref
            EjbRef ref = new EjbRef();
            jndiConsumer.getEjbRef().add(ref);

            // ejb-ref-name
            ref.setEjbRefName(getStringValue(xmlbeansRef.getEjbRefName()));

            // ejb-ref-type
            String refType = getStringValue(xmlbeansRef.getEjbRefType());
            if ("SESSION".equalsIgnoreCase(refType)) {
                ref.setEjbRefType(org.apache.openejb.jee.EjbRefType.SESSION);
            } else if ("ENTITY".equalsIgnoreCase(refType)) {
                ref.setEjbRefType(org.apache.openejb.jee.EjbRefType.ENTITY);
            }

            // home
            ref.setHome(getStringValue(xmlbeansRef.getHome()));

            // remote
            ref.setRemote(getStringValue(xmlbeansRef.getRemote()));

            // ejb-link
            ref.setEjbLink(getStringValue(xmlbeansRef.getEjbLink()));

            // mapped-name
            ref.setMappedName(getStringValue(xmlbeansRef.getMappedName()));

            // injection-targets
            if (xmlbeansRef.getInjectionTargetArray() != null) {
                for (InjectionTargetType injectionTargetType : xmlbeansRef.getInjectionTargetArray()) {
                    InjectionTarget injectionTarget = new InjectionTarget();
                    injectionTarget.setInjectionTargetClass(getStringValue(injectionTargetType.getInjectionTargetClass()));
                    injectionTarget.setInjectionTargetName(getStringValue(injectionTargetType.getInjectionTargetName()));
                    ref.getInjectionTarget().add(injectionTarget);
                }
            }
        }

        for (EjbLocalRefType xmlbeansRef : ejbLocalRefs) {
            // create the ejb-ref
            EjbLocalRef ref = new EjbLocalRef();
            jndiConsumer.getEjbLocalRef().add(ref);

            // ejb-ref-name
            ref.setEjbRefName(getStringValue(xmlbeansRef.getEjbRefName()));

            // ejb-ref-type
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

public class BuiltInEnvironmentEntries implements DynamicDeployer {

    public AppModule deploy(AppModule appModule) throws OpenEJBException {

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

            add(consumer, module, appModule);
        }

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

            add(consumer, module, appModule);
        }
View Full Code Here

Examples of org.apache.openejb.jee.JndiConsumer

    @Override
    public AppModule deploy(AppModule appModule) throws OpenEJBException {

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

            link(consumer);
        }

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

            link(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.