|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.hk2.component.AbstractRunLevelService<T>
public abstract class AbstractRunLevelService<T>
A default implementation for the RunLevelService that component
provides can derive from to provide their own component-related lifecycle.
RunLevel-gated services. It can be anything of the caller's
choosing as long as it is kept unique and does not clash with the
default internal run level service.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jvnet.hk2.component.InhabitantListener |
|---|
InhabitantListener.EventType |
| Constructor Summary | |
|---|---|
protected |
AbstractRunLevelService(Class<?> targetScope)
|
| Method Summary | |
|---|---|
protected DefaultRunLevelService |
getDefault()
|
protected RunLevelService<T> |
getDelegate()
|
RunLevelState<T> |
getState()
Returns the current state of this RunLevelService instance. |
boolean |
inhabitantChanged(InhabitantListener.EventType eventType,
Inhabitant<?> inhabitant)
Called when the inhabitant has changed. |
void |
interrupt()
Causes this RunLevelService to attempt to stop any in-flight proceedTo() operation. |
void |
interrupt(int runLevel)
Same as RunLevelService.interrupt(), with the option to immediately perform
a RunLevelService.proceedTo(int) following the interrupt. |
void |
proceedTo(int runLevel)
Causes this RunLevelService to move to the specified run level for all RunLevel instances (identified by scope), orchestrating the appropriate lifecycle events based on the given implementation strategy. |
void |
setInhabitantActivator(InhabitantActivator activator)
Overrides the default behavior of getting the inhabitant activator from the habitat to use a stand-in activator instead. |
void |
setInhabitantSorter(InhabitantSorter sorter)
Overrides the default behavior of getting the inhabitant sorter from the habitat to use a stand-in sorter instead. |
void |
setListener(RunLevelListener listener)
Overrides the default behavior of getting all listeners from the habitat to use a stand-in listener instead. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractRunLevelService(Class<?> targetScope)
| Method Detail |
|---|
public String toString()
toString in class Objectprotected RunLevelService<T> getDelegate()
protected DefaultRunLevelService getDefault()
public void setListener(RunLevelListener listener)
listener - the alternative, stand-in listenerpublic void setInhabitantSorter(InhabitantSorter sorter)
sorter - the alternative, stand-in sorterpublic void setInhabitantActivator(InhabitantActivator activator)
activator - the alternative, stand-in activatorpublic RunLevelState<T> getState()
RunLevelService
getState in interface RunLevelService<T>public void proceedTo(int runLevel)
RunLevelServiceIf the RunLevel specified is the same as the current RunLevel then the RunLevelService may return immediately.
Note that the underlying implementation may perform this operation asynchronously. Implementors who choose the asynchronous approach are expected to treat a subsequent proceedTo(newRunLevel) call as an implicit cancellation of any currently running proceedTo() that is running on one or more managed threads. Again, see the javadoc for each implementation for details.
proceedTo in interface RunLevelService<T>runLevel - the run level to move to.public void interrupt()
RunLevelServiceSee the javadoc for each implementation for specific details
interrupt in interface RunLevelService<T>public void interrupt(int runLevel)
RunLevelServiceRunLevelService.interrupt(), with the option to immediately perform
a RunLevelService.proceedTo(int) following the interrupt.
interrupt in interface RunLevelService<T>runLevel - the run level to move to following the interrupt
public boolean inhabitantChanged(InhabitantListener.EventType eventType,
Inhabitant<?> inhabitant)
InhabitantListener
inhabitantChanged in interface InhabitantListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||