Class OpenWebBeansConfiguration

java.lang.Object
org.apache.webbeans.config.OpenWebBeansConfiguration

public class OpenWebBeansConfiguration extends Object
Defines configuration for OpenWebBeans. The algorithm is easy:
  • Load all properties you can find with the name (META-INF/openwebbeans/openwebbeans.properties),
  • Sort the property files via their configuration.ordinal in ascending order,
  • Overload them in a loop,
  • <Overload them via System.getProperties/li>
  • <Overload them via System.getenv/li>
  • Use the final list of properties.
  • Field Details

    • CONVERSATION_TIMEOUT_INTERVAL

      public static final String CONVERSATION_TIMEOUT_INTERVAL
      Timeout interval in ms
      See Also:
    • ALLOW_PROXYING_PARAM

      public static final String ALLOW_PROXYING_PARAM
      Environment property which comma separated list of classes which should NOT fail with UnproxyableResolutionException
      See Also:
    • INTERCEPTOR_FORCE_NO_CHECKED_EXCEPTIONS

      public static final String INTERCEPTOR_FORCE_NO_CHECKED_EXCEPTIONS
      Lifycycle methods like PostConstruct and PreDestroy must not define a checked Exception regarding to the spec. But this is often unnecessary restrictive so we allow to disable this check application wide.
      See Also:
    • STRICT_DYNAMIC_VALIDATION

      public static final String STRICT_DYNAMIC_VALIDATION
      Enable that calls to various methods get strictly validated. Defaults to 'false' for more performance.
      See Also:
    • FAST_MATCHING

      public static final String FAST_MATCHING
      If generics should be taken into account for the matching
      See Also:
    • USE_EJB_DISCOVERY

      public static final String USE_EJB_DISCOVERY
      Use EJB Discovery or not
      See Also:
    • CONTAINER_LIFECYCLE

      public static final String CONTAINER_LIFECYCLE
      Container lifecycle
      See Also:
    • JNDI_SERVICE

      public static final String JNDI_SERVICE
      JNDI Service SPI
      See Also:
    • SCANNER_SERVICE

      public static final String SCANNER_SERVICE
      Scanner Service
      See Also:
    • CONTEXTS_SERVICE

      public static final String CONTEXTS_SERVICE
      Contexts Service
      See Also:
    • CONVERSATION_SERVICE

      public static final String CONVERSATION_SERVICE
      Conversation Service
      See Also:
    • RESOURCE_INJECTION_SERVICE

      public static final String RESOURCE_INJECTION_SERVICE
      Resource Injection Service
      See Also:
    • SECURITY_SERVICE

      public static final String SECURITY_SERVICE
      Security Service
      See Also:
    • VALIDATOR_SERVICE

      public static final String VALIDATOR_SERVICE
      Validator Service
      See Also:
    • TRANSACTION_SERVICE

      public static final String TRANSACTION_SERVICE
      Transaction Service
      See Also:
    • APPLICATION_IS_JSP

      public static final String APPLICATION_IS_JSP
      Application is core JSP
      See Also:
    • PRODUCER_INTERCEPTION_SUPPORT

      public static final String PRODUCER_INTERCEPTION_SUPPORT
      See Also:
    • EL_ADAPTOR_SERVICE

      public static final String EL_ADAPTOR_SERVICE
      EL Adaptor
      See Also:
    • PROXY_MAPPING_PREFIX

      public static final String PROXY_MAPPING_PREFIX
      prefix followed by the fully qualified scope name, for configuring NormalScopedBeanInterceptorHandler for our proxies. The format is like the following: 'org.apache.webbeans.proxy.mapping.' followed by the scope annotation = a subclass of a NormalScopedBeanInterceptorHandler Example:
       org.apache.webbeans.proxy.mapping.jakarta.enterprise.context.ApplicationScoped=org.apache.webbeans.intercept.ApplicationScopedBeanInterceptorHandler
       org.apache.webbeans.proxy.mapping.jakarta.enterprise.context.RequestScoped=org.apache.webbeans.intercept.RequestScopedBeanInterceptorHandler
       org.apache.webbeans.proxy.mapping.jakarta.enterprise.context.SessionScoped=org.apache.webbeans.intercept.SessionScopedBeanInterceptorHandler
       
      See Also:
    • USE_BDA_BEANSXML_SCANNER

      @Deprecated public static final String USE_BDA_BEANSXML_SCANNER
      Deprecated.
      as spec section 5 and 12 contradict each other and the BDA per jar handling is broken anyway
      Use BDABeansXmlScanner to determine if interceptors, decorators, and alternatives are enabled in the beans.xml of a given BDA. For an application containing jar1 and jar2, this implies that an interceptor enabled in the beans.xml of jar1 is not automatically enabled in jar2
      See Also:
    • SCAN_EXCLUSION_PATHS

      public static final String SCAN_EXCLUSION_PATHS
      A list of known JARs/paths which should not be scanned for beans
      See Also:
    • SCAN_ONLY_BEANS_XML_JARS

      public static final String SCAN_ONLY_BEANS_XML_JARS
      Flag which indicates that only jars with an explicit META-INF/beans.xml marker file shall get parsed. Default is false. This might be switched on to improve boot time in cases where you always have beans.xml in your jars or classpath entries.
      See Also:
    • IGNORED_INTERFACES

      public static final String IGNORED_INTERFACES
      a comma-separated list of fully qualified class names that should be ignored when determining if a decorator matches its delegate. These are typically added by weaving or bytecode modification.
      See Also:
    • IGNORED_EXTENSIONS

      public static final String IGNORED_EXTENSIONS
      A comma-separated list of fully qualified class names of CDI Extensions that should be ignored.
      See Also:
    • SCAN_EXTENSION_JARS

      public static final String SCAN_EXTENSION_JARS
      A boolean to enable CDI 1.1 behavior to not scan "extension JARs". "extensions JARs" are JARs, without a beans.xml but with CDI extensions. IMPORTANT: this can break CDI 1.0 extensions.
      See Also:
    • EAGER_SESSION_INITIALISATION

      public static final String EAGER_SESSION_INITIALISATION
      By default we do _not_ force session creation in our WebBeansConfigurationListener. We only create the Session if we really need the SessionContext. E.g. when we create a Contextual Instance in it. Sometimes this creates a problem as the HttpSession can only be created BEFORE anything got written back to the client. With this configuration you can choose between 3 settings
      • "true" the Session will always eagerly be created at the begin of a request
      • "false" the Session will never eagerly be created but only lazily when the first @SessionScoped bean gets used
      • any other value will be interpreted as Java regular expression for request URIs which need eager Session initialization
      See Also:
    • GENERATOR_JAVA_VERSION

      public static final String GENERATOR_JAVA_VERSION
      The Java Version to use for the generated proxy classes. If "auto" then we will pick the version of the current JVM. The default is set to "1.6" as some tools in jetty/tomcat/etc still cannot properly handle Java8 (mostly due to older Eclipse JDT versions).
      See Also:
    • DEFAULT_BEAN_DISCOVERY_MODE

      public static final String DEFAULT_BEAN_DISCOVERY_MODE
      Default bean discovery mode for empty beans.xml There was a really wicked change in the CDI-4.0 specification which will break many applications. They switched the bean-discovery-mode of an empty beans.xml file (or a beans.xml without any version) from ALL to ANNOTATED (Despite warnings that his is totally backward incompatible and could easily have been avoided). The default in OWB is still ALL, but it can be configured to any other bean-discovery-mode with this config switch
      See Also:
  • Constructor Details

    • OpenWebBeansConfiguration

      public OpenWebBeansConfiguration(Properties properties)
      you can configure this externally as well.
      Parameters:
      properties -
    • OpenWebBeansConfiguration

      public OpenWebBeansConfiguration()
      Parse configuration.
  • Method Details

    • parseConfiguration

      public void parseConfiguration() throws WebBeansConfigurationException
      (re)read the configuration from the resources in the classpath.
      Throws:
      WebBeansConfigurationException
      See Also:
      • DEFAULT_CONFIG_PROPERTIES_NAME
      • DEFAULT_CONFIG_PROPERTIES_NAME
    • splitValues

      public List<String> splitValues(String commaSeparatedVals)
      Take the given commaSeparatedVals and spit them by ',' and trim them.
      Returns:
      all trimmed values or an empty list
    • getProperty

      public String getProperty(String key)
      Gets property.
      Parameters:
      key -
      Returns:
      String with the property value or null
    • getProperty

      public String getProperty(String key, String defaultValue)
      Gets property value.
      Parameters:
      key -
      defaultValue -
      Returns:
      String with the property value or null
    • setProperty

      public void setProperty(String key, Object value)
      Sets given property.
      Parameters:
      key - property name
      value - property value
    • isJspApplication

      public boolean isJspApplication()
      Gets jsp property.
      Returns:
      true if jsp
    • scanOnlyBeansXmlJars

      public boolean scanOnlyBeansXmlJars()
      Flag which indicates that only jars with an explicit META-INF/beans.xml marker file shall get paresed. Default is false
    • strictDynamicValidation

      public boolean strictDynamicValidation()
      Flag which indicates that programmatic invocations to vaious BeanManager methods should get strictly validated. E.g. whether qualifier parameters are really qualifiers, etc. Default is false
    • getIgnoredInterfaces

      public Set<String> getIgnoredInterfaces()
    • getIgnoredExtensions

      public Set<String> getIgnoredExtensions()
    • getScanExtensionJars

      public boolean getScanExtensionJars()
    • getConfigListValues

      public Set<String> getConfigListValues(String keyName)
      Scan all openwebbeans.properties files + system properties + syste.env for the given key. If the key is comma separated then use the separate tokens. All the values get put into a big set.
    • addConfigListValue

      public void addConfigListValue(String keyName, String value)
      Add a configuration value to the Set of configured values registered under the keyName. Calling this method ensures that all the configured values are first read from the environment and configuration properties.
      See Also:
    • supportsInterceptionOnProducers

      public boolean supportsInterceptionOnProducers()
    • getGeneratorJavaVersion

      public String getGeneratorJavaVersion()
    • isSkipNoClassDefFoundErrorTriggers

      public boolean isSkipNoClassDefFoundErrorTriggers()
    • getProxyReservedPackages

      public List<String> getProxyReservedPackages()
    • getDefaultBeanDiscoveryMode

      public org.apache.webbeans.spi.BeanArchiveService.BeanDiscoveryMode getDefaultBeanDiscoveryMode()
      See Also: