Interface ProcessStateNotifier


  • public interface ProcessStateNotifier
    Allows callers to check the current state of the process and to register for notifications of state changes.
    Author:
    Brian Stansberry
    • Field Detail

      • SERVICE_NAME

        static final org.jboss.msc.service.ServiceName SERVICE_NAME
        Only for use within the WildFly kernel; may change or be removed at any time
    • Method Detail

      • getEmbeddedProcessState

        EmbeddedProcessState getEmbeddedProcessState()
        Gets the current state of the controlled process.
        Returns:
        the current state. Will not be null
        Throws:
        IllegalStateException - if the process is not an embedded process
      • addProcessStateListener

        void addProcessStateListener​(PropertyChangeListener listener)
        Register a listener for changes in the current state. The listener will be notified with a PropertyChangeEvent whose property name will be embeddedState. If listener is null, no exception is thrown and no action is taken.
        Parameters:
        listener - the listener
        Throws:
        IllegalStateException - if the process is not an embedded process
      • removeProcessStateListener

        void removeProcessStateListener​(PropertyChangeListener listener)
        Remove a listener for changes in the current state. If listener was added more than once, it will be notified one less time after being removed. If listener is null, or was never added, no exception is thrown and no action is taken.
        Parameters:
        listener - the listener
        Throws:
        IllegalStateException - if the process is not an embedded process