Examples of HostConfiguration


Examples of org.apache.commons.httpclient.HostConfiguration

         *  so need to ensure that any items used in its equals/hashcode methods are
         *  not changed after use, i.e.:
         *  host, port, protocol, localAddress, proxy
         *
        */
        HostConfiguration hc = new HostConfiguration();
        hc.setHost(host, port, protocol); // All needed to ensure re-usablility

        // Set up the local address if one exists
        if (localAddress != null){
            hc.setLocalAddress(localAddress);
        }

        boolean useProxy = PROXY_DEFINED && !isNonProxy(host);
        if (useProxy) {
            if (log.isDebugEnabled()){
                log.debug("Setting proxy: "+PROXY_HOST+":"+PROXY_PORT);
            }
            hc.setProxy(PROXY_HOST, PROXY_PORT);
        }

        Map map = (Map) httpClients.get();
        HttpClient httpClient = (HttpClient) map.get(hc);

View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

     * Test that the httpURL is the same with the client.
     *
     * @return true if the given httpURL is the client for this resource.
     */
    protected synchronized boolean isTheClient() throws URIException {
        HostConfiguration hostConfig = client.getHostConfiguration();
        Credentials creds =
            client.getState().getCredentials(null, hostConfig.getHost());
        String userName = null;
        String password = null;

        if (creds instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials upc = (UsernamePasswordCredentials) creds;
            userName = upc.getUserName();
            password = upc.getPassword();
        }
        String ref = httpURL.getUser();
        boolean userMatches = userName != null ? userName.equals(ref)
                                               : ref == null;
        if (userMatches) {
            ref = httpURL.getPassword();
            userMatches = password != null ? password.equals(ref)
                                           : ref == null;
        } else {
            return false;
        }
        if (userMatches) {
            return httpURL.getHost().equalsIgnoreCase(hostConfig.getHost())
                && httpURL.getPort()
                == hostConfig.getProtocol().resolvePort(hostConfig.getPort());
        }
        return false;
    }
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

        if (this.hostConfiguration != null)
        {
            // If we are the same scheme than make sure we use our socket factory
            if ((scheme != null) && scheme.equals(hostConfiguration.getProtocol().getScheme()))
            {
                final HostConfiguration newConfiguration = new HostConfiguration(hostConfiguration) ;
                final String host = hostConfiguration.getHost() ;
                final int port = hostConfiguration.getPort() ;
                newConfiguration.setHost(host, port, this.hostConfiguration.getProtocol()) ;
                return newConfiguration ;
            }
        }
        return hostConfiguration ;
    }
View Full Code Here

Examples of org.apache.http.conn.HostConfiguration

         *
         * @param entry         the pool entry for the connection to delete
         */
        private synchronized void deleteConnection(TrackingPoolEntry entry) {

            HostConfiguration route = entry.plannedRoute;

            if (LOG.isDebugEnabled()) {
                LOG.debug("Reclaiming connection, hostConfig=" + route);
            }

View Full Code Here

Examples of org.rhq.modules.plugins.jbossas7.helper.HostConfiguration

                Thread.sleep(SECONDS.toMillis(1));
            }
        }

        // BZ 893802: wait until server (the process) is really down
        HostConfiguration hostConfig = getHostConfig();
        // commandLine instance is not important for determining whether the HostPort is local or not
        AS7CommandLine commandLine = new AS7CommandLine(new String[] { "java", "foo.Main",
            "org.jboss.as.host-controller" });
        HostPort hostPort = hostConfig.getDomainControllerHostPort(commandLine);

        if (hostPort.isLocal) {
            // lets be paranoid here
            for (ProcessInfo processInfo = context.getNativeProcess();; processInfo = context.getNativeProcess()) {
                if (processInfo == null) {
View Full Code Here

Examples of winstone.HostConfiguration

        ObjectInputStream inControl = new ObjectInputStream(in);
        int port = inControl.readInt();
        String ipPortSender = socket.getInetAddress().getHostAddress() + ":" + port;
        String sessionId = inControl.readUTF();
        String hostname = inControl.readUTF();
        HostConfiguration hostConfig = hostGroup.getHostByName(hostname);
        String webAppPrefix = inControl.readUTF();
        WebAppConfiguration webAppConfig = hostConfig.getWebAppByURI(webAppPrefix);
        ObjectOutputStream outData = new ObjectOutputStream(out);
        if (webAppConfig == null) {
            outData.writeUTF(ClusterSessionSearch.SESSION_NOT_FOUND);
        } else {
            WinstoneSession session = webAppConfig.getSessionById(sessionId, true);
View Full Code Here
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.