Package io.avaje.inject
Interface RequestScope
- All Superinterfaces:
AutoCloseable,Closeable
public interface RequestScope extends Closeable
Provides request scoped beans in addition to beans from the underlying bean scope.
-
Method Summary
Modifier and Type Method Description voidaddClosable(Closeable closeable)Register a closable with the request scope.voidclose()Close the scope firing any@PreDestroymethods.<T> Tget(Class<T> type)Get a dependency.<T> Tget(Class<T> type, String name)Get a named dependency.<T> TgetNullable(Class<T> type)Get an optional dependency potentially returning null.<T> TgetNullable(Class<T> type, String name)Get an optional named dependency potentially returning null.<T> Optional<T>getOptional(Class<T> type)Get an optional dependency.<T> Optional<T>getOptional(Class<T> type, String name)Get an optional named dependency.<T> jakarta.inject.Provider<T>getProvider(Class<T> type)Return Provider of T given the type.<T> jakarta.inject.Provider<T>getProvider(Class<T> type, String name)Return Provider of T given the type and name.<T> List<T>list(Class<T> interfaceType)Get a list of dependencies for the interface type .<T> Set<T>set(Class<T> interfaceType)Get a set of dependencies for the interface type .
-
Method Details
-
get
Get a dependency. -
get
Get a named dependency. -
getOptional
Get an optional dependency. -
getOptional
Get an optional named dependency. -
getNullable
Get an optional dependency potentially returning null. -
getNullable
Get an optional named dependency potentially returning null. -
getProvider
Return Provider of T given the type. -
getProvider
Return Provider of T given the type and name. -
list
Get a list of dependencies for the interface type . -
set
Get a set of dependencies for the interface type . -
addClosable
Register a closable with the request scope.All closeables registered here are closed at the end of the request scope.
-
close
void close()Close the scope firing any@PreDestroymethods.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-