java.lang.Object
org.omnifaces.cdi.eager.EagerBeansRepository
Bean repository via which various types of eager beans can be instantiated on demand.
- Since:
- 1.8
- Author:
- Arjan Tijms
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EagerBeansRepositoryAwkward workaround for it being unavailable viaInjectin listeners in Tomcat+OWB and Jetty.protected booleanReturnstrueif there are any application scoped eager beans.protected booleanReturnstrueif there are any session scoped eager beans or eager beans by request URI.protected booleanReturnstrueif there are any eager beans by view ID.booleanInstantiate application scoped eager beans.static voidInstantiate 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.booleanInstantiate session scoped eager beans.protected voidsetEagerBeans(org.omnifaces.cdi.eager.EagerBeansRepository.EagerBeans eagerBeans) Sets the collected eager beans.
-
Constructor Details
-
EagerBeansRepository
public EagerBeansRepository()
-
-
Method Details
-
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
Instantiate eager beans by request URI.- Parameters:
relativeRequestURI- The context-relative request URI;- Returns:
trueif there were any eager beans by request URI.
-
instantiateByViewID
Instantiate eager beans by view ID.- Parameters:
viewId- The view ID;- Returns:
trueif there were any eager beans by view URI.
-