Package org.jboss.as.ee.component

Examples of org.jboss.as.ee.component.FixedInjectionSource


            } else if (!isEmpty(resourceRef.getResUrl())) {
                //
                if (classType != null && classType.equals(URI.class)) {
                    try {
                        //we need a newURI every time
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URI(resourceRef.getResUrl())));
                                } catch (URISyntaxException e) {
                                    throw new RuntimeException(e);
                                }
                            }
                        }, new URI(resourceRef.getResUrl())));
                    } catch (URISyntaxException e) {
                        throw MESSAGES.cannotParseResourceRefUri(e, resourceRef.getResUrl());
                    }
                } else {
                    try {
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URL(resourceRef.getResUrl())));
                                } catch (MalformedURLException e) {
View Full Code Here


        for (String refKey : bindingMap.keySet()) {
            String refName = bindingMap.get(refKey);
            ManagedReferenceFactory factory = WebServiceReferences.createWebServiceFactory(unit, type, annotation, target, refName, refKey);
            final EEModuleClassDescription classDescription = moduleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
            // Create the binding from whence our injection comes.
            final InjectionSource serviceRefSource = new FixedInjectionSource(factory, factory);
            final BindingConfiguration bindingConfiguration = new BindingConfiguration(refName, serviceRefSource);
            classDescription.getBindingConfigurations().add(bindingConfiguration);
            // our injection comes from the local lookup, no matter what.
            final ResourceInjectionConfiguration injectionConfiguration = injectionTarget != null ?
                    new ResourceInjectionConfiguration(injectionTarget, new LookupInjectionSource(refName)) : null;
View Full Code Here

        final List<BindingConfiguration> bindingDescriptions = new LinkedList<BindingConfiguration>();
        for (final ServiceReferenceMetaData serviceRefMD : serviceRefsMD) {
            final UnifiedServiceRefMetaData serviceRefUMDM = getServiceRef(unit, componentDescription, serviceRefMD);
            final Module module = unit.getAttachment(Attachments.MODULE);
            WebServiceManagedReferenceFactory factory = new WebServiceManagedReferenceFactory(serviceRefUMDM, module.getClassLoader());
            final FixedInjectionSource valueSource = new FixedInjectionSource(factory, factory);
            final BindingConfiguration bindingConfiguration = new BindingConfiguration(serviceRefUMDM.getServiceRefName(), valueSource);
            bindingDescriptions.add(bindingConfiguration);
            final String serviceRefTypeName = serviceRefUMDM.getServiceRefType();
            final Class<?> serviceRefType = getClass(classLoader, serviceRefTypeName);
            processInjectionTargets(resourceInjectionTarget, valueSource, classLoader, deploymentReflectionIndex, serviceRefMD, serviceRefType);
View Full Code Here

            } else if (!isEmpty(resourceRef.getResUrl())) {
                final String url = resourceRef.getResUrl();
                if (classType != null && classType.equals(URI.class)) {
                    try {
                        //we need a newURI every time
                        injectionSource = new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ImmediateManagedReference(new URI(url));
                                } catch (URISyntaxException e) {
                                    throw new RuntimeException(e);
                                }
                            }
                        }, new URI(url));
                    } catch (URISyntaxException e) {
                        throw EeLogger.ROOT_LOGGER.cannotParseResourceRefUri(e, resourceRef.getResUrl());
                    }
                } else {
                    try {
                        injectionSource = new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ImmediateManagedReference(new URL(url));
                                } catch (MalformedURLException e) {
View Full Code Here

            } else if (!isEmpty(resourceRef.getResUrl())) {
                //
                if (classType != null && classType.equals(URI.class)) {
                    try {
                        //we need a newURI every time
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URI(resourceRef.getResUrl())));
                                } catch (URISyntaxException e) {
                                    throw new RuntimeException(e);
                                }
                            }
                        }, new URI(resourceRef.getResUrl())));
                    } catch (URISyntaxException e) {
                        throw MESSAGES.cannotParseResourceRefUri(e, resourceRef.getResUrl());
                    }
                } else {
                    try {
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URL(resourceRef.getResUrl())));
                                } catch (MalformedURLException e) {
View Full Code Here

            } else if (!isEmpty(resourceRef.getResUrl())) {
                //
                if (classType != null && classType.equals(URI.class)) {
                    try {
                        //we need a newURI every time
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URI(resourceRef.getResUrl())));
                                } catch (URISyntaxException e) {
                                    throw new RuntimeException(e);
                                }
                            }
                        }, new URI(resourceRef.getResUrl())));
                    } catch (URISyntaxException e) {
                        throw MESSAGES.cannotParseResourceRefUri(e, resourceRef.getResUrl());
                    }
                } else {
                    try {
                        bindingConfiguration = new BindingConfiguration(name, new FixedInjectionSource(new ManagedReferenceFactory() {
                            @Override
                            public ManagedReference getReference() {
                                try {
                                    return new ValueManagedReference(new ImmediateValue(new URL(resourceRef.getResUrl())));
                                } catch (MalformedURLException e) {
View Full Code Here

TOP

Related Classes of org.jboss.as.ee.component.FixedInjectionSource

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.