@Singleton @Requires(notEnv={"function","android"}) public class RefreshScope extends java.lang.Object implements CustomScope<Refreshable>, LifeCycle<RefreshScope>, ApplicationEventListener<RefreshEvent>, Ordered
Refreshable.Refreshable, 
RefreshEvent| Modifier and Type | Field and Description | 
|---|---|
static int | 
POSITION  | 
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description | 
|---|
RefreshScope(BeanContext beanContext)  | 
RefreshScope(BeanContext beanContext,
            java.util.concurrent.Executor executorService)
Deprecated.  
 | 
| Modifier and Type | Method and Description | 
|---|---|
java.lang.Class<Refreshable> | 
annotationType()  | 
<T> java.util.Optional<BeanRegistration<T>> | 
findBeanRegistration(T bean)
Get the  
BeanDefinition for the given bean. | 
protected java.util.concurrent.locks.ReadWriteLock | 
getLock(java.lang.Object object)  | 
<T> T | 
getOrCreate(BeanCreationContext<T> creationContext)
Resolve an object from the given scope. 
 | 
int | 
getOrder()  | 
boolean | 
isRunning()  | 
void | 
onApplicationEvent(RefreshEvent event)
Handle an application event. 
 | 
void | 
onRefreshEvent(RefreshEvent event)
Handle a  
RefreshEvent synchronously. | 
<T> java.util.Optional<T> | 
remove(BeanIdentifier identifier)
Remove a bean definition from the scope. 
 | 
RefreshScope | 
stop()
Stops the life cycle component. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsupportspublic static final int POSITION
@Deprecated public RefreshScope(BeanContext beanContext, @Named(value="io") java.util.concurrent.Executor executorService)
beanContext - The bean context to allow DI of beans annotated with @InjectexecutorService - The executor service@Inject public RefreshScope(BeanContext beanContext)
beanContext - The bean context to allow DI of beans annotated with @Injectpublic boolean isRunning()
isRunning in interface LifeCycle<RefreshScope>public java.lang.Class<Refreshable> annotationType()
annotationType in interface CustomScope<Refreshable>public <T> T getOrCreate(BeanCreationContext<T> creationContext)
CustomScopegetOrCreate in interface CustomScope<Refreshable>T - The bean generic typecreationContext - The creation contextpublic RefreshScope stop()
LifeCyclestop in interface LifeCycle<RefreshScope>public <T> java.util.Optional<T> remove(BeanIdentifier identifier)
CustomScoperemove in interface CustomScope<Refreshable>T - The generic typeidentifier - The BeanIdentifierOptional of the instance that was destroyed if it existspublic void onApplicationEvent(RefreshEvent event)
ApplicationEventListeneronApplicationEvent in interface ApplicationEventListener<RefreshEvent>event - the event to respond topublic final void onRefreshEvent(RefreshEvent event)
RefreshEvent synchronously. This method blocks unlike onApplicationEvent(RefreshEvent).event - The eventpublic int getOrder()
public <T> java.util.Optional<BeanRegistration<T>> findBeanRegistration(T bean)
CustomScopeBeanDefinition for the given bean.findBeanRegistration in interface CustomScope<Refreshable>T - The bean generic typebean - The beanprotected java.util.concurrent.locks.ReadWriteLock getLock(java.lang.Object object)
object - The bean