FileDocCategorySizeDatePackage
WSDDJAXRPCHandlerInfoChain.javaAPI DocApache Axis 1.45221Sat Apr 22 18:57:28 BST 2006org.apache.axis.deployment.wsdd

WSDDJAXRPCHandlerInfoChain

public class WSDDJAXRPCHandlerInfoChain extends WSDDHandler

Fields Summary
protected static Log
log
private ArrayList
_hiList
private org.apache.axis.handlers.HandlerInfoChainFactory
_hiChainFactory
private String[]
_roles
Constructors Summary
public WSDDJAXRPCHandlerInfoChain()
Default constructor


           
      
    
public WSDDJAXRPCHandlerInfoChain(Element e)

param
e (Element) XXX
throws
WSDDException XXX

        super(e);

    ArrayList infoList = new ArrayList();
    _hiList = new ArrayList();
        Element[] elements = getChildElements(e, ELEM_WSDD_JAXRPC_HANDLERINFO);
        if (elements.length != 0) {
            for (int i = 0; i < elements.length; i++) {
                WSDDJAXRPCHandlerInfo handlerInfo =
                    new WSDDJAXRPCHandlerInfo(elements[i]);
        _hiList.add(handlerInfo);

                String handlerClassName = handlerInfo.getHandlerClassName();
                Class handlerClass = null;
                try {
                    handlerClass = ClassUtils.forName(handlerClassName);
                } catch (ClassNotFoundException cnf) { 
                    log.error(Messages.getMessage("handlerInfoChainNoClass00", handlerClassName), cnf);
                }

                Map handlerMap = handlerInfo.getHandlerMap();
                QName[] headers = handlerInfo.getHeaders();
                
                if (handlerClass != null) {
                    HandlerInfo hi =
                        new HandlerInfo(handlerClass, handlerMap, headers);
                    infoList.add(hi);
                }
            }
        }
        _hiChainFactory = new HandlerInfoChainFactory(infoList);
        
        elements = getChildElements(e,  ELEM_WSDD_JAXRPC_ROLE);
        if (elements.length != 0) {
            ArrayList roleList = new ArrayList();
            for (int i = 0; i < elements.length; i++) {
                String role = elements[i].getAttribute( ATTR_SOAPACTORNAME);
                roleList.add(role);
            }
            _roles =new String[roleList.size()]; 
            _roles = (String[]) roleList.toArray(_roles);
            _hiChainFactory.setRoles(_roles);
        }
        
    
Methods Summary
protected javax.xml.namespace.QNamegetElementName()

        return WSDDConstants.QNAME_JAXRPC_HANDLERINFOCHAIN;
    
public org.apache.axis.handlers.HandlerInfoChainFactorygetHandlerChainFactory()

        return _hiChainFactory;
    
public java.util.ArrayListgetHandlerInfoList()

        return _hiList;
    
public java.lang.String[]getRoles()

        return _roles;
    
public voidsetHandlerChainFactory(org.apache.axis.handlers.HandlerInfoChainFactory handlerInfoChainFactory)

        _hiChainFactory = handlerInfoChainFactory;
    
public voidsetHandlerInfoList(java.util.ArrayList hiList)

        _hiList = hiList;
    
public voidsetRoles(java.lang.String[] roles)

        _roles = roles;
    
public voidwriteToContext(org.apache.axis.encoding.SerializationContext context)
Write this element out to a SerializationContext

            context.startElement(QNAME_JAXRPC_HANDLERINFOCHAIN,null);
            
            List his = _hiList;
            Iterator iter = his.iterator();
            while (iter.hasNext()) {
                WSDDJAXRPCHandlerInfo hi = (WSDDJAXRPCHandlerInfo) iter.next();
                hi.writeToContext(context);
            }
            
            if (_roles != null) {
                for (int i=0; i < _roles.length ; i++) {
                    AttributesImpl attrs1 = new AttributesImpl();
                    attrs1.addAttribute("", ATTR_SOAPACTORNAME, ATTR_SOAPACTORNAME,
                               "CDATA", _roles[i]);
                    context.startElement(QNAME_JAXRPC_ROLE,attrs1);
                    context.endElement();
                }
            }
            
            context.endElement();