Package org.hobbit.utils
Interface Terminatable
- All Known Subinterfaces:
TerminatableRunnable
- All Known Implementing Classes:
DataReceiverImpl.MsgReceivingTask
public interface Terminatable
Simple interface for something that can be terminated, e.g., a running
process. The difference to
Closeable is that a termination does not
have to happen while the terminate() method is closed.- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns a flag whether the object has been asked to terminate.voidInforms the object that it should terminate.
-
Method Details
-
isTerminated
boolean isTerminated()Returns a flag whether the object has been asked to terminate. Note that if the method returnstrue, it does not have to be terminated.- Returns:
- returns
trueif it received a request to terminate
-
terminate
void terminate()Informs the object that it should terminate. Note that there is no guarantee that the termination will happen while this method is running, i.e., this method is not blocking and won't wait for the object to terminate.
-