Search in sources :

Example 1 with UnifiedHandlerMetaData

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

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

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

the class HandlerChainService method start.

@Override
public void start(final StartContext context) throws StartException {
    Comparator<UnifiedHandlerMetaData> c = new Comparator<UnifiedHandlerMetaData>() {

        @Override
        public int compare(UnifiedHandlerMetaData o1, UnifiedHandlerMetaData o2) {
            return o1.getId().compareTo(o2.getId());
        }
    };
    synchronized (handlers) {
        Collections.sort(handlers, c);
    }
    handlerChain = new UnifiedHandlerChainMetaData(null, null, protocolBindings, handlers, false, handlerChainId);
}
Also used : UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData) UnifiedHandlerChainMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData) Comparator(java.util.Comparator)

Example 4 with UnifiedHandlerMetaData

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

the class XTSHandlersManager method getHandlerChain.

public UnifiedHandlerChainMetaData getHandlerChain() {
    List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(2);
    if (enabled) {
        handlers.add(new UnifiedHandlerMetaData(BRIDGE_ENABLED_HANDLER_CLASS, BRIDGE_HANDLER_NAME, null, null, null, null));
        handlers.add(new UnifiedHandlerMetaData(WSAT_ENABLED_HANDLER_CLASS, WSAT_HANDLER_NAME, null, null, null, null));
    } else {
        handlers.add(new UnifiedHandlerMetaData(BRIDGE_DISABLED_HANDLER_CLASS, BRIDGE_HANDLER_NAME, null, null, null, null));
        handlers.add(new UnifiedHandlerMetaData(WSAT_DISABLED_HANDLER_CLASS, WSAT_HANDLER_NAME, null, null, null, null));
    }
    return new UnifiedHandlerChainMetaData(null, null, HANDLER_PROTOCOL_BINDINGS, handlers, false, HANDLER_CHAIN_ID);
}
Also used : UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData) UnifiedHandlerChainMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData) ArrayList(java.util.ArrayList)

Example 5 with UnifiedHandlerMetaData

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

the class WSRefUtils method getUnifiedHandlerMetaData.

private static UnifiedHandlerMetaData getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
    List<UnifiedInitParamMetaData> unifiedInitParamMDs = new LinkedList<UnifiedInitParamMetaData>();
    List<ParamValueMetaData> initParams = srhmd.getInitParam();
    if (initParams != null) {
        for (ParamValueMetaData initParam : initParams) {
            unifiedInitParamMDs.add(new UnifiedInitParamMetaData(initParam.getParamName(), initParam.getParamValue()));
        }
    }
    List<QName> soapHeaders = srhmd.getSoapHeader();
    Set<QName> soapHeaderList = soapHeaders != null ? new HashSet<QName>(soapHeaders) : null;
    List<String> soapRoles = srhmd.getSoapRole();
    Set<String> soapRolesList = soapRoles != null ? new HashSet<String>(soapRoles) : null;
    List<String> portNames = srhmd.getPortName();
    Set<String> portNameList = portNames != null ? new HashSet<String>(portNames) : null;
    return new UnifiedHandlerMetaData(srhmd.getHandlerClass(), srhmd.getHandlerName(), unifiedInitParamMDs, soapHeaderList, soapRolesList, portNameList);
}
Also used : UnifiedInitParamMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData) ParamValueMetaData(org.jboss.metadata.javaee.spec.ParamValueMetaData) QName(javax.xml.namespace.QName) LinkedList(java.util.LinkedList) UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData)

Aggregations

UnifiedHandlerMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData)6 UnifiedHandlerChainMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData)4 UnifiedHandlerChainsMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData)3 LinkedList (java.util.LinkedList)2 ServiceReferenceHandlerMetaData (org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData)2 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 HashSet (java.util.HashSet)1 QName (javax.xml.namespace.QName)1 JBossPortComponentRef (org.jboss.metadata.javaee.jboss.JBossPortComponentRef)1 JBossServiceReferenceMetaData (org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData)1 ParamValueMetaData (org.jboss.metadata.javaee.spec.ParamValueMetaData)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 UnifiedInitParamMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData)1 UnifiedPortComponentRefMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData)1 UnifiedServiceRefMetaDataBuilder (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaDataBuilder)1