Class BindingsLifecycleController
java.lang.Object
org.springframework.cloud.stream.binding.BindingsLifecycleController
Lifecycle controller for the bindings.
It is registered as a bean and once injected could be used to control the lifecycle f the bindings.
- Since:
- 3.x
- Author:
- Oleg Zhurakousky
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionBindingsLifecycleController
(List<InputBindingLifecycle> inputBindingLifecycles, List<OutputBindingLifecycle> outputBindingsLifecycles) -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeState
(String bindingName, BindingsLifecycleController.State state) General purpose method to change the state of the provided binding.void
Convenience method to pause the binding with provided `bindingName`.Binding<?>
queryState
(String name) Queries the individual state of a binding.Queries theList
of states for all available bindings.void
Convenience method to resume the binding with provided `bindingName`.void
Convenience method to start the binding with provided `bindingName`.void
Convenience method to stop the binding with provided `bindingName`.
-
Constructor Details
-
BindingsLifecycleController
public BindingsLifecycleController(List<InputBindingLifecycle> inputBindingLifecycles, List<OutputBindingLifecycle> outputBindingsLifecycles)
-
-
Method Details
-
stop
Convenience method to stop the binding with provided `bindingName`.- Parameters:
bindingName
- the name of the binding.
-
start
Convenience method to start the binding with provided `bindingName`.- Parameters:
bindingName
- the name of the binding.
-
pause
Convenience method to pause the binding with provided `bindingName`.- Parameters:
bindingName
- the name of the binding.
-
resume
Convenience method to resume the binding with provided `bindingName`.- Parameters:
bindingName
- the name of the binding.
-
changeState
General purpose method to change the state of the provided binding.- Parameters:
bindingName
- the name of the binding.state
- theBindingsLifecycleController.State
you wish to set this binding to
-
queryStates
Queries theList
of states for all available bindings. The returned list consists ofBinding
objects which could be further interrogated usingBinding.isPaused()
andBinding.isRunning()
.- Returns:
- the list of
Binding
s
-
queryState
Queries the individual state of a binding. The returned listBinding
object could be further interrogated usingBinding.isPaused()
andBinding.isRunning()
.- Returns:
- instance of
Binding
object.
-