Search in sources :

Example 1 with UnifiedHandlerChainsMetaData

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

the class WSHandlerChainAnnotationProcessor method getHandlers.

private static Set<String> getHandlers(final InputStream is) throws IOException {
    final Set<String> retVal = new HashSet<String>();
    final UnifiedHandlerChainsMetaData handlerChainsUMDM = UnifiedHandlerChainsMetaDataParser.parse(is);
    if (handlerChainsUMDM != null) {
        for (final UnifiedHandlerChainMetaData handlerChainUMDM : handlerChainsUMDM.getHandlerChains()) {
            for (final UnifiedHandlerMetaData handlerUMDM : handlerChainUMDM.getHandlers()) {
                retVal.add(handlerUMDM.getHandlerClass());
            }
        }
    }
    return retVal;
}
Also used : UnifiedHandlerChainMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData) UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData) UnifiedHandlerChainsMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData) HashSet(java.util.HashSet)

Example 2 with UnifiedHandlerChainsMetaData

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

Example 3 with UnifiedHandlerChainsMetaData

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

the class XTSHandlerDeploymentProcessor method updateXTSEndpoint.

private boolean updateXTSEndpoint(final String endpoint, final EndpointMetaData endpointMetaData, final List<WebserviceDescriptionMetaData> webserviceDescriptions, final DeploymentUnit unit) {
    if (endpointMetaData.isWebservice()) {
        final List<String> handlers = new ArrayList<String>();
        if (endpointMetaData.isBridgeEnabled()) {
            handlers.add(TX_BRIDGE_HANDLER);
        }
        handlers.add(TX_CONTEXT_HANDLER);
        if (!isAnyOfHandlersRegistered(unit, endpoint, handlers)) {
            final UnifiedHandlerChainsMetaData unifiedHandlerChainsMetaData = buildHandlerChains(handlers);
            final QName portQname = endpointMetaData.getWebServiceAnnotation().buildPortQName();
            webserviceDescriptions.add(new WebserviceDescriptionMetaData(null, null, null, buildPortComponent(endpointMetaData.isEJB(), endpoint, portQname, unifiedHandlerChainsMetaData)));
            registerHandlersWithAS(unit, endpoint, handlers);
            return true;
        }
    }
    return false;
}
Also used : WebserviceDescriptionMetaData(org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData) QName(javax.xml.namespace.QName) UnifiedHandlerChainsMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData) ArrayList(java.util.ArrayList)

Example 4 with UnifiedHandlerChainsMetaData

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

the class WSRefUtils method getUnifiedHandlerChainsMetaData.

private static UnifiedHandlerChainsMetaData getUnifiedHandlerChainsMetaData(final ServiceReferenceHandlerChainsMetaData handlerChainsMD) {
    List<UnifiedHandlerChainMetaData> uhcmds = new LinkedList<UnifiedHandlerChainMetaData>();
    for (final ServiceReferenceHandlerChainMetaData handlerChainMD : handlerChainsMD.getHandlers()) {
        List<UnifiedHandlerMetaData> uhmds = new LinkedList<UnifiedHandlerMetaData>();
        for (final ServiceReferenceHandlerMetaData handlerMD : handlerChainMD.getHandler()) {
            final UnifiedHandlerMetaData handlerUMDM = getUnifiedHandlerMetaData(handlerMD);
            uhmds.add(handlerUMDM);
        }
        uhcmds.add(new UnifiedHandlerChainMetaData(handlerChainMD.getServiceNamePattern(), handlerChainMD.getPortNamePattern(), handlerChainMD.getProtocolBindings(), uhmds, false, null));
    }
    return new UnifiedHandlerChainsMetaData(uhcmds);
}
Also used : ServiceReferenceHandlerMetaData(org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData) UnifiedHandlerChainMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData) ServiceReferenceHandlerChainMetaData(org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainMetaData) UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData) UnifiedHandlerChainsMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData) LinkedList(java.util.LinkedList)

Aggregations

UnifiedHandlerChainsMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData)4 UnifiedHandlerMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData)3 ServiceReferenceHandlerMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData)2 UnifiedHandlerChainMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 QName (javax.xml.namespace.QName)1 JBossPortComponentRef (org.jboss.metadata.javaee.jboss.JBossPortComponentRef)1 JBossServiceReferenceMetaData (org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData)1 PortComponentRef (org.jboss.metadata.javaee.spec.PortComponentRef)1 ServiceReferenceHandlerChainMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainMetaData)1 ServiceReferenceHandlerChainsMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceHandlerChainsMetaData)1 UnifiedPortComponentRefMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData)1 UnifiedServiceRefMetaDataBuilder (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder)1 WebserviceDescriptionMetaData (org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData)1