src/main/java/com/authlete/jaxrs/api/AuthleteApiImpl.java
private void setConnectionTimeout(javax.ws.rs.client.Client client)
    {
        // The timeout value.
        int timeout = mSettings.getConnectionTimeout();

        synchronized (mConnectionTimeoutLock)
        {
            if (mCurrentConnectionTimeout == timeout)
            {
                // The given value is the same as the current one.
                // Let's skip calling property() method.
                return;
            }

            // The given value is different from the current value.
            // Let's update the configuration.
            mCurrentConnectionTimeout = timeout;
        }

        //----------------------------------------------------------------------
        // Note that there was no standardized way to set the connection timeout
        // before JAX-RS API 2.1 (Java EE 8) (cf. ClientBuilder.connectTimeout).
        //----------------------------------------------------------------------

        // Convert int to Integer before calling property() method multiple times
        // in order to reduce the number of object creation by autoboxing.
        Integer value = Integer.valueOf(timeout);

        // For Jersey
        client.property("jersey.config.client.connectTimeout", value);

        // For Apache CXF
        client.property("http.connection.timeout", value);

        // For WebSphere (8.5.5.7+)
        client.property("com.ibm.ws.jaxrs.client.connection.timeout", value);
    }
private void setConnectionTimeout(javax.ws.rs.client.Client client)
    {
        // The timeout value.
        int timeout = mSettings.getConnectionTimeout();

        synchronized (mConnectionTimeoutLock)
        {
            if (mCurrentConnectionTimeout == timeout)
            {
                // The given value is the same as the current one.
                // Let's skip calling property() method.
                return;
            }

            // The given value is different from the current value.
            // Let's update the configuration.
            mCurrentConnectionTimeout = timeout;
        }

        //----------------------------------------------------------------------
        // Note that there was no standardized way to set the connection timeout
        // before JAX-RS API 2.1 (Java EE 8) (cf. ClientBuilder.connectTimeout).
        //----------------------------------------------------------------------

        // Convert int to Integer before calling property() method multiple times
        // in order to reduce the number of object creation by autoboxing.
        Integer value = Integer.valueOf(timeout);

        // For Jersey
        client.property("jersey.config.client.connectTimeout", value);

        // For Apache CXF
        client.property("http.connection.timeout", value);

        // For WebSphere (8.5.5.7+)
        client.property("com.ibm.ws.jaxrs.client.connection.timeout", value);
    }
Set a connection timeout.