com.github.lontime.exthttp.configuration.ConnectionOption Maven / Gradle / Ivy
package com.github.lontime.exthttp.configuration;
import java.time.Duration;
import com.github.lontime.base.commonj.constants.Consts;
import lombok.Getter;
import lombok.Setter;
import static reactor.netty.resources.ConnectionProvider.LEASING_STRATEGY_FIFO;
/**
* ConnectionOption.
* @author lontime
* @since 1.0
*/
@Getter
@Setter
public class ConnectionOption {
private String name;
private Pool pool = new Pool();
public ConnectionOption() {
this(Consts.DEFAULT_OBJECT_NAME);
}
public ConnectionOption(String name) {
this.name = name;
}
@Getter
@Setter
public static class Pool {
private String name = Consts.DEFAULT_OBJECT_NAME;
private Integer maxConnections;
private Integer pendingAcquireMaxCount;
private Duration pendingAcquireTimeout;
private Duration maxIdleTime;
private Duration maxLifeTime;
private String leasingStrategy = LEASING_STRATEGY_FIFO;
private Double permitsSamplingRate;
private Duration evictionInterval;
private Duration disposeTimeout;
private Duration inactivePoolDisposeInterval;
private Duration poolInactivity;
}
}