Package org.wildfly.core.embedded.spi
Interface ProcessStateNotifier
-
public interface ProcessStateNotifierAllows callers to check the currentstateof the process and to register for notifications of state changes.- Author:
- Brian Stansberry
-
-
Field Summary
Fields Modifier and Type Field Description static org.jboss.msc.service.ServiceNameSERVICE_NAMEOnly for use within the WildFly kernel; may change or be removed at any time
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddProcessStateListener(PropertyChangeListener listener)Register a listener for changes in the current state.EmbeddedProcessStategetEmbeddedProcessState()Gets the current state of the controlled process.voidremoveProcessStateListener(PropertyChangeListener listener)Remove a listener for changes in the current state.
-
-
-
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 aPropertyChangeEventwhose property name will beembeddedState. Iflisteneris 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. Iflistenerwas added more than once, it will be notified one less time after being removed. Iflisteneris 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
-
-