Class EagerBeansRepository

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 Details

    • EagerBeansRepository

      public EagerBeansRepository()
  • Method Details

    • getInstance

      public static EagerBeansRepository getInstance()
      Awkward workaround for it being unavailable via Inject in listeners in Tomcat+OWB and Jetty.
      Returns:
      Current instance of EagerBeansRepository.
    • setEagerBeans

      protected void setEagerBeans(org.omnifaces.cdi.eager.EagerBeansRepository.EagerBeans eagerBeans)
      Parameters:
      eagerBeans - The collected eager beans.
    • instantiateApplicationScopedAndRegisterListenerIfNecessary

      public static void instantiateApplicationScopedAndRegisterListenerIfNecessary(ServletContext servletContext)
      Instantiate application scoped eager beans and register EagerBeansWebListener if necessary.
      Parameters:
      servletContext - The involved servlet context.
    • hasAnyApplicationScopedBeans

      protected boolean hasAnyApplicationScopedBeans()
      Returns true if there are any application scoped eager beans.
      Returns:
      true if there are any application scoped eager beans.
    • hasAnySessionOrRequestURIBeans

      protected boolean hasAnySessionOrRequestURIBeans()
      Returns true if there are any session scoped eager beans or eager beans by request URI.
      Returns:
      true if there are any session scoped eager beans or eager beans by request URI.
    • hasAnyViewIdBeans

      protected boolean hasAnyViewIdBeans()
      Returns true if there are any eager beans by view ID.
      Returns:
      true if there are any eager beans by view ID.
    • instantiateApplicationScoped

      public boolean instantiateApplicationScoped()
      Instantiate application scoped eager beans.
      Returns:
      true if there were any application scoped eager beans.
    • instantiateSessionScoped

      public boolean instantiateSessionScoped()
      Instantiate session scoped eager beans.
      Returns:
      true if 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:
      true if 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:
      true if there were any eager beans by view URI.