redis.embedded.ports.SequencePortProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of embedded-redis Show documentation
Show all versions of embedded-redis Show documentation
Redis embedded server for Java integration testing
package redis.embedded.ports;
import redis.embedded.PortProvider;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Created by piotrturek on 29/01/15.
*/
public class SequencePortProvider implements PortProvider {
private AtomicInteger currentPort = new AtomicInteger(26379);
public SequencePortProvider() {
}
public SequencePortProvider(int currentPort) {
this.currentPort.set(currentPort);
}
public void setCurrentPort(int port) {
currentPort.set(port);
}
@Override
public int next() {
return currentPort.getAndIncrement();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy