public abstract class AbstractOfficeEntryManager extends Object implements OfficeManager
| Modifier and Type | Field and Description |
|---|---|
protected OfficeManagerEntryBuilder |
config |
protected Future<?> |
currentFuture |
protected SuspendableThread |
taskExecutor |
| Constructor and Description |
|---|
AbstractOfficeEntryManager(OfficeManagerEntryBuilder config)
使用指定的配置初始化新的池条目.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doExecute(MadeInOffice task)
执行任务.
|
protected abstract void |
doStart()
当office管理器启动时,允许子类执行操作.
|
protected abstract void |
doStop()
当office管理器停止时,允许子类执行操作.
|
void |
execute(MadeInOffice task)
执行指定的任务并阻塞,直到任务终止
|
protected void |
handleExecuteTimeoutException(TimeoutException timeoutEx)
处理在执行任务时引发的超时异常.
|
boolean |
isRunning()
获取管理器是否正在运行
|
void |
start()
启动管理器
|
void |
stop()
停止管理器
|
protected final OfficeManagerEntryBuilder config
protected final SuspendableThread taskExecutor
protected Future<?> currentFuture
public AbstractOfficeEntryManager(OfficeManagerEntryBuilder config)
config - 输入配置.public final void execute(MadeInOffice task) throws InstrumentException
OfficeManagerexecute in interface OfficeManagertask - 要执行的任务InstrumentException - 如果发生错误protected abstract void doExecute(MadeInOffice task) throws Exception
task - 任务Exception - 如果转换期间发生任何错误.protected void handleExecuteTimeoutException(TimeoutException timeoutEx)
timeoutEx - 抛出异常.public boolean isRunning()
OfficeManagerisRunning in interface OfficeManagertrue,否则为falsepublic final void start()
throws InstrumentException
OfficeManagerstart in interface OfficeManagerInstrumentException - 如果管理器不能启动protected abstract void doStart()
throws InstrumentException
InstrumentException - 如果启动管理器时发生错误.public final void stop()
throws InstrumentException
OfficeManagerstop in interface OfficeManagerInstrumentException - 如果管理器不能停止protected abstract void doStop()
throws InstrumentException
InstrumentException - 如果在停止管理器时发生错误.Copyright © 2020. All rights reserved.