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[]aliasRegistrationsThe alias registrations of this service.private intasyncTasksThe number of asynchronous tasks that are currently running.private IdentityHashSet<ServiceControllerImpl<?>>childrenThe children of this service (only valid duringServiceController.State.UP).private ServiceControllerImpl.ChildServiceTargetchildTargetThe service target for adding child services (can benullif none were added).private intdemandedByCountThe number of registrations which place a demand-to-start on this instance.private Dependency[]dependenciesThe dependencies of this service.private booleandependenciesDemandedIndicates whether dependencies have been demanded.private intfailCountCount for failure notification.private static java.lang.StringILLEGAL_CONTROLLER_STATEprivate IdentityHashSet<ServiceName>immediateUnavailableDependenciesThe immediate unavailable dependencies of this service.private ValueInjection<?>[]injectionsThe injections of this service.private longlifecycleTimeThe system nanotime of the moment in which the last lifecycle change was initiated.private IdentityHashSet<ServiceListener<? super S>>listenersThe set of registered service listeners.(package private) static intMAX_DEPENDENCIESprivate ServiceController.ModemodeThe controller mode.private IdentityHashSet<StabilityMonitor>monitorsThe set of registered stability monitors.private static ServiceControllerImpl<?>[]NO_CONTROLLERSprivate static Dependent[]NO_DEPENDENTSprivate static ServiceName[]NO_NAMESprivate static java.lang.String[]NO_STRINGSprivate ValueInjection<?>[]outInjectionsThe out injections of this service.private ServiceControllerImpl<?>parentThe parent of this service.private ServiceRegistrationImplprimaryRegistrationThe primary registration of this service.private intrunningDependentsThe number of dependents that are currently running.private Value<? extends Service<S>>serviceValueThe service itself.private StartExceptionstartExceptionThe start exception.private ServiceController.SubstatestateThe controller state.private intstoppingDependenciesCount for dependencies that are trying to stop.private inttransitiveUnavailableDepCountIndicates if this service has one or more transitive dependencies that are not available.private intunstartedDependenciesThe 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) voidaddAsyncTasks(int size)(package private) voidaddChild(ServiceControllerImpl<?> child)(package private) voidaddDemand()(package private) voidaddDemands(int demandedByCount)private voidaddDependentsByName(ServiceRegistrationImpl registration, java.util.Map<ServiceName,Dependent[]> dependentsByName)voidaddListener(ServiceListener<? super S> listener)Add a service listener.(package private) voidaddMonitor(StabilityMonitor stabilityMonitor)SawaitValue()Wait for a service to come up, and then return its value.SawaitValue(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) voidcommitInstallation(ServiceController.Mode initialMode)Commit the service install, kicking off the mode set and listener execution.booleancompareAndSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)Compare the current mode againstexpected; if it matches, change it tonewMode.voiddependencyFailed()Notify this dependent that one of its dependencies (immediate or transitive) failed to start.voiddependencyFailureCleared()Notify this dependent that all dependency failures previouslynotifiedare now cleared.(package private) voiddependentStarted()(package private) voiddependentStopped()private voiddoDemandDependencies()(package private) voiddoExecute(java.util.ArrayList<java.lang.Runnable> tasks)private static <T> voiddoInject(ValueInjection<T> injection)private voiddoUndemandDependencies()(package private) java.lang.StringdumpServiceDetails()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 voidgetListenerTasks(ServiceController.Transition transition, java.util.ArrayList<java.lang.Runnable> tasks)private voidgetListenerTasks(ServiceControllerImpl.ListenerNotification notification, java.util.ArrayList<java.lang.Runnable> tasks)ServiceController.ModegetMode()Get the service controller's current mode.(package private) java.util.Set<StabilityMonitor>getMonitors()ServiceNamegetName()Get the name of this service, if any.ServiceControllerImpl<?>getParent()Get this service's parent service, ornullif there is none.(package private) ServiceRegistrationImplgetPrimaryRegistration()Service<S>getService()Get the service.ServiceContainerImplgetServiceContainer()Get the service container associated with this controller.StartExceptiongetStartException()Get the reason why the last start failed.ServiceController.StategetState()Get the current service controller state.(package private) ServiceStatusgetStatus()ServiceController.SubstategetSubstate()Get the current service controller substate.(package private) ServiceController.SubstategetSubstateLocked()private ServiceController.TransitiongetTransition()Identify the transition to take.SgetValue()Get the service value.voidimmediateDependencyAvailable(ServiceName dependencyName)Notify this dependent that one of its immediate dependencies is available, i.e., it is installed and, if notstarted, should start shortly.voidimmediateDependencyDown()Notify this dependent that one of its immediate dependencies is leaving theUPstate.voidimmediateDependencyUnavailable(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 inNEVERmode.voidimmediateDependencyUp()Notify this dependent that one of its immediate dependencies enteredUPstate.private voidinternalSetMode(ServiceController.Mode newMode, java.util.ArrayList<java.lang.Runnable> taskList)private booleaninternalSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)private voidinvokeListener(ServiceListener<? super S> listener, ServiceControllerImpl.ListenerNotification notification, ServiceController.Transition transition)Invokes the listener, performing the notification specified.(package private) booleanisInstallationCommitted()Returntrueonly if this service controller installation is committed.(package private) booleanisStableRestState()Returns true if controller is in rest state and no async tasks are running, false otherwise.(package private) voidnewDependent(ServiceName dependencyName, Dependent dependent)private voidpropagateTransitiveAvailability()private voidpropagateTransitiveUnavailability()(package private) voidremoveAsyncTask()(package private) voidremoveChild(ServiceControllerImpl<?> child)(package private) voidremoveDemand()voidremoveListener(ServiceListener<? super S> listener)Remove a service listener.(package private) voidremoveMonitor(StabilityMonitor stabilityMonitor)(package private) voidremoveMonitorNoCallback(StabilityMonitor stabilityMonitor)voidretry()Retry a failed service.(package private) voidrollbackInstallation()Roll back the service install.voidsetMode(ServiceController.Mode newMode)Change the service controller's current mode.private static java.lang.ClassLoadersetTCCL(java.lang.ClassLoader newTCCL)private booleanshouldStart()Determine whether a stopped controller should start.private booleanshouldStop()Determine whether a running controller should stop.(package private) voidstartInstallation()Start this service installation, connecting it to its parent and dependencies.java.lang.StringtoString()(package private) voidtransition(java.util.ArrayList<java.lang.Runnable> tasks)Run the locked portion of a transition.voidtransitiveDependencyAvailable()Notify this dependent that allunavailabletransitive dependencies are now available (i.e., they are installed and will perform an attempt to start shortly).voidtransitiveDependencyUnavailable()Notify this dependent that one of its transitive dependencies is unavailable (either uninstalled, or inNEVER mode).(package private) voidupdateStabilityState(boolean leavingStableRestState)private voidwriteProfileInfo(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.STOPPINGstate) 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 benullif 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()
Returntrueonly 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:
trueif so
-
shouldStop
private boolean shouldStop()
Determine whether a running controller should stop.- Returns:
trueif 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
nullif 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:ServiceControllerChange 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:
setModein 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:DependentNotify 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:
immediateDependencyAvailablein interfaceDependent- Parameters:
dependencyName- the name of the immediate dependency that is now available
-
immediateDependencyUnavailable
public void immediateDependencyUnavailable(ServiceName dependencyName)
Description copied from interface:DependentNotify this dependent that one of its immediate dependencies is unavailable.
A dependency is unavailable when it is not installed or when it is inNEVERmode.This method must not be called under a lock.
- Specified by:
immediateDependencyUnavailablein 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:DependentNotify this dependent that allunavailabletransitive 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:
transitiveDependencyAvailablein interfaceDependent
-
transitiveDependencyUnavailable
public void transitiveDependencyUnavailable()
Description copied from interface:DependentNotify 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
dependencyUnavailablenotifications, as the dependent will never receive two or more dependencyUnavailable calls in a row. AdependencyUnavailablenotification 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:
transitiveDependencyUnavailablein interfaceDependent
-
getController
public ServiceControllerImpl<?> getController()
Get the controller of this dependent.- Specified by:
getControllerin interfaceDependent- Returns:
- the controller
-
immediateDependencyUp
public void immediateDependencyUp()
Description copied from interface:DependentNotify this dependent that one of its immediate dependencies enteredUPstate.This method must not be called under a lock.
- Specified by:
immediateDependencyUpin interfaceDependent
-
immediateDependencyDown
public void immediateDependencyDown()
Description copied from interface:DependentNotify this dependent that one of its immediate dependencies is leaving theUPstate.This method must not be called under a lock.
- Specified by:
immediateDependencyDownin interfaceDependent
-
dependencyFailed
public void dependencyFailed()
Description copied from interface:DependentNotify this dependent that one of its dependencies (immediate or transitive) failed to start. This method is called after the dependency state transitions fromSTARTINGtoSTART_FAILED.Dependency failures that occur after the notified failure do not result in new
dependencyFailednotifications, as the dependent will never receive two or more dependencyFailed calls in a row. AdependencyFailednotification 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:
dependencyFailedin interfaceDependent
-
dependencyFailureCleared
public void dependencyFailureCleared()
Description copied from interface:DependentNotify this dependent that all dependency failures previouslynotifiedare now cleared. This method is called only after all affected dependencies leftSTART_FAILEDstate.This method must not be called under a lock.
- Specified by:
dependencyFailureClearedin 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:ServiceControllerGet this service's parent service, ornullif there is none.- Specified by:
getParentin interfaceServiceController<S>- Returns:
- the parent service or
nullif this service has no parent
-
getServiceContainer
public ServiceContainerImpl getServiceContainer()
Description copied from interface:ServiceControllerGet the service container associated with this controller.- Specified by:
getServiceContainerin interfaceServiceController<S>- Returns:
- the container
-
getState
public ServiceController.State getState()
Description copied from interface:ServiceControllerGet the current service controller state.- Specified by:
getStatein interfaceServiceController<S>- Returns:
- the current state
-
getValue
public S getValue() throws java.lang.IllegalStateException
Description copied from interface:ServiceControllerGet the service value.
-
awaitValue
public S awaitValue() throws java.lang.IllegalStateException, java.lang.InterruptedException
Description copied from interface:ServiceControllerWait for a service to come up, and then return its value.- Specified by:
awaitValuein 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:ServiceControllerWait for a service to come up for a certain amount of time, and then return its value.- Specified by:
awaitValuein 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:ServiceControllerGet the service.- Specified by:
getServicein 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:ServiceControllerGet the name of this service, if any.- Specified by:
getNamein interfaceServiceController<S>- Returns:
- the name, or
nullif none was specified.
-
getAliases
public ServiceName[] getAliases()
Description copied from interface:ServiceControllerGet other names this service is known as.- Specified by:
getAliasesin interfaceServiceController<S>- Returns:
- the aliases
-
addListener
public void addListener(ServiceListener<? super S> listener)
Description copied from interface:ServiceControllerAdd 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:
addListenerin interfaceServiceController<S>- Parameters:
listener- the service listener
-
removeListener
public void removeListener(ServiceListener<? super S> listener)
Description copied from interface:ServiceControllerRemove a service listener.- Specified by:
removeListenerin interfaceServiceController<S>- Parameters:
listener- the service listener to remove
-
getStartException
public StartException getStartException()
Description copied from interface:ServiceControllerGet the reason why the last start failed.- Specified by:
getStartExceptionin interfaceServiceController<S>- Returns:
- the last start exception, or
nullif the last start succeeded or the service has not yet started
-
retry
public void retry()
Description copied from interface:ServiceControllerRetry a failed service. Does nothing if the state is notServiceController.State.START_FAILED.- Specified by:
retryin interfaceServiceController<S>
-
getImmediateUnavailableDependencies
public java.util.Set<ServiceName> getImmediateUnavailableDependencies()
Description copied from interface:ServiceControllerGet the complete list of immediate dependencies that are unavailable.- Specified by:
getImmediateUnavailableDependenciesin interfaceServiceController<S>- Returns:
- a set containing the names of all unavailable immediate dependencies
-
getMode
public ServiceController.Mode getMode()
Description copied from interface:ServiceControllerGet the service controller's current mode.- Specified by:
getModein interfaceServiceController<S>- Returns:
- the controller mode
-
compareAndSetMode
public boolean compareAndSetMode(ServiceController.Mode expectedMode, ServiceController.Mode newMode)
Description copied from interface:ServiceControllerCompare the current mode againstexpected; if it matches, change it tonewMode. The return value istruewhen the mode was matched and changed.- Specified by:
compareAndSetModein interfaceServiceController<S>- Parameters:
expectedMode- the expected modenewMode- the new mode- Returns:
trueif 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 ifnotificationisServiceControllerImpl.ListenerNotification.TRANSITION
-
getSubstate
public ServiceController.Substate getSubstate()
Description copied from interface:ServiceControllerGet the current service controller substate.- Specified by:
getSubstatein 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:
toStringin classjava.lang.Object
-
writeProfileInfo
private void writeProfileInfo(char statusChar, long startNanos, long endNanos)
-
-