开发者

Can Guava's AbstractExecutionThreadService be reused?

As far as I can tell, once the run() method of AbstractExecutionThreadService stops, it can't be started again. Is that correct?

I have a service that extends AbstractExecutionThreadService. In my tests I want to start this service, use it, stop it, then start it again. Any suggestions what I开发者_StackOverflow社区 can/should do to achieve this while using AbstractExecutionThreadService or AbstractService?


Service.start() states that a stopped Service may not be restarted. I'd say just create a new instance of your service and start it each time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜