Package org.apache.webbeans.config
Class OpenWebBeansConfiguration
java.lang.Object
org.apache.webbeans.config.OpenWebBeansConfiguration
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEnvironment property which comma separated list of classes which should NOT fail with UnproxyableResolutionExceptionstatic final StringApplication is core JSPstatic final StringContainer lifecyclestatic final StringContexts Servicestatic final StringConversation Servicestatic final StringTimeout interval in msstatic final StringDefault bean discovery mode for empty beans.xml There was a really wicked change in the CDI-4.0 specification which will break many applications.static final StringBy default we do _not_ force session creation in our WebBeansConfigurationListener.static final StringEL Adaptorstatic final StringIf generics should be taken into account for the matchingstatic final StringThe Java Version to use for the generated proxy classes.static final StringA comma-separated list of fully qualified class names of CDI Extensions that should be ignored.static final Stringa comma-separated list of fully qualified class names that should be ignored when determining if a decorator matches its delegate.static final StringLifycycle methods likePostConstructandPreDestroymust not define a checked Exception regarding to the spec.static final StringJNDI Service SPIstatic final Stringstatic final Stringprefix followed by the fully qualified scope name, for configuring NormalScopedBeanInterceptorHandler for our proxies.static final StringResource Injection Servicestatic final StringA list of known JARs/paths which should not be scanned for beansstatic final StringA boolean to enable CDI 1.1 behavior to not scan "extension JARs".static final StringFlag which indicates that only jars with an explicit META-INF/beans.xml marker file shall get parsed.static final StringScanner Servicestatic final StringSecurity Servicestatic final StringEnable that calls to various methods get strictly validated.static final StringTransaction Servicestatic final StringDeprecated.as spec section 5 and 12 contradict each other and the BDA per jar handling is broken anywaystatic final StringUse EJB Discovery or notstatic final StringValidator Service -
Constructor Summary
ConstructorsConstructorDescriptionParse configuration.OpenWebBeansConfiguration(Properties properties) you can configure this externally as well. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigListValue(String keyName, String value) Add a configuration value to the Set of configured values registered under the keyName.getConfigListValues(String keyName) Scan all openwebbeans.properties files + system properties + syste.env for the given key.org.apache.webbeans.spi.BeanArchiveService.BeanDiscoveryModegetProperty(String key) Gets property.getProperty(String key, String defaultValue) Gets property value.booleanbooleanGets jsp property.booleanvoid(re)read the configuration from the resources in the classpath.booleanFlag which indicates that only jars with an explicit META-INF/beans.xml marker file shall get paresed.voidsetProperty(String key, Object value) Sets given property.splitValues(String commaSeparatedVals) Take the given commaSeparatedVals and spit them by ',' and trim them.booleanFlag which indicates that programmatic invocations to vaious BeanManager methods should get strictly validated.boolean
-
Field Details
-
CONVERSATION_TIMEOUT_INTERVAL
Timeout interval in ms- See Also:
-
ALLOW_PROXYING_PARAM
Environment property which comma separated list of classes which should NOT fail with UnproxyableResolutionException- See Also:
-
INTERCEPTOR_FORCE_NO_CHECKED_EXCEPTIONS
Lifycycle methods likePostConstructandPreDestroymust 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
Enable that calls to various methods get strictly validated. Defaults to 'false' for more performance.- See Also:
-
FAST_MATCHING
If generics should be taken into account for the matching- See Also:
-
USE_EJB_DISCOVERY
Use EJB Discovery or not- See Also:
-
CONTAINER_LIFECYCLE
Container lifecycle- See Also:
-
JNDI_SERVICE
JNDI Service SPI- See Also:
-
SCANNER_SERVICE
Scanner Service- See Also:
-
CONTEXTS_SERVICE
Contexts Service- See Also:
-
CONVERSATION_SERVICE
Conversation Service- See Also:
-
RESOURCE_INJECTION_SERVICE
Resource Injection Service- See Also:
-
SECURITY_SERVICE
Security Service- See Also:
-
VALIDATOR_SERVICE
Validator Service- See Also:
-
TRANSACTION_SERVICE
Transaction Service- See Also:
-
APPLICATION_IS_JSP
Application is core JSP- See Also:
-
PRODUCER_INTERCEPTION_SUPPORT
- See Also:
-
EL_ADAPTOR_SERVICE
EL Adaptor- See Also:
-
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.as spec section 5 and 12 contradict each other and the BDA per jar handling is broken anywayUse 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
A list of known JARs/paths which should not be scanned for beans- See Also:
-
SCAN_ONLY_BEANS_XML_JARS
Flag which indicates that only jars with an explicit META-INF/beans.xml marker file shall get parsed. Default isfalse. 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
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
A comma-separated list of fully qualified class names of CDI Extensions that should be ignored.- See Also:
-
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
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
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
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
you can configure this externally as well.- Parameters:
properties-
-
OpenWebBeansConfiguration
public OpenWebBeansConfiguration()Parse configuration.
-
-
Method Details
-
parseConfiguration
(re)read the configuration from the resources in the classpath.- Throws:
WebBeansConfigurationException- See Also:
-
DEFAULT_CONFIG_PROPERTIES_NAMEDEFAULT_CONFIG_PROPERTIES_NAME
-
splitValues
Take the given commaSeparatedVals and spit them by ',' and trim them.- Returns:
- all trimmed values or an empty list
-
getProperty
Gets property.- Parameters:
key-- Returns:
- String with the property value or
null
-
getProperty
Gets property value.- Parameters:
key-defaultValue-- Returns:
- String with the property value or
null
-
setProperty
Sets given property.- Parameters:
key- property namevalue- 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 isfalse -
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 isfalse -
getIgnoredInterfaces
-
getIgnoredExtensions
-
getScanExtensionJars
public boolean getScanExtensionJars() -
getConfigListValues
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
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. -
supportsInterceptionOnProducers
public boolean supportsInterceptionOnProducers() -
getGeneratorJavaVersion
-
isSkipNoClassDefFoundErrorTriggers
public boolean isSkipNoClassDefFoundErrorTriggers() -
getProxyReservedPackages
-
getDefaultBeanDiscoveryMode
public org.apache.webbeans.spi.BeanArchiveService.BeanDiscoveryMode getDefaultBeanDiscoveryMode()- See Also:
-