Package io.mats3
Interface MatsConfig.StartStoppable
- All Known Subinterfaces:
JmsMatsStartStoppable,MatsEndpoint<R,,S> MatsFactory,MatsInterceptableMatsFactory,MatsStage<R,S, I>
- All Known Implementing Classes:
JmsMatsEndpoint,JmsMatsFactory,JmsMatsStage,MatsFactory.MatsFactoryWrapper,SpringJmsMatsFactoryWrapper
- Enclosing interface:
- MatsConfig
public static interface MatsConfig.StartStoppable
-
Method Summary
Modifier and TypeMethodDescriptionvoidstart()Will start the entity - or the entities below it (the only "active" entity is aMatsStageProcessor).booleanstop(int gracefulShutdownMillis) Will stop the entity - or the entities below it (the only "active" entity is aMatsStageProcessor).booleanwaitForReceiving(int timeoutMillis) If the entity is stopped or starting, this method won't return until it has actually started the receive-loop (i.e.
-
Method Details
-
start
void start()Will start the entity - or the entities below it (the only "active" entity is aMatsStageProcessor). Calling this method when the entity is already running has no effect. Further documentation on extensions - note the special semantics forMatsFactory -
waitForReceiving
boolean waitForReceiving(int timeoutMillis) If the entity is stopped or starting, this method won't return until it has actually started the receive-loop (i.e. that someMatsStageProcessor has actually entered its receive-loop, consuming messages). If the entity has already gotten into the receive loop, the method immediately returns. Note: Currently, this only holds for the initial start. If the entity has started the receive-loop at some point, it will always immediately return - even though it is currently stopped. Further documentation on extensions.- Parameters:
timeoutMillis- number of milliseconds before giving up the wait, returningfalse. 0 is indefinite wait, negative values are not allowed.- Returns:
trueif the entity started within the timeout,falseif it did not start.
-
stop
boolean stop(int gracefulShutdownMillis) Will stop the entity - or the entities below it (the only "active" entity is aMatsStageProcessor). This method is idempotent, calling it when the entity is already stopped has no effect. Further documentation on extensions - note the special semantics forMatsFactory- Parameters:
gracefulShutdownMillis- number of milliseconds to let the stage processors wait after having asked for them to shut down, and interrupting them if they have not shut down yet.- Returns:
trueif the running thread(s) were dead when returning,falseotherwise.
-