Package org.objectweb.celtix.bus.configuration.wsdl

Source Code of org.objectweb.celtix.bus.configuration.wsdl.WsdlHttpConfigurationProvider

package org.objectweb.celtix.bus.configuration.wsdl;

import java.util.List;

import javax.wsdl.Port;
import javax.wsdl.extensions.ExtensibilityElement;

import org.objectweb.celtix.configuration.Configuration;
import org.objectweb.celtix.configuration.ConfigurationProvider;
import org.objectweb.celtix.transports.http.configuration.HTTPClientPolicy;
import org.objectweb.celtix.transports.http.configuration.HTTPServerPolicy;

public class WsdlHttpConfigurationProvider implements ConfigurationProvider {
    private final Port port;
    private final boolean serverType;

    public WsdlHttpConfigurationProvider(Port p, boolean s) {
        port = p;
        serverType = s;
    }

    public void init(Configuration configuration) {
        // not needed
    }

    public Object getObject(String name) {
        if (null == port) {
            return null;
        }
        if ((serverType && "httpServer".equals(name)) || (!serverType && "httpClient".equals(name))) {
            List<?> list = port.getExtensibilityElements();
            for (Object ep : list) {
                ExtensibilityElement ext = (ExtensibilityElement)ep;
                if ((serverType && ext instanceof HTTPServerPolicy)
                    || (!serverType && ext instanceof HTTPClientPolicy)) {
                    return ext;
                }
            }
        }
        return null;
    }

    /**
     * TODO
     */
    public boolean setObject(String name, Object value) {
        return false;
    }
   

    public boolean save() {
        //TODO:
        return false;
    }
   
}
TOP

Related Classes of org.objectweb.celtix.bus.configuration.wsdl.WsdlHttpConfigurationProvider

TOP
Copyright © 2018 www.massapi.com. 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.