Package com.volantis.shared.net.proxy

Examples of com.volantis.shared.net.proxy.ProxyFactory


    protected ProxyManager retrieveProxyManager(XMLPipelineContext context)
            throws HTTPException {

        // use system properties if available otherwise use proxy settings
        // from configuration file.
        ProxyFactory factory = ProxyFactory.getDefaultInstance();
        ProxyManager manager = factory.getSystemProxyManager();
        if (manager == null) {
            // First see if a proxy has been specified.
            String proxyRef = (String) context.getProperty(ProxyManager.class);
            if (proxyRef != null) {
                // Now look for the referenced proxy in the configuration.
View Full Code Here


     * @param proxy The old style proxy.
     */
    public ProxyManagerAdapter(Proxy proxy) {
        this.proxy = proxy;

        ProxyFactory factory = ProxyFactory.getDefaultInstance();

        ProxyBuilder builder = factory.createProxyBuilder();
        builder.setHost(proxy.getHost());
        builder.setPort(proxy.getPort());
        builder.setUser(proxy.getUser());
        builder.setPassword(proxy.getPassword());
        this.newProxy = builder.buildProxy();
View Full Code Here

        systemPropertiesMock.expects.getProperty(
                HTTPSystemPropertyKeys.HTTP_PROXY_HOST, "").returns(" ");
        systemPropertiesMock.expects.getProperty(
                HTTPSystemPropertyKeys.PROXY_HOST, "").returns(" ");

        ProxyFactory factory = new ProxyFactoryImpl(systemPropertiesMock);
        ProxyManager manager = factory.getSystemProxyManager();
        assertNull(manager);
    }
View Full Code Here

        // Ensure that when the host is specified a system proxy is created.
        addHTTPPropertyExpectations("foobar", "99", "me", "mine",
                "*.volantis.com|www.google.com");

        ProxyFactory factory = new ProxyFactoryImpl(systemPropertiesMock);
        ProxyManager manager = factory.getSystemProxyManager();

        Proxy proxy = manager.getProxyForHost("www.google.com2");
        assertNotNull(proxy);
        checkProxy(proxy, "foobar", 99, "me", "mine");

View Full Code Here

TOP

Related Classes of com.volantis.shared.net.proxy.ProxyFactory

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.