@Singleton @Requires(notEnv={"function","android"}) public class RefreshScope extends java.lang.Object implements io.micronaut.context.scope.CustomScope<Refreshable>, io.micronaut.context.LifeCycle<RefreshScope>, io.micronaut.context.event.ApplicationEventListener<RefreshEvent>, io.micronaut.core.order.Ordered
Refreshable
.Refreshable
,
RefreshEvent
Modifier and Type | Field and Description |
---|---|
static int |
POSITION |
Constructor and Description |
---|
RefreshScope(io.micronaut.context.BeanContext beanContext) |
RefreshScope(io.micronaut.context.BeanContext beanContext,
java.util.concurrent.Executor executorService)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<Refreshable> |
annotationType() |
<T> java.util.Optional<io.micronaut.context.BeanRegistration<T>> |
findBeanRegistration(T bean) |
protected java.util.concurrent.locks.ReadWriteLock |
getLock(java.lang.Object object) |
<T> T |
getOrCreate(io.micronaut.context.scope.BeanCreationContext<T> creationContext) |
int |
getOrder() |
boolean |
isRunning() |
void |
onApplicationEvent(RefreshEvent event) |
void |
onRefreshEvent(RefreshEvent event)
Handle a
RefreshEvent synchronously. |
<T> java.util.Optional<T> |
remove(io.micronaut.inject.BeanIdentifier identifier) |
RefreshScope |
stop() |
public static final int POSITION
@Deprecated public RefreshScope(io.micronaut.context.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(io.micronaut.context.BeanContext beanContext)
beanContext
- The bean context to allow DI of beans annotated with @Injectpublic boolean isRunning()
isRunning
in interface io.micronaut.context.LifeCycle<RefreshScope>
public java.lang.Class<Refreshable> annotationType()
annotationType
in interface io.micronaut.context.scope.CustomScope<Refreshable>
public <T> T getOrCreate(io.micronaut.context.scope.BeanCreationContext<T> creationContext)
getOrCreate
in interface io.micronaut.context.scope.CustomScope<Refreshable>
public RefreshScope stop()
stop
in interface io.micronaut.context.LifeCycle<RefreshScope>
public <T> java.util.Optional<T> remove(io.micronaut.inject.BeanIdentifier identifier)
remove
in interface io.micronaut.context.scope.CustomScope<Refreshable>
public void onApplicationEvent(RefreshEvent event)
onApplicationEvent
in interface io.micronaut.context.event.ApplicationEventListener<RefreshEvent>
public final void onRefreshEvent(RefreshEvent event)
RefreshEvent
synchronously. This method blocks unlike onApplicationEvent(RefreshEvent)
.event
- The eventpublic int getOrder()
getOrder
in interface io.micronaut.core.order.Ordered
public <T> java.util.Optional<io.micronaut.context.BeanRegistration<T>> findBeanRegistration(T bean)
findBeanRegistration
in interface io.micronaut.context.scope.CustomScope<Refreshable>
protected java.util.concurrent.locks.ReadWriteLock getLock(java.lang.Object object)
object
- The bean