|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
public class AggregateLifeCycle
An AggregateLifeCycle is an LifeCycle implementation for a collection of contained beans.
Beans can be added the AggregateLifeCycle either as managed beans or as unmanaged beans. A managed bean is started, stopped and destroyed with the aggregate.
An unmanaged bean is associated with the aggregate for the purposes of dump(), but it's lifecycle must be managed externally.
When a bean is added, if it is a LifeCycle and it is already started, then it is assumed to be an unmanaged bean.
Otherwise the methods addBean(Object, boolean), manage(Object) and unmanage(Object) can be used to
explicitly control the life cycle relationship.
If adding a bean that is shared between multiple AggregateLifeCycle instances, then it should be started before being added, so it is unmanaged, or
the API must be used to explicitly set it as unmanaged.
| 嵌套类摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口 |
|---|
LifeCycle.Listener |
| 字段摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
AggregateLifeCycle()
|
|
| 方法摘要 | ||
|---|---|---|
boolean |
addBean(Object o)
Add an associated bean. |
|
boolean |
addBean(Object o,
boolean managed)
Add an associated lifecycle. |
|
boolean |
contains(Object bean)
Is the bean contained in the aggregate. |
|
void |
destroy()
Destroy the joined Destroyable beans in the reverse order they were added. |
|
protected void |
doStart()
Start the managed lifecycle beans in the order they were added. |
|
protected void |
doStop()
Stop the joined lifecycle beans in the reverse order they were added. |
|
String |
dump()
|
|
void |
dump(Appendable out)
|
|
void |
dump(Appendable out,
String indent)
|
|
static void |
dump(Appendable out,
String indent,
Collection<?>... collections)
|
|
static String |
dump(Dumpable dumpable)
|
|
static void |
dumpObject(Appendable out,
Object o)
|
|
void |
dumpStdErr()
|
|
protected void |
dumpThis(Appendable out)
|
|
|
getBean(Class<T> clazz)
Get dependent beans of a specific class. |
|
Collection<Object> |
getBeans()
Get dependent beans |
|
|
getBeans(Class<T> clazz)
Get dependent beans of a specific class |
|
boolean |
isManaged(Object bean)
Is the bean joined to the aggregate. |
|
void |
manage(Object bean)
Manage a bean by this aggregate, so that it is started/stopped/destroyed with the aggregate lifecycle. |
|
boolean |
removeBean(Object o)
Remove an associated bean. |
|
void |
removeBeans()
Remove all associated bean. |
|
void |
unmanage(Object bean)
Unmanage a bean by this aggregate, so that it is not started/stopped/destroyed with the aggregate lifecycle. |
|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public AggregateLifeCycle()
| 方法详细信息 |
|---|
protected void doStart()
throws Exception
AbstractLifeCycle 中的 doStartExceptionAbstractLifeCycle.doStart()
protected void doStop()
throws Exception
AbstractLifeCycle 中的 doStopExceptionAbstractLifeCycle.doStart()public void destroy()
Destroyable 中的 destroyDestroyable.destroy()public boolean contains(Object bean)
bean -
public boolean isManaged(Object bean)
bean -
public boolean addBean(Object o)
LifeCycle, then it will be managed if it is not
already started and umanaged if it is already started. The addBean(Object, boolean)
method should be used if this is not correct, or the manage(Object) and unmanage(Object)
methods may be used after an add to change the status.
o - the bean object to add
public boolean addBean(Object o,
boolean managed)
o - The lifecycle to addmanaged - True if the LifeCycle is to be joined, otherwise it will be disjoint.
public void manage(Object bean)
bean - The bean to manage (must already have been added).public void unmanage(Object bean)
bean - The bean to manage (must already have been added).public Collection<Object> getBeans()
public <T> List<T> getBeans(Class<T> clazz)
clazz -
addBean(Object)public <T> T getBean(Class<T> clazz)
clazz -
addBean(Object)public void removeBeans()
public boolean removeBean(Object o)
public void dumpStdErr()
public String dump()
Dumpable 中的 dumppublic static String dump(Dumpable dumpable)
public void dump(Appendable out)
throws IOException
IOException
protected void dumpThis(Appendable out)
throws IOException
IOException
public static void dumpObject(Appendable out,
Object o)
throws IOException
IOException
public void dump(Appendable out,
String indent)
throws IOException
Dumpable 中的 dumpIOException
public static void dump(Appendable out,
String indent,
Collection<?>... collections)
throws IOException
IOException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||