Class 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,
    • Use the final list of properties.
    • Field Detail

      • CONVERSATION_TIMEOUT_INTERVAL

        public static final String CONVERSATION_TIMEOUT_INTERVAL
        Timeout interval in ms
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • FAST_MATCHING

        public static final String FAST_MATCHING
        If generics should be taken into account for the matching
        See Also:
        Constant Field Values
      • RESOURCE_INJECTION_SERVICE

        public static final String RESOURCE_INJECTION_SERVICE
        Resource Injection Service
        See Also:
        Constant Field Values
      • APPLICATION_SUPPORTS_CONVERSATION

        public static final String APPLICATION_SUPPORTS_CONVERSATION
        Supports conversations
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • USE_BDA_BEANSXML_SCANNER

        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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
    • Constructor Detail

      • OpenWebBeansConfiguration

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

        public OpenWebBeansConfiguration()
        Parse configuration.
    • Method Detail

      • 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
      • supportsConversation

        public boolean supportsConversation()
        Gets conversation supports property.
        Returns:
        true if supports
      • 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:
        get's called internally to insure the list is initialised
      • supportsInterceptionOnProducers

        public boolean supportsInterceptionOnProducers()
      • getGeneratorJavaVersion

        public String getGeneratorJavaVersion()
      • isSkipNoClassDefFoundErrorTriggers

        public boolean isSkipNoClassDefFoundErrorTriggers()
      • getProxyReservedPackages

        public List<String> getProxyReservedPackages()