Search in sources :

Example 1 with ServiceReferencesMetaData

use of org.jboss.metadata.javaee.spec.ServiceReferencesMetaData in project wildfly by wildfly.

the class WSRefDDProcessor method processDescriptorEntries.

@Override
protected List<BindingConfiguration> processDescriptorEntries(final DeploymentUnit unit, final DeploymentDescriptorEnvironment environment, final ResourceInjectionTarget resourceInjectionTarget, final ComponentDescription componentDescription, final ClassLoader classLoader, final DeploymentReflectionIndex deploymentReflectionIndex, final EEApplicationClasses applicationClasses) throws DeploymentUnitProcessingException {
    final ServiceReferencesMetaData serviceRefsMD = environment.getEnvironment().getServiceReferences();
    if (serviceRefsMD == null) {
        return Collections.<BindingConfiguration>emptyList();
    }
    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);
    }
    return bindingDescriptions;
}
Also used : FixedInjectionSource(org.jboss.as.ee.component.FixedInjectionSource) ServiceReferencesMetaData(org.jboss.metadata.javaee.spec.ServiceReferencesMetaData) UnifiedServiceRefMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData) Module(org.jboss.modules.Module) BindingConfiguration(org.jboss.as.ee.component.BindingConfiguration) LinkedList(java.util.LinkedList) ServiceReferenceMetaData(org.jboss.metadata.javaee.spec.ServiceReferenceMetaData)

Aggregations

LinkedList (java.util.LinkedList)1 BindingConfiguration (org.jboss.as.ee.component.BindingConfiguration)1 FixedInjectionSource (org.jboss.as.ee.component.FixedInjectionSource)1 ServiceReferenceMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceMetaData)1 ServiceReferencesMetaData (org.jboss.metadata.javaee.spec.ServiceReferencesMetaData)1 Module (org.jboss.modules.Module)1 UnifiedServiceRefMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData)1