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

io.permazen.kv.raft.Service Maven / Gradle / Ivy


/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package io.permazen.kv.raft;

/**
 * Service instance invoked by the Raft service executor.
 */
abstract class Service implements Runnable {

    protected final Role role;
    protected final String desc;

    /**
     * Constructor.
     */
    Service(String desc) {
        this(null, desc);
    }

    /**
     * Constructor.
     */
    Service(Role role, String desc) {
        assert desc != null;
        this.role = role;
        this.desc = desc;
    }

    public Role getRole() {
        return this.role;
    }

    @Override
    public String toString() {
        return this.desc;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy