|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor
public class DependencyWaiterApplicationContextExecutor
Dependency waiter executor that breaks the 'traditional' ConfigurableApplicationContext.refresh()
in two
pieces so that beans are not actually created unless the OSGi service imported are present.
Field Summary | |
---|---|
protected DelegatedExecutionOsgiBundleApplicationContext |
delegateContext
|
protected DependencyServiceManager |
dependencyDetector
OSGi service dependencyDetector used for detecting dependencies |
Constructor Summary | |
---|---|
DependencyWaiterApplicationContextExecutor(DelegatedExecutionOsgiBundleApplicationContext delegateContext,
boolean syncWait,
List<OsgiServiceDependencyFactory> dependencyFactories)
|
Method Summary | |
---|---|
void |
close()
The application context is being shutdown. |
protected DependencyServiceManager |
createDependencyServiceListener(Runnable task)
|
void |
fail(Throwable t)
|
ContextState |
getContextState()
|
OsgiBundleApplicationContextEventMulticaster |
getEventMulticaster()
|
protected void |
init()
Do some sanity checks |
void |
refresh()
Provide a continuation like approach to the application context. |
void |
setDelegatedMulticaster(OsgiBundleApplicationContextEventMulticaster multicaster)
Sets the multicaster for delegating failing events. |
void |
setMonitoringCounter(Counter contextsStarted)
Pass in the context counter. |
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExec)
|
void |
setTimeout(long timeout)
Sets the timeout (in ms) for waiting for service dependencies. |
void |
setWatchdog(Timer watchdog)
|
protected void |
stageOne()
Start the first stage of the application context refresh. |
protected void |
stageTwo()
|
protected void |
startWatchDog()
Schedule the watchdog task. |
protected void |
stopWatchDog()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DependencyServiceManager dependencyDetector
protected final DelegatedExecutionOsgiBundleApplicationContext delegateContext
Constructor Detail |
---|
public DependencyWaiterApplicationContextExecutor(DelegatedExecutionOsgiBundleApplicationContext delegateContext, boolean syncWait, List<OsgiServiceDependencyFactory> dependencyFactories)
Method Detail |
---|
public void refresh() throws org.springframework.beans.BeansException, IllegalStateException
refresh
in interface OsgiBundleApplicationContextExecutor
org.springframework.beans.BeansException
IllegalStateException
protected void init()
protected void stageOne()
synchronousWait
, the current thread can simply end if there are any dependencies (the
default) or wait to either timeout or have all its dependencies met.
protected void stageTwo()
public void close()
close
in interface OsgiBundleApplicationContextExecutor
public void fail(Throwable t)
fail
in interface ContextExecutorAccessor
protected DependencyServiceManager createDependencyServiceListener(Runnable task)
protected void startWatchDog()
protected void stopWatchDog()
public void setTimeout(long timeout)
timeout
- public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExec)
public void setWatchdog(Timer watchdog)
public void setMonitoringCounter(Counter contextsStarted)
asynchCounter
- public void setDelegatedMulticaster(OsgiBundleApplicationContextEventMulticaster multicaster)
multicaster
- public ContextState getContextState()
getContextState
in interface ContextExecutorAccessor
public OsgiBundleApplicationContextEventMulticaster getEventMulticaster()
getEventMulticaster
in interface ContextExecutorAccessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |