Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData


      if (srHandlers != null)
      {
         Iterator<ServiceReferenceHandlerMetaData> it = srHandlers.iterator();
         while (it.hasNext())
         {
            ServiceReferenceHandlerMetaData srHandlerMetaData = it.next();
            UnifiedHandlerMetaData uHandlerMetaData = getUnifiedHandlerMetaData(srHandlerMetaData);
            result.addHandler(uHandlerMetaData);
         }
      }

      ServiceReferenceHandlerChainsMetaData srHandlerChains = sref.getHandlerChains();
      if (srHandlerChains != null)
      {
         UnifiedHandlerChainsMetaData uHandlerChains = new UnifiedHandlerChainsMetaData();
         List<ServiceReferenceHandlerChainMetaData> srHandlerChainList = srHandlerChains.getHandlers();
         for (ServiceReferenceHandlerChainMetaData srHandlerChain : srHandlerChainList)
         {
            UnifiedHandlerChainMetaData uHandlerChain = new UnifiedHandlerChainMetaData();
            uHandlerChain.setServiceNamePattern(srHandlerChain.getServiceNamePattern());
            uHandlerChain.setPortNamePattern(srHandlerChain.getPortNamePattern());
            uHandlerChain.setProtocolBindings(srHandlerChain.getProtocolBindings());
            List<ServiceReferenceHandlerMetaData> srHandlerChainHandlers = srHandlerChain.getHandler();
            Iterator<ServiceReferenceHandlerMetaData> it = srHandlerChainHandlers.iterator();
            while (it.hasNext())
            {
               ServiceReferenceHandlerMetaData srHandlerMetaData = it.next();
               UnifiedHandlerMetaData uHandlerMetaData = getUnifiedHandlerMetaData(srHandlerMetaData);
               uHandlerChain.addHandler(uHandlerMetaData);
            }
            uHandlerChains.addHandlerChain(uHandlerChain);
         }
View Full Code Here


/* 124 */     if (srHandlers != null)
/*     */     {
/* 126 */       Iterator it = srHandlers.iterator();
/* 127 */       while (it.hasNext())
/*     */       {
/* 129 */         ServiceReferenceHandlerMetaData srHandlerMetaData = (ServiceReferenceHandlerMetaData)it.next();
/* 130 */         UnifiedHandlerMetaData uHandlerMetaData = getUnifiedHandlerMetaData(srHandlerMetaData);
/* 131 */         result.addHandler(uHandlerMetaData);
/*     */       }
/*     */     }
/*     */
/* 135 */     ServiceReferenceHandlerChainsMetaData srHandlerChains = sref.getHandlerChains();
/* 136 */     if (srHandlerChains != null)
/*     */     {
/* 138 */       UnifiedHandlerChainsMetaData uHandlerChains = new UnifiedHandlerChainsMetaData();
/* 139 */       List srHandlerChainList = srHandlerChains.getHandlers();
/* 140 */       for (ServiceReferenceHandlerChainMetaData srHandlerChain : srHandlerChainList)
/*     */       {
/* 142 */         UnifiedHandlerChainMetaData uHandlerChain = new UnifiedHandlerChainMetaData();
/* 143 */         uHandlerChain.setServiceNamePattern(srHandlerChain.getServiceNamePattern());
/* 144 */         uHandlerChain.setPortNamePattern(srHandlerChain.getPortNamePattern());
/* 145 */         uHandlerChain.setProtocolBindings(srHandlerChain.getProtocolBindings());
/* 146 */         List srHandlerChainHandlers = srHandlerChain.getHandler();
/* 147 */         Iterator it = srHandlerChainHandlers.iterator();
/* 148 */         while (it.hasNext())
/*     */         {
/* 150 */           ServiceReferenceHandlerMetaData srHandlerMetaData = (ServiceReferenceHandlerMetaData)it.next();
/* 151 */           UnifiedHandlerMetaData uHandlerMetaData = getUnifiedHandlerMetaData(srHandlerMetaData);
/* 152 */           uHandlerChain.addHandler(uHandlerMetaData);
/*     */         }
/* 154 */         uHandlerChains.addHandlerChain(uHandlerChain);
/*     */       }
View Full Code Here

* @author Remy Maucherat
*/
public class ServiceReferenceHandlerMetaDataParser extends MetaDataElementParser {

    public static ServiceReferenceHandlerMetaData parse(XMLStreamReader reader) throws XMLStreamException {
        ServiceReferenceHandlerMetaData handler = new ServiceReferenceHandlerMetaData();

        // Handle attributes
        final int count = reader.getAttributeCount();
        for (int i = 0; i < count; i ++) {
            final String value = reader.getAttributeValue(i);
            if (reader.getAttributeNamespace(i) != null) {
                continue;
            }
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case ID: {
                    handler.setId(value);
                    break;
                }
                default: throw unexpectedAttribute(reader, i);
            }
        }

        DescriptionGroupMetaData descriptionGroup = new DescriptionGroupMetaData();
        // Handle elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            if (DescriptionGroupMetaDataParser.parse(reader, descriptionGroup)) {
                if (handler.getDescriptionGroup() == null) {
                    handler.setDescriptionGroup(descriptionGroup);
                }
                continue;
            }
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case HANDLER_NAME:
                    handler.setHandlerName(reader.getElementText());
                    break;
                case HANDLER_CLASS:
                    handler.setHandlerClass(reader.getElementText());
                    break;
                case INIT_PARAM:
                    List<ParamValueMetaData> initParams = handler.getInitParam();
                    if (initParams == null) {
                        initParams = new ArrayList<ParamValueMetaData>();
                        handler.setInitParam(initParams);
                    }
                    initParams.add(ParamValueMetaDataParser.parse(reader));
                    break;
                case SOAP_HEADER:
                    List<QName> soapHeaders = handler.getSoapHeader();
                    if (soapHeaders == null) {
                        soapHeaders = new ArrayList<QName>();
                        handler.setSoapHeader(soapHeaders);
                    }
                    soapHeaders.add(parseQName(reader.getElementText()));
                    break;
                case SOAP_ROLE:
                    List<String> soapRoles = handler.getSoapRole();
                    if (soapRoles == null) {
                        soapRoles = new ArrayList<String>();
                        handler.setSoapRole(soapRoles);
                    }
                    soapRoles.add(reader.getElementText());
                    break;
                case PORT_NAME:
                    List<String> portNames = handler.getPortName();
                    if (portNames == null) {
                        portNames = new ArrayList<String>();
                        handler.setPortName(portNames);
                    }
                    portNames.add(reader.getElementText());
                    break;
                default: throw unexpectedElement(reader);
            }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.ServiceReferenceHandlerMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.