Class ServiceControllerImpl<S>
- java.lang.Object
-
- org.jboss.msc.service.ServiceControllerImpl<S>
-
- Type Parameters:
S
- the service type
- All Implemented Interfaces:
Dependent
,ServiceController<S>
,Value<S>
final class ServiceControllerImpl<S> extends java.lang.Object implements ServiceController<S>, Dependent
The service controller implementation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.msc.service.ServiceController
ServiceController.Mode, ServiceController.State, ServiceController.Substate, ServiceController.Transition
-
-
Field Summary
Fields Modifier and Type Field Description private ServiceRegistrationImpl[]
aliasRegistrations
The alias registrations of this service.private int
asyncTasks
The number of asynchronous tasks that are currently running.private IdentityHashSet<ServiceControllerImpl<?>>
children
The children of this service (only valid duringServiceController.State.UP
).private ServiceControllerImpl.ChildServiceTarget
childTarget
The service target for adding child services (can benull
if none were added).private int
demandedByCount
The number of registrations which place a demand-to-start on this instance.private Dependency[]
dependencies
The dependencies of this service.private boolean
dependenciesDemanded
Indicates whether dependencies have been demanded.private int
failCount
Count for failure notification.private static java.lang.String
ILLEGAL_CONTROLLER_STATE
private IdentityHashSet<ServiceName>
immediateUnavailableDependencies
The immediate unavailable dependencies of this service.private ValueInjection<?>[]
injections
The injections of this service.private long
lifecycleTime
The system nanotime of the moment in which the last lifecycle change was initiated.private IdentityHashSet<ServiceListener<? super S>>
listeners
The set of registered service listeners.(package private) static int
MAX_DEPENDENCIES
private ServiceController.Mode
mode
The controller mode.private IdentityHashSet<StabilityMonitor>
monitors
The set of registered stability monitors.private static ServiceControllerImpl<?>[]
NO_CONTROLLERS
private static Dependent[]
NO_DEPENDENTS
private static ServiceName[]
NO_NAMES
private static java.lang.String[]
NO_STRINGS
private ValueInjection<?>[]
outInjections
The out injections of this service.private ServiceControllerImpl<?>
parent
The parent of this service.private ServiceRegistrationImpl
primaryRegistration
The primary registration of this service.private int
runningDependents
The number of dependents that are currently running.private Value<? extends Service<S>>
serviceValue
The service itself.private StartException
startException
The start exception.private ServiceController.Substate
state
The controller state.private int
stoppingDependencies
Count for dependencies that are trying to stop.private int
transitiveUnavailableDepCount
Indicates if this service has one or more transitive dependencies that are not available.private int
unstartedDependencies
The number of dependencies which are not yet started.
-
Constructor Summary
Constructors Constructor Description ServiceControllerImpl(Value<? extends Service<S>> serviceValue, Dependency[] dependencies, ValueInjection<?>[] injections, ValueInjection<?>[] outInjections, ServiceRegistrationImpl primaryRegistration, ServiceRegistrationImpl[] aliasRegistrations, java.util.Set<StabilityMonitor> monitors, java.util.Set<? extends ServiceListener<? super S>> listeners, ServiceControllerImpl<?> parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addAsyncTasks(int size)
(package private) void
addChild(ServiceControllerImpl<?> child)
(package private) void
addDemand()
(package private) void
addDemands(int demandedByCount)
private void
addDependentsByName(ServiceRegistrationImpl registration, java.util.Map<ServiceName,Dependent[]> dependentsByName)
void
addListener(ServiceListener<? super S> listener)
Add a service listener.(package private) void
addMonitor(StabilityMonitor stabilityMonitor)
S
awaitValue()
Wait for a service to come up, and then return its value.S
awaitValue(long time, java.util.concurrent.TimeUnit unit)
Wait for a service to come up for a certain amount of time, and then return its value.(package private) void
commitInstallation(ServiceController.Mode initialMode)
Commit the service install, kicking off the mode set and listener execution.boolean
compareAndSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)
Compare the current mode againstexpected
; if it matches, change it tonewMode
.void
dependencyFailed()
Notify this dependent that one of its dependencies (immediate or transitive) failed to start.void
dependencyFailureCleared()
Notify this dependent that all dependency failures previouslynotified
are now cleared.(package private) void
dependentStarted()
(package private) void
dependentStopped()
private void
doDemandDependencies()
(package private) void
doExecute(java.util.ArrayList<java.lang.Runnable> tasks)
private static <T> void
doInject(ValueInjection<T> injection)
private void
doUndemandDependencies()
(package private) java.lang.String
dumpServiceDetails()
ServiceName[]
getAliases()
Get other names this service is known as.(package private) ServiceRegistrationImpl[]
getAliasRegistrations()
(package private) IdentityHashSet<ServiceControllerImpl<?>>
getChildren()
ServiceControllerImpl<?>
getController()
Get the controller of this dependent.private Dependent[][]
getDependents()
Returns a compiled array of all dependents of this service instance.private java.util.Map<ServiceName,Dependent[]>
getDependentsByDependencyName()
Returns a compiled map of all dependents of this service mapped by the dependency name.java.util.Set<ServiceName>
getImmediateUnavailableDependencies()
Get the complete list of immediate dependencies that are unavailable.private void
getListenerTasks(ServiceController.Transition transition, java.util.ArrayList<java.lang.Runnable> tasks)
private void
getListenerTasks(ServiceControllerImpl.ListenerNotification notification, java.util.ArrayList<java.lang.Runnable> tasks)
ServiceController.Mode
getMode()
Get the service controller's current mode.(package private) java.util.Set<StabilityMonitor>
getMonitors()
ServiceName
getName()
Get the name of this service, if any.ServiceControllerImpl<?>
getParent()
Get this service's parent service, ornull
if there is none.(package private) ServiceRegistrationImpl
getPrimaryRegistration()
Service<S>
getService()
Get the service.ServiceContainerImpl
getServiceContainer()
Get the service container associated with this controller.StartException
getStartException()
Get the reason why the last start failed.ServiceController.State
getState()
Get the current service controller state.(package private) ServiceStatus
getStatus()
ServiceController.Substate
getSubstate()
Get the current service controller substate.(package private) ServiceController.Substate
getSubstateLocked()
private ServiceController.Transition
getTransition()
Identify the transition to take.S
getValue()
Get the service value.void
immediateDependencyAvailable(ServiceName dependencyName)
Notify this dependent that one of its immediate dependencies is available, i.e., it is installed and, if notstarted
, should start shortly.void
immediateDependencyDown()
Notify this dependent that one of its immediate dependencies is leaving theUP
state.void
immediateDependencyUnavailable(ServiceName dependencyName)
Notify this dependent that one of its immediate dependencies is unavailable.
A dependency is unavailable when it is not installed or when it is inNEVER
mode.void
immediateDependencyUp()
Notify this dependent that one of its immediate dependencies enteredUP
state.private void
internalSetMode(ServiceController.Mode newMode, java.util.ArrayList<java.lang.Runnable> taskList)
private boolean
internalSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)
private void
invokeListener(ServiceListener<? super S> listener, ServiceControllerImpl.ListenerNotification notification, ServiceController.Transition transition)
Invokes the listener, performing the notification specified.(package private) boolean
isInstallationCommitted()
Returntrue
only if this service controller installation is committed.(package private) boolean
isStableRestState()
Returns true if controller is in rest state and no async tasks are running, false otherwise.(package private) void
newDependent(ServiceName dependencyName, Dependent dependent)
private void
propagateTransitiveAvailability()
private void
propagateTransitiveUnavailability()
(package private) void
removeAsyncTask()
(package private) void
removeChild(ServiceControllerImpl<?> child)
(package private) void
removeDemand()
void
removeListener(ServiceListener<? super S> listener)
Remove a service listener.(package private) void
removeMonitor(StabilityMonitor stabilityMonitor)
(package private) void
removeMonitorNoCallback(StabilityMonitor stabilityMonitor)
void
retry()
Retry a failed service.(package private) void
rollbackInstallation()
Roll back the service install.void
setMode(ServiceController.Mode newMode)
Change the service controller's current mode.private static java.lang.ClassLoader
setTCCL(java.lang.ClassLoader newTCCL)
private boolean
shouldStart()
Determine whether a stopped controller should start.private boolean
shouldStop()
Determine whether a running controller should stop.(package private) void
startInstallation()
Start this service installation, connecting it to its parent and dependencies.java.lang.String
toString()
(package private) void
transition(java.util.ArrayList<java.lang.Runnable> tasks)
Run the locked portion of a transition.void
transitiveDependencyAvailable()
Notify this dependent that allunavailable
transitive dependencies are now available (i.e., they are installed and will perform an attempt to start shortly).void
transitiveDependencyUnavailable()
Notify this dependent that one of its transitive dependencies is unavailable (either uninstalled, or inNEVER mode
).(package private) void
updateStabilityState(boolean leavingStableRestState)
private void
writeProfileInfo(char statusChar, long startNanos, long endNanos)
-
-
-
Field Detail
-
ILLEGAL_CONTROLLER_STATE
private static final java.lang.String ILLEGAL_CONTROLLER_STATE
- See Also:
- Constant Field Values
-
dependencies
private final Dependency[] dependencies
The dependencies of this service.
-
injections
private final ValueInjection<?>[] injections
The injections of this service.
-
outInjections
private final ValueInjection<?>[] outInjections
The out injections of this service.
-
listeners
private final IdentityHashSet<ServiceListener<? super S>> listeners
The set of registered service listeners.
-
monitors
private final IdentityHashSet<StabilityMonitor> monitors
The set of registered stability monitors.
-
primaryRegistration
private final ServiceRegistrationImpl primaryRegistration
The primary registration of this service.
-
aliasRegistrations
private final ServiceRegistrationImpl[] aliasRegistrations
The alias registrations of this service.
-
parent
private final ServiceControllerImpl<?> parent
The parent of this service.
-
children
private final IdentityHashSet<ServiceControllerImpl<?>> children
The children of this service (only valid duringServiceController.State.UP
).
-
immediateUnavailableDependencies
private final IdentityHashSet<ServiceName> immediateUnavailableDependencies
The immediate unavailable dependencies of this service.
-
startException
private StartException startException
The start exception.
-
mode
private ServiceController.Mode mode
The controller mode.
-
state
private ServiceController.Substate state
The controller state.
-
demandedByCount
private int demandedByCount
The number of registrations which place a demand-to-start on this instance. If this value is >0, propagate a demand up to all parent dependents. If this value is >0 and mode is ON_DEMAND, we should start.
-
unstartedDependencies
private int unstartedDependencies
The number of dependencies which are not yet started. This service cannot start until this count reaches zero.
-
stoppingDependencies
private int stoppingDependencies
Count for dependencies that are trying to stop. If this count is greater than zero then dependents will be notified that a stop is necessary.
-
runningDependents
private int runningDependents
The number of dependents that are currently running. The deployment will not execute thestop()
method (and subsequently leave theServiceController.State.STOPPING
state) until all running dependents (and listeners) are stopped.
-
failCount
private int failCount
Count for failure notification. It indicates how many services have failed to start and are not recovered so far. This count monitors failures that happen when starting this service, and dependency related failures as well. When incremented from 0 to 1, it is time to notify dependents and listeners that a failure occurred. When decremented from 1 to 0, the dependents and listeners are notified that the affected services are retrying to start. Values larger than 1 are ignored to avoid multiple notifications.
-
transitiveUnavailableDepCount
private int transitiveUnavailableDepCount
Indicates if this service has one or more transitive dependencies that are not available. Count for notification of unavailable dependencies. Its value indicates how many transitive dependencies are unavailable. When incremented from 0 to 1, dependents are notified of the unavailable dependency unless immediateUnavailableDependencies is not empty. When decremented from 1 to 0, a notification that the unavailable dependencies are now available is sent to dependents, unless immediateUnavailableDependencies is not empty. Values larger than 1 are ignored to avoid multiple notifications.
-
dependenciesDemanded
private boolean dependenciesDemanded
Indicates whether dependencies have been demanded.
-
asyncTasks
private int asyncTasks
The number of asynchronous tasks that are currently running. This includes listeners, start/stop methods, outstanding asynchronous start/stops, and internal tasks.
-
childTarget
private volatile ServiceControllerImpl.ChildServiceTarget childTarget
The service target for adding child services (can benull
if none were added).
-
lifecycleTime
private volatile long lifecycleTime
The system nanotime of the moment in which the last lifecycle change was initiated.
-
NO_DEPENDENTS
private static final Dependent[] NO_DEPENDENTS
-
NO_CONTROLLERS
private static final ServiceControllerImpl<?>[] NO_CONTROLLERS
-
NO_STRINGS
private static final java.lang.String[] NO_STRINGS
-
MAX_DEPENDENCIES
static final int MAX_DEPENDENCIES
- See Also:
- Constant Field Values
-
NO_NAMES
private static final ServiceName[] NO_NAMES
-
-
Constructor Detail
-
ServiceControllerImpl
ServiceControllerImpl(Value<? extends Service<S>> serviceValue, Dependency[] dependencies, ValueInjection<?>[] injections, ValueInjection<?>[] outInjections, ServiceRegistrationImpl primaryRegistration, ServiceRegistrationImpl[] aliasRegistrations, java.util.Set<StabilityMonitor> monitors, java.util.Set<? extends ServiceListener<? super S>> listeners, ServiceControllerImpl<?> parent)
-
-
Method Detail
-
getSubstateLocked
ServiceController.Substate getSubstateLocked()
-
addAsyncTasks
void addAsyncTasks(int size)
-
removeAsyncTask
void removeAsyncTask()
-
startInstallation
void startInstallation()
Start this service installation, connecting it to its parent and dependencies. Also, set the instance in primary and alias registrations.All notifications from dependencies, parents, and registrations will be ignored until the installation is
committed
.
-
commitInstallation
void commitInstallation(ServiceController.Mode initialMode)
Commit the service install, kicking off the mode set and listener execution.- Parameters:
initialMode
- the initial service mode
-
rollbackInstallation
void rollbackInstallation()
Roll back the service install.
-
isInstallationCommitted
boolean isInstallationCommitted()
Returntrue
only if this service controller installation is committed.- Returns:
- true if this service controller installation is committed
-
shouldStart
private boolean shouldStart()
Determine whether a stopped controller should start.- Returns:
true
if so
-
shouldStop
private boolean shouldStop()
Determine whether a running controller should stop.- Returns:
true
if so
-
isStableRestState
boolean isStableRestState()
Returns true if controller is in rest state and no async tasks are running, false otherwise.- Returns:
- true if stable rest state, false otherwise
-
updateStabilityState
void updateStabilityState(boolean leavingStableRestState)
-
getTransition
private ServiceController.Transition getTransition()
Identify the transition to take. Call under lock.- Returns:
- the transition or
null
if none is needed at this time
-
transition
void transition(java.util.ArrayList<java.lang.Runnable> tasks)
Run the locked portion of a transition. Call under lock.- Parameters:
tasks
- the list to which async tasks should be appended
-
getListenerTasks
private void getListenerTasks(ServiceController.Transition transition, java.util.ArrayList<java.lang.Runnable> tasks)
-
getListenerTasks
private void getListenerTasks(ServiceControllerImpl.ListenerNotification notification, java.util.ArrayList<java.lang.Runnable> tasks)
-
doExecute
void doExecute(java.util.ArrayList<java.lang.Runnable> tasks)
-
setMode
public void setMode(ServiceController.Mode newMode)
Description copied from interface:ServiceController
Change the service controller's current mode. Might result in the service starting or stopping. The mode may only be changed if it was not already set toServiceController.Mode.REMOVE
. Calling this method with the controller's current mode has no effect and is always allowed.- Specified by:
setMode
in interfaceServiceController<S>
- Parameters:
newMode
- the new controller mode
-
internalSetMode
private boolean internalSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)
-
internalSetMode
private void internalSetMode(ServiceController.Mode newMode, java.util.ArrayList<java.lang.Runnable> taskList)
-
immediateDependencyAvailable
public void immediateDependencyAvailable(ServiceName dependencyName)
Description copied from interface:Dependent
Notify this dependent that one of its immediate dependencies is available, i.e., it is installed and, if notstarted
, should start shortly.This method must not be called under a lock.
- Specified by:
immediateDependencyAvailable
in interfaceDependent
- Parameters:
dependencyName
- the name of the immediate dependency that is now available
-
immediateDependencyUnavailable
public void immediateDependencyUnavailable(ServiceName dependencyName)
Description copied from interface:Dependent
Notify this dependent that one of its immediate dependencies is unavailable.
A dependency is unavailable when it is not installed or when it is inNEVER
mode.This method must not be called under a lock.
- Specified by:
immediateDependencyUnavailable
in interfaceDependent
- Parameters:
dependencyName
- the name of the immediate dependency that is now unavailable
-
propagateTransitiveUnavailability
private void propagateTransitiveUnavailability()
-
propagateTransitiveAvailability
private void propagateTransitiveAvailability()
-
transitiveDependencyAvailable
public void transitiveDependencyAvailable()
Description copied from interface:Dependent
Notify this dependent that allunavailable
transitive dependencies are now available (i.e., they are installed and will perform an attempt to start shortly).This method must not be called under a lock.
- Specified by:
transitiveDependencyAvailable
in interfaceDependent
-
transitiveDependencyUnavailable
public void transitiveDependencyUnavailable()
Description copied from interface:Dependent
Notify this dependent that one of its transitive dependencies is unavailable (either uninstalled, or inNEVER mode
).New transitive dependencies that become unavailable after the notified one do not result in new
dependencyUnavailable
notifications, as the dependent will never receive two or more dependencyUnavailable calls in a row. AdependencyUnavailable
notification is only invoked again to notify of newly found unavailable dependencies if all the previously unavailable dependencies have becomeavailable
.This method must not be called under a lock.
- Specified by:
transitiveDependencyUnavailable
in interfaceDependent
-
getController
public ServiceControllerImpl<?> getController()
Get the controller of this dependent.- Specified by:
getController
in interfaceDependent
- Returns:
- the controller
-
immediateDependencyUp
public void immediateDependencyUp()
Description copied from interface:Dependent
Notify this dependent that one of its immediate dependencies enteredUP
state.This method must not be called under a lock.
- Specified by:
immediateDependencyUp
in interfaceDependent
-
immediateDependencyDown
public void immediateDependencyDown()
Description copied from interface:Dependent
Notify this dependent that one of its immediate dependencies is leaving theUP
state.This method must not be called under a lock.
- Specified by:
immediateDependencyDown
in interfaceDependent
-
dependencyFailed
public void dependencyFailed()
Description copied from interface:Dependent
Notify this dependent that one of its dependencies (immediate or transitive) failed to start. This method is called after the dependency state transitions fromSTARTING
toSTART_FAILED
.Dependency failures that occur after the notified failure do not result in new
dependencyFailed
notifications, as the dependent will never receive two or more dependencyFailed calls in a row. AdependencyFailed
notification is only invoked again to notify of new failures if the previous failures have beencleared
.This method must not be called under a lock.
- Specified by:
dependencyFailed
in interfaceDependent
-
dependencyFailureCleared
public void dependencyFailureCleared()
Description copied from interface:Dependent
Notify this dependent that all dependency failures previouslynotified
are now cleared. This method is called only after all affected dependencies leftSTART_FAILED
state.This method must not be called under a lock.
- Specified by:
dependencyFailureCleared
in interfaceDependent
-
dependentStarted
void dependentStarted()
-
dependentStopped
void dependentStopped()
-
newDependent
void newDependent(ServiceName dependencyName, Dependent dependent)
-
doDemandDependencies
private void doDemandDependencies()
-
doUndemandDependencies
private void doUndemandDependencies()
-
addDemand
void addDemand()
-
addDemands
void addDemands(int demandedByCount)
-
removeDemand
void removeDemand()
-
addChild
void addChild(ServiceControllerImpl<?> child)
-
removeChild
void removeChild(ServiceControllerImpl<?> child)
-
getChildren
IdentityHashSet<ServiceControllerImpl<?>> getChildren()
-
getParent
public ServiceControllerImpl<?> getParent()
Description copied from interface:ServiceController
Get this service's parent service, ornull
if there is none.- Specified by:
getParent
in interfaceServiceController<S>
- Returns:
- the parent service or
null
if this service has no parent
-
getServiceContainer
public ServiceContainerImpl getServiceContainer()
Description copied from interface:ServiceController
Get the service container associated with this controller.- Specified by:
getServiceContainer
in interfaceServiceController<S>
- Returns:
- the container
-
getState
public ServiceController.State getState()
Description copied from interface:ServiceController
Get the current service controller state.- Specified by:
getState
in interfaceServiceController<S>
- Returns:
- the current state
-
getValue
public S getValue() throws java.lang.IllegalStateException
Description copied from interface:ServiceController
Get the service value.
-
awaitValue
public S awaitValue() throws java.lang.IllegalStateException, java.lang.InterruptedException
Description copied from interface:ServiceController
Wait for a service to come up, and then return its value.- Specified by:
awaitValue
in interfaceServiceController<S>
- Returns:
- the service value
- Throws:
java.lang.IllegalStateException
- if the service is not available (i.e. it was removed or failed)java.lang.InterruptedException
- if the wait operation was interrupted
-
awaitValue
public S awaitValue(long time, java.util.concurrent.TimeUnit unit) throws java.lang.IllegalStateException, java.lang.InterruptedException, java.util.concurrent.TimeoutException
Description copied from interface:ServiceController
Wait for a service to come up for a certain amount of time, and then return its value.- Specified by:
awaitValue
in interfaceServiceController<S>
- Parameters:
time
- the amount of time to waitunit
- the unit of time to wait- Returns:
- the service value
- Throws:
java.lang.IllegalStateException
- if the service is not available (i.e. it was removed or failed)java.lang.InterruptedException
- if the wait operation was interruptedjava.util.concurrent.TimeoutException
-
getService
public Service<S> getService() throws java.lang.IllegalStateException
Description copied from interface:ServiceController
Get the service.- Specified by:
getService
in interfaceServiceController<S>
- Returns:
- the service
- Throws:
java.lang.IllegalStateException
- if the service is not available (i.e. it is not up)
-
getName
public ServiceName getName()
Description copied from interface:ServiceController
Get the name of this service, if any.- Specified by:
getName
in interfaceServiceController<S>
- Returns:
- the name, or
null
if none was specified.
-
getAliases
public ServiceName[] getAliases()
Description copied from interface:ServiceController
Get other names this service is known as.- Specified by:
getAliases
in interfaceServiceController<S>
- Returns:
- the aliases
-
addListener
public void addListener(ServiceListener<? super S> listener)
Description copied from interface:ServiceController
Add a service listener. The listener's "listener added" callback will be invoked from the same thread that calls this method. Then, the method corresponding to the current service state is called.- Specified by:
addListener
in interfaceServiceController<S>
- Parameters:
listener
- the service listener
-
removeListener
public void removeListener(ServiceListener<? super S> listener)
Description copied from interface:ServiceController
Remove a service listener.- Specified by:
removeListener
in interfaceServiceController<S>
- Parameters:
listener
- the service listener to remove
-
getStartException
public StartException getStartException()
Description copied from interface:ServiceController
Get the reason why the last start failed.- Specified by:
getStartException
in interfaceServiceController<S>
- Returns:
- the last start exception, or
null
if the last start succeeded or the service has not yet started
-
retry
public void retry()
Description copied from interface:ServiceController
Retry a failed service. Does nothing if the state is notServiceController.State.START_FAILED
.- Specified by:
retry
in interfaceServiceController<S>
-
getImmediateUnavailableDependencies
public java.util.Set<ServiceName> getImmediateUnavailableDependencies()
Description copied from interface:ServiceController
Get the complete list of immediate dependencies that are unavailable.- Specified by:
getImmediateUnavailableDependencies
in interfaceServiceController<S>
- Returns:
- a set containing the names of all unavailable immediate dependencies
-
getMode
public ServiceController.Mode getMode()
Description copied from interface:ServiceController
Get the service controller's current mode.- Specified by:
getMode
in interfaceServiceController<S>
- Returns:
- the controller mode
-
compareAndSetMode
public boolean compareAndSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)
Description copied from interface:ServiceController
Compare the current mode againstexpected
; if it matches, change it tonewMode
. The return value istrue
when the mode was matched and changed.- Specified by:
compareAndSetMode
in interfaceServiceController<S>
- Parameters:
expectedMode
- the expected modenewMode
- the new mode- Returns:
true
if the mode was changed
-
getStatus
ServiceStatus getStatus()
-
dumpServiceDetails
java.lang.String dumpServiceDetails()
-
addMonitor
void addMonitor(StabilityMonitor stabilityMonitor)
-
removeMonitor
void removeMonitor(StabilityMonitor stabilityMonitor)
-
removeMonitorNoCallback
void removeMonitorNoCallback(StabilityMonitor stabilityMonitor)
-
getMonitors
java.util.Set<StabilityMonitor> getMonitors()
-
invokeListener
private void invokeListener(ServiceListener<? super S> listener, ServiceControllerImpl.ListenerNotification notification, ServiceController.Transition transition)
Invokes the listener, performing the notification specified.- Parameters:
listener
- listener to be invokednotification
- specified notificationtransition
- the transition to be notified, only relevant ifnotification
isServiceControllerImpl.ListenerNotification.TRANSITION
-
getSubstate
public ServiceController.Substate getSubstate()
Description copied from interface:ServiceController
Get the current service controller substate.- Specified by:
getSubstate
in interfaceServiceController<S>
- Returns:
- the current substate
-
getPrimaryRegistration
ServiceRegistrationImpl getPrimaryRegistration()
-
getAliasRegistrations
ServiceRegistrationImpl[] getAliasRegistrations()
-
getDependents
private Dependent[][] getDependents()
Returns a compiled array of all dependents of this service instance.- Returns:
- an array of dependents, including children
-
getDependentsByDependencyName
private java.util.Map<ServiceName,Dependent[]> getDependentsByDependencyName()
Returns a compiled map of all dependents of this service mapped by the dependency name. This map can be used when it is necessary to perform notifications to these dependents that require the name of the dependency issuing notification.
The return result does not include children.- Returns:
- an array of dependents, including children
-
addDependentsByName
private void addDependentsByName(ServiceRegistrationImpl registration, java.util.Map<ServiceName,Dependent[]> dependentsByName)
-
doInject
private static <T> void doInject(ValueInjection<T> injection)
-
setTCCL
private static java.lang.ClassLoader setTCCL(java.lang.ClassLoader newTCCL)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeProfileInfo
private void writeProfileInfo(char statusChar, long startNanos, long endNanos)
-
-