public interface Resource
Modifier and Type | Method and Description |
---|---|
boolean |
alive()
Determine whether this
Resource can be used. |
boolean |
awaitAndShutdown()
Block until all submitted tasks have completed, then do a normal
shutdown() . |
boolean |
awaitAndShutdown(long timeout,
TimeUnit timeUnit)
Block until all submitted tasks have completed, then do a normal
shutdown() . |
void |
forceShutdown()
Shutdown this
Resource , forcibly halting any work currently executing and discarding any tasks that
have not yet been executed. |
void |
shutdown()
Shutdown this active
Resource such that it can no longer be used. |
boolean alive()
Resource
can be used.Resource
is alive and can be used, false otherwise.void shutdown()
Resource
such that it can no longer be used. If the resource carries any work,
it will wait (but NOT blocking the caller) for all the remaining tasks to perform before closing the resource.boolean awaitAndShutdown()
shutdown()
.boolean awaitAndShutdown(long timeout, TimeUnit timeUnit)
shutdown()
.void forceShutdown()
Resource
, forcibly halting any work currently executing and discarding any tasks that
have not yet been executed.Copyright © 2016. All rights reserved.