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.State
and 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.ServiceName
INTERNAL_SERVICE_NAME
Only for use within the WildFly Core kernel; may change or be removed at any timestatic org.jboss.msc.service.ServiceName
SERVICE_NAME
Deprecated.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 void
addPropertyChangeListener(PropertyChangeListener listener)
Registers a listener for changes to the process state.static ProcessStateNotifier
addService(org.jboss.msc.service.ServiceTarget target, ControlledProcessState processState)
Obtains aProcessStateNotifier
linked to the givenprocessState
object and installs an MSCService
that provides it as its value.ControlledProcessState.State
getCurrentState()
Returns the current process state.void
removePropertyChangeListener(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 aProcessStateNotifier
linked to the givenprocessState
object and installs an MSCService
that provides it as its value.- Parameters:
target
- service target to use to install the service. Cannot benull
.processState
-ControlledProcessState
instance whose changes will be tracked by the returned notifier.- Returns:
- the
ProcessStateNotifier
that is the value of the installed service.
-
getCurrentState
public ControlledProcessState.State getCurrentState()
Returns the current process state.- Specified by:
getCurrentState
in interfaceProcessStateNotifier
- Returns:
- the current state
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Registers a listener for changes to the process state.- Specified by:
addPropertyChangeListener
in interfaceProcessStateNotifier
- Parameters:
listener
- the listener
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a previouslyregistered listener
.- Specified by:
removePropertyChangeListener
in interfaceProcessStateNotifier
- Parameters:
listener
- the listener
-
-