public abstract class AbstractService extends Thread implements Closeable
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
AbstractService() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
doInit() |
protected abstract void |
doService()
由子类实现具体服务处理逻辑
|
protected boolean |
doStart() |
void |
interrupt() |
boolean |
isInitialized() |
boolean |
isStarted() |
void |
run() |
void |
start() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
public boolean isInitialized()
public boolean isStarted()
protected void doInit()
protected boolean doStart()
protected abstract void doService()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2022. All rights reserved.