public class LifecycleSupervisor extends Object implements LifecycleAware
| Modifier and Type | Class and Description |
|---|---|
static class |
LifecycleSupervisor.MonitorRunnable |
static class |
LifecycleSupervisor.Status |
static class |
LifecycleSupervisor.SupervisorPolicy |
| Constructor and Description |
|---|
LifecycleSupervisor() |
| Modifier and Type | Method and Description |
|---|---|
void |
fail() |
LifecycleState |
getLifecycleState()
Return the current state of the service or component.
|
boolean |
isComponentInErrorState(LifecycleAware component) |
void |
setDesiredState(LifecycleAware lifecycleAware,
LifecycleState desiredState) |
void |
start()
Starts a service or component.
|
void |
stop()
Stops a service or component.
|
void |
supervise(LifecycleAware lifecycleAware,
LifecycleSupervisor.SupervisorPolicy policy,
LifecycleState desiredState) |
void |
unsupervise(LifecycleAware lifecycleAware) |
public void start()
LifecycleAwareStarts a service or component.
Implementations should determine the result of any start logic and effect
the return value of LifecycleAware.getLifecycleState() accordingly.
start in interface LifecycleAwarepublic void stop()
LifecycleAwareStops a service or component.
Implementations should determine the result of any stop logic and effect
the return value of LifecycleAware.getLifecycleState() accordingly.
stop in interface LifecycleAwarepublic void fail()
public void supervise(LifecycleAware lifecycleAware, LifecycleSupervisor.SupervisorPolicy policy, LifecycleState desiredState)
public void unsupervise(LifecycleAware lifecycleAware)
public void setDesiredState(LifecycleAware lifecycleAware, LifecycleState desiredState)
public LifecycleState getLifecycleState()
LifecycleAwareReturn the current state of the service or component.
getLifecycleState in interface LifecycleAwarepublic boolean isComponentInErrorState(LifecycleAware component)
Copyright © 2009-2022 Apache Software Foundation. All Rights Reserved.