Package com.taskadapter.redmineapi.internal.comm

Examples of com.taskadapter.redmineapi.internal.comm.ConnectionEvictor


     * @param evictionCheck     eviction check interval, seconds.
     */
    public static TransportConfiguration createLongTermConfiguration(
            final ClientConnectionManager connectionManager, int idleTimeout,
            int evictionCheck) {
        final ConnectionEvictor evictor = new ConnectionEvictor(
                connectionManager, evictionCheck, idleTimeout);

        final Thread evictorThread = new Thread(evictor);
        evictorThread.setDaemon(true);
        evictorThread
                .setName("Redmine communicator connection eviction thread");
        evictorThread.start();

        try {
            return TransportConfiguration.create(
                    getNewHttpClient(connectionManager), new Runnable() {
                        @Override
                        public void run() {
                            try {
                                connectionManager.shutdown();
                            } finally {
                                evictor.shutdown();
                            }
                        }
                    });
        } catch (RuntimeException t) {
            /* A little paranoia, StackOferflow, OOM, other excetpions. */
            evictor.shutdown();
            throw t;
        } catch (Error e) {
            evictor.shutdown();
            throw e;
        }
    }
View Full Code Here

TOP

Related Classes of com.taskadapter.redmineapi.internal.comm.ConnectionEvictor

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.