Search in sources :

Example 1 with ServiceReferenceHandlerChainsMetaData

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

the class WSRefUtils method translate.

static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData serviceRefMD) {
    UnifiedServiceRefMetaDataBuilder builder = new UnifiedServiceRefMetaDataBuilder();
    builder.setServiceRefName(serviceRefMD.getName());
    builder.setServiceRefType(serviceRefMD.getServiceRefType());
    builder.setServiceInterface(serviceRefMD.getServiceInterface());
    builder.setWsdlFile(serviceRefMD.getWsdlFile());
    builder.setMappingFile(serviceRefMD.getJaxrpcMappingFile());
    builder.setServiceQName(serviceRefMD.getServiceQname());
    // propagate port components
    final Collection<? extends PortComponentRef> portComponentsMD = serviceRefMD.getPortComponentRef();
    if (portComponentsMD != null) {
        for (final PortComponentRef portComponentMD : portComponentsMD) {
            final UnifiedPortComponentRefMetaData portComponentUMDM = getUnifiedPortComponentRefMetaData(portComponentMD);
            if (portComponentUMDM.getServiceEndpointInterface() != null || portComponentUMDM.getPortQName() != null) {
                builder.addPortComponentRef(portComponentUMDM);
            } else {
                WSLogger.ROOT_LOGGER.ignoringPortComponentRef(portComponentUMDM);
            }
        }
    }
    // propagate handlers
    final Collection<ServiceReferenceHandlerMetaData> handlersMD = serviceRefMD.getHandlers();
    if (handlersMD != null) {
        for (final ServiceReferenceHandlerMetaData handlerMD : handlersMD) {
            final UnifiedHandlerMetaData handlerUMDM = getUnifiedHandlerMetaData(handlerMD);
            builder.addHandler(handlerUMDM);
        }
    }
    // propagate handler chains
    ServiceReferenceHandlerChainsMetaData handlerChainsMD = serviceRefMD.getHandlerChains();
    if (handlerChainsMD != null) {
        final UnifiedHandlerChainsMetaData handlerChainsUMDM = getUnifiedHandlerChainsMetaData(handlerChainsMD);
        builder.setHandlerChains(handlerChainsUMDM);
    }
    // propagate jboss specific MD
    if (serviceRefMD instanceof JBossServiceReferenceMetaData) {
        final JBossServiceReferenceMetaData jbossServiceRefMD = (JBossServiceReferenceMetaData) serviceRefMD;
        builder.setServiceImplClass(jbossServiceRefMD.getServiceClass());
        builder.setConfigName(jbossServiceRefMD.getConfigName());
        builder.setConfigFile(jbossServiceRefMD.getConfigFile());
        builder.setWsdlOverride(jbossServiceRefMD.getWsdlOverride());
        builder.setHandlerChain(jbossServiceRefMD.getHandlerChain());
    }
    return builder.build();
}
Also used : JBossPortComponentRef(org.jboss.metadata.javaee.jboss.JBossPortComponentRef) PortComponentRef(org.jboss.metadata.javaee.spec.PortComponentRef) ServiceReferenceHandlerMetaData(org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData) JBossServiceReferenceMetaData(org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData) UnifiedServiceRefMetaDataBuilder(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder) UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData) UnifiedHandlerChainsMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData) ServiceReferenceHandlerChainsMetaData(org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainsMetaData) UnifiedPortComponentRefMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData)

Aggregations

JBossPortComponentRef (org.jboss.metadata.javaee.jboss.JBossPortComponentRef)1 JBossServiceReferenceMetaData (org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData)1 PortComponentRef (org.jboss.metadata.javaee.spec.PortComponentRef)1 ServiceReferenceHandlerChainsMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainsMetaData)1 ServiceReferenceHandlerMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData)1 UnifiedHandlerChainsMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData)1 UnifiedHandlerMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData)1 UnifiedPortComponentRefMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData)1 UnifiedServiceRefMetaDataBuilder (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder)1