All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dona.doip.client.ConnectionAndPool Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package net.dona.doip.client;

import net.dona.doip.client.transport.DoipConnection;
import net.dona.doip.client.transport.DoipConnectionPool;

/**
 * Used internally by {@link DoipClient} to manage pools of connections.
 */
public class ConnectionAndPool {
    private final DoipConnection connection;
    private final DoipConnectionPool pool;

    public ConnectionAndPool(DoipConnectionPool pool) {
        this.connection = pool.get();
        this.pool = pool;
    }

    public void releaseConnection() throws InterruptedException {
        pool.release(connection);
    }

    public DoipConnection getConnection() { return connection; }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy