Package org.jboss.as.controller
Class ControlledProcessStateService
- java.lang.Object
-
- org.jboss.as.controller.ControlledProcessStateService
-
- All Implemented Interfaces:
ProcessStateNotifier
public class ControlledProcessStateService extends Object implements ProcessStateNotifier
Exposes the currentControlledProcessState.Stateand allows services to register a listener for changes to it.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc., Richard Opalka
-
-
Field Summary
Fields Modifier and Type Field Description static org.jboss.msc.service.ServiceNameINTERNAL_SERVICE_NAMEOnly for use within the WildFly Core kernel; may change or be removed at any timestatic org.jboss.msc.service.ServiceNameSERVICE_NAMEDeprecated.use the 'org.wildfly.management.process-state-notifier' capability to obtain aProcessStateNotifier
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)Registers a listener for changes to the process state.static ProcessStateNotifieraddService(org.jboss.msc.service.ServiceTarget target, ControlledProcessState processState)Obtains aProcessStateNotifierlinked to the givenprocessStateobject and installs an MSCServicethat provides it as its value.ControlledProcessState.StategetCurrentState()Returns the current process state.voidremovePropertyChangeListener(PropertyChangeListener listener)Removes a previouslyregistered listener.
-
-
-
Field Detail
-
SERVICE_NAME
@Deprecated public static final org.jboss.msc.service.ServiceName SERVICE_NAME
Deprecated.use the 'org.wildfly.management.process-state-notifier' capability to obtain aProcessStateNotifier
-
INTERNAL_SERVICE_NAME
public static final org.jboss.msc.service.ServiceName INTERNAL_SERVICE_NAME
Only for use within the WildFly Core kernel; may change or be removed at any time
-
-
Method Detail
-
addService
public static ProcessStateNotifier addService(org.jboss.msc.service.ServiceTarget target, ControlledProcessState processState)
Obtains aProcessStateNotifierlinked to the givenprocessStateobject and installs an MSCServicethat provides it as its value.- Parameters:
target- service target to use to install the service. Cannot benull.processState-ControlledProcessStateinstance whose changes will be tracked by the returned notifier.- Returns:
- the
ProcessStateNotifierthat is the value of the installed service.
-
getCurrentState
public ControlledProcessState.State getCurrentState()
Returns the current process state.- Specified by:
getCurrentStatein interfaceProcessStateNotifier- Returns:
- the current state
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Registers a listener for changes to the process state.- Specified by:
addPropertyChangeListenerin interfaceProcessStateNotifier- Parameters:
listener- the listener
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a previouslyregistered listener.- Specified by:
removePropertyChangeListenerin interfaceProcessStateNotifier- Parameters:
listener- the listener
-
-