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()
LifecycleAware
Starts 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 LifecycleAware
public void stop()
LifecycleAware
Stops 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 LifecycleAware
public 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()
LifecycleAware
Return the current state of the service or component.
getLifecycleState
in interface LifecycleAware
public boolean isComponentInErrorState(LifecycleAware component)
Copyright © 2009–2019 Apache Software Foundation. All rights reserved.