what-the-bank/sources/com/google/common/util/concurrent/Service.java

91 lines
2.6 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.common.util.concurrent;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/* loaded from: classes2.dex */
public interface Service {
/* loaded from: classes2.dex */
public static abstract class Listener {
public void failed(State state, Throwable th) {
}
public void running() {
}
public void starting() {
}
public void stopping(State state) {
}
public void terminated(State state) {
}
}
/* loaded from: classes2.dex */
public enum State {
NEW { // from class: com.google.common.util.concurrent.Service.State.1
@Override // com.google.common.util.concurrent.Service.State
final boolean isTerminal() {
return false;
}
},
STARTING { // from class: com.google.common.util.concurrent.Service.State.2
@Override // com.google.common.util.concurrent.Service.State
final boolean isTerminal() {
return false;
}
},
RUNNING { // from class: com.google.common.util.concurrent.Service.State.3
@Override // com.google.common.util.concurrent.Service.State
final boolean isTerminal() {
return false;
}
},
STOPPING { // from class: com.google.common.util.concurrent.Service.State.4
@Override // com.google.common.util.concurrent.Service.State
final boolean isTerminal() {
return false;
}
},
TERMINATED { // from class: com.google.common.util.concurrent.Service.State.5
@Override // com.google.common.util.concurrent.Service.State
final boolean isTerminal() {
return true;
}
},
FAILED { // from class: com.google.common.util.concurrent.Service.State.6
@Override // com.google.common.util.concurrent.Service.State
final boolean isTerminal() {
return true;
}
};
/* JADX INFO: Access modifiers changed from: package-private */
public abstract boolean isTerminal();
}
void addListener(Listener listener, Executor executor);
void awaitRunning();
void awaitRunning(long j, TimeUnit timeUnit) throws TimeoutException;
void awaitTerminated();
void awaitTerminated(long j, TimeUnit timeUnit) throws TimeoutException;
Throwable failureCause();
boolean isRunning();
Service startAsync();
State state();
Service stopAsync();
}