Class StartableProtocol

  • All Implemented Interfaces:
    Protocol

    public class StartableProtocol
    extends Object
    implements Protocol
    Protocol for a component that can be started and stopped.
    • Field Detail

      • START_INFO

        public static final ControlInfo START_INFO
        Info for the start control. It is an action control that should "start" the component. It may respond with an error if for some reason the component cannot be started.
      • STOP_INFO

        public static final ControlInfo STOP_INFO
        Info for the stop control. It is an action control that should "stop" the component. It may respond with an error if for some reason the component cannot be stopped.
      • IS_RUNNING_INFO

        public static final ControlInfo IS_RUNNING_INFO
        Info for the is-running control. It is a read-only boolean property that responds whether the component is currently running / started.
    • Constructor Detail

      • StartableProtocol

        public StartableProtocol()
    • Method Detail

      • controls

        public Stream<String> controls()
        Description copied from interface: Protocol
        The names of the controls that a component advertising this protocol must provide.
        Specified by:
        controls in interface Protocol
        Returns:
        stream of control names
      • getControlInfo

        public ControlInfo getControlInfo​(String control)
        Description copied from interface: Protocol
        Query the ControlInfo for the provided control name on this protocol. The component implementing this protocol will generally use the control info provided here inside its component info. In exceptional circumstances, the component may extend or adapt the behaviour of the control, as long as it is fully compatible with this control info and the specification.
        Specified by:
        getControlInfo in interface Protocol
        Parameters:
        control - name of control
        Returns:
        control info for named control