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

redis.embedded.ports.SequencePortProvider Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
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