Search in sources :

Example 1 with UnifiedServiceRefMetaData

use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData in project wildfly by wildfly.

the class WSRefDDProcessor method getServiceRef.

private static UnifiedServiceRefMetaData getServiceRef(final DeploymentUnit unit, final ComponentDescription componentDescription, final ServiceReferenceMetaData serviceRefMD) throws DeploymentUnitProcessingException {
    //check jaxrpc service refs
    if (serviceRefMD.getJaxrpcMappingFile() != null || "javax.xml.rpc.Service".equals(serviceRefMD.getServiceInterface())) {
        throw WSLogger.ROOT_LOGGER.jaxRpcNotSupported();
    }
    // construct service ref
    final UnifiedServiceRefMetaData serviceRefUMDM = translate(serviceRefMD);
    serviceRefUMDM.setVfsRoot(getUnifiedVirtualFile(unit));
    processWSFeatures(unit, serviceRefMD.getInjectionTargets(), serviceRefUMDM);
    final WSRefRegistry wsRefRegistry = ASHelper.getWSRefRegistry(unit);
    wsRefRegistry.add(getCacheKey(componentDescription, serviceRefUMDM), serviceRefUMDM);
    return serviceRefUMDM;
}
Also used : UnifiedServiceRefMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData)

Example 2 with UnifiedServiceRefMetaData

use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData 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)

Example 3 with UnifiedServiceRefMetaData

use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData in project wildfly by wildfly.

the class WebServiceReferences method createServiceRef.

private static UnifiedServiceRefMetaData createServiceRef(final DeploymentUnit unit, final String type, final WSRefAnnotationWrapper annotation, final AnnotatedElement annotatedElement, final String bindingName, final String refKey) throws DeploymentUnitProcessingException {
    final WSRefRegistry wsRefRegistry = ASHelper.getWSRefRegistry(unit);
    UnifiedServiceRefMetaData serviceRefUMDM = wsRefRegistry.get(refKey);
    if (serviceRefUMDM == null) {
        serviceRefUMDM = new UnifiedServiceRefMetaData(getUnifiedVirtualFile(unit), bindingName);
        wsRefRegistry.add(refKey, serviceRefUMDM);
    }
    initServiceRef(unit, serviceRefUMDM, type, annotation);
    processWSFeatures(serviceRefUMDM, annotatedElement);
    return serviceRefUMDM;
}
Also used : UnifiedServiceRefMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData)

Example 4 with UnifiedServiceRefMetaData

use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData in project wildfly by wildfly.

the class UnifiedServiceRefDeploymentAspect method start.

@Override
public void start(final Deployment dep) {
    final DeploymentUnit unit = getRequiredAttachment(dep, DeploymentUnit.class);
    WSRefRegistry wsRefRegistry = ASHelper.getWSRefRegistry(unit);
    Object obj = dep.getProperty("ServiceAddressMap");
    if (obj != null) {
        @SuppressWarnings("unchecked") Map<QName, String> deployedPortsAddress = (Map<QName, String>) obj;
        for (UnifiedServiceRefMetaData metaData : wsRefRegistry.getUnifiedServiceRefMetaDatas()) {
            metaData.addDeployedServiceAddresses(deployedPortsAddress);
        }
    }
}
Also used : WSRefRegistry(org.jboss.as.webservices.webserviceref.WSRefRegistry) QName(javax.xml.namespace.QName) UnifiedServiceRefMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) Map(java.util.Map)

Example 5 with UnifiedServiceRefMetaData

use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData in project wildfly by wildfly.

the class WebServiceReferences method createWebServiceFactory.

public static ManagedReferenceFactory createWebServiceFactory(final DeploymentUnit deploymentUnit, final String targetType, final WSRefAnnotationWrapper wsRefDescription, final AnnotatedElement target, String bindingName, final String refKey) throws DeploymentUnitProcessingException {
    final UnifiedServiceRefMetaData serviceRefUMDM = createServiceRef(deploymentUnit, targetType, wsRefDescription, target, bindingName, refKey);
    final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
    return new WebServiceManagedReferenceFactory(serviceRefUMDM, module.getClassLoader());
}
Also used : UnifiedServiceRefMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData) Module(org.jboss.modules.Module)

Aggregations

UnifiedServiceRefMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData)5 Module (org.jboss.modules.Module)2 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 QName (javax.xml.namespace.QName)1 BindingConfiguration (org.jboss.as.ee.component.BindingConfiguration)1 FixedInjectionSource (org.jboss.as.ee.component.FixedInjectionSource)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 WSRefRegistry (org.jboss.as.webservices.webserviceref.WSRefRegistry)1 ServiceReferenceMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceMetaData)1 ServiceReferencesMetaData (org.jboss.metadata.javaee.spec.ServiceReferencesMetaData)1