- java.lang.Object
-
- org.omnifaces.cdi.eager.EagerBeansRepository
-
@ApplicationScoped public class EagerBeansRepository extends Object
Bean repository via which various types of eager beans can be instantiated on demand.- Since:
- 1.8
- Author:
- Arjan Tijms
-
-
Constructor Summary
Constructors Constructor Description EagerBeansRepository()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EagerBeansRepositorygetInstance()Awkward workaround for it being unavailable viaInjectin listeners in Tomcat+OWB and Jetty.protected booleanhasAnyApplicationScopedBeans()Returnstrueif there are any application scoped eager beans.protected booleanhasAnySessionOrRequestURIBeans()Returnstrueif there are any session scoped eager beans or eager beans by request URI.protected booleanhasAnyViewIdBeans()Returnstrueif there are any eager beans by view ID.booleaninstantiateApplicationScoped()Instantiate application scoped eager beans.static voidinstantiateApplicationScopedAndRegisterListenerIfNecessary(ServletContext servletContext)Instantiate application scoped eager beans and registerEagerBeansWebListenerif necessary.booleaninstantiateByRequestURI(String relativeRequestURI)Instantiate eager beans by request URI.booleaninstantiateByViewID(String viewId)Instantiate eager beans by view ID.booleaninstantiateSessionScoped()Instantiate session scoped eager beans.protected voidsetEagerBeans(org.omnifaces.cdi.eager.EagerBeansRepository.EagerBeans eagerBeans)Sets the collected eager beans.
-
-
-
Method Detail
-
getInstance
public static EagerBeansRepository getInstance()
Awkward workaround for it being unavailable viaInjectin listeners in Tomcat+OWB and Jetty.- Returns:
- Current instance of
EagerBeansRepository.
-
setEagerBeans
protected void setEagerBeans(org.omnifaces.cdi.eager.EagerBeansRepository.EagerBeans eagerBeans)
Sets the collected eager beans. This is invoked byEagerExtension.load(jakarta.enterprise.inject.spi.AfterDeploymentValidation, BeanManager).- Parameters:
eagerBeans- The collected eager beans.
-
instantiateApplicationScopedAndRegisterListenerIfNecessary
public static void instantiateApplicationScopedAndRegisterListenerIfNecessary(ServletContext servletContext)
Instantiate application scoped eager beans and registerEagerBeansWebListenerif necessary.- Parameters:
servletContext- The involved servlet context.
-
hasAnyApplicationScopedBeans
protected boolean hasAnyApplicationScopedBeans()
Returnstrueif there are any application scoped eager beans.- Returns:
trueif there are any application scoped eager beans.
-
hasAnySessionOrRequestURIBeans
protected boolean hasAnySessionOrRequestURIBeans()
Returnstrueif there are any session scoped eager beans or eager beans by request URI.- Returns:
trueif there are any session scoped eager beans or eager beans by request URI.
-
hasAnyViewIdBeans
protected boolean hasAnyViewIdBeans()
Returnstrueif there are any eager beans by view ID.- Returns:
trueif there are any eager beans by view ID.
-
instantiateApplicationScoped
public boolean instantiateApplicationScoped()
Instantiate application scoped eager beans.- Returns:
trueif there were any application scoped eager beans.
-
instantiateSessionScoped
public boolean instantiateSessionScoped()
Instantiate session scoped eager beans.- Returns:
trueif there were any session scoped eager beans.
-
instantiateByRequestURI
public boolean instantiateByRequestURI(String relativeRequestURI)
Instantiate eager beans by request URI.- Parameters:
relativeRequestURI- The context-relative request URI;- Returns:
trueif there were any eager beans by request URI.
-
instantiateByViewID
public boolean instantiateByViewID(String viewId)
Instantiate eager beans by view ID.- Parameters:
viewId- The view ID;- Returns:
trueif there were any eager beans by view URI.
-
-