Package org.apache.webbeans.config
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,
- Use the final list of properties.
-
-
Field Summary
Fields Modifier and Type Field Description static StringALLOW_PROXYING_PARAMEnvironment property which comma separated list of classes which should NOT fail with UnproxyableResolutionExceptionstatic StringAPPLICATION_IS_JSPApplication is core JSPstatic StringAPPLICATION_SUPPORTS_CONVERSATIONSupports conversationsstatic StringCONTAINER_LIFECYCLEContainer lifecyclestatic StringCONTEXTS_SERVICEContexts Servicestatic StringCONVERSATION_SERVICEConversation Servicestatic StringCONVERSATION_TIMEOUT_INTERVALTimeout interval in msstatic StringEAGER_SESSION_INITIALISATIONBy default we do _not_ force session creation in our WebBeansConfigurationListener.static StringEL_ADAPTOR_SERVICEEL Adaptorstatic StringFAST_MATCHINGIf generics should be taken into account for the matchingstatic StringGENERATOR_JAVA_VERSIONThe Java Version to use for the generated proxy classes.static StringIGNORED_EXTENSIONSA comma-separated list of fully qualified class names of CDI Extensions that should be ignored.static StringIGNORED_INTERFACESa comma-separated list of fully qualified class names that should be ignored when determining if a decorator matches its delegate.static StringINTERCEPTOR_FORCE_NO_CHECKED_EXCEPTIONSLifycycle methods likePostConstructandPreDestroymust not define a checked Exception regarding to the spec.static StringJNDI_SERVICEJNDI Service SPIstatic StringPRODUCER_INTERCEPTION_SUPPORTstatic StringPROXY_MAPPING_PREFIXprefix followed by the fully qualified scope name, for configuring NormalScopedBeanInterceptorHandler for our proxies.static StringRESOURCE_INJECTION_SERVICEResource Injection Servicestatic StringSCAN_EXCLUSION_PATHSA list of known JARs/paths which should not be scanned for beansstatic StringSCAN_EXTENSION_JARSA boolean to enable CDI 1.1 behavior to not scan "extension JARs".static StringSCAN_ONLY_BEANS_XML_JARSFlag which indicates that only jars with an explicit META-INF/beans.xml marker file shall get parsed.static StringSCANNER_SERVICEScanner Servicestatic StringSECURITY_SERVICESecurity Servicestatic StringSTRICT_DYNAMIC_VALIDATIONEnable that calls to various methods get strictly validated.static StringTRANSACTION_SERVICETransaction Servicestatic StringUSE_BDA_BEANSXML_SCANNERDeprecated.as spec section 5 and 12 contradict each other and the BDA per jar handling is broken anywaystatic StringUSE_EJB_DISCOVERYUse EJB Discovery or notstatic StringVALIDATOR_SERVICEValidator Service
-
Constructor Summary
Constructors Constructor Description OpenWebBeansConfiguration()Parse configuration.OpenWebBeansConfiguration(Properties properties)you can configure this externally as well.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfigListValue(String keyName, String value)Add a configuration value to the Set of configured values registered under the keyName.Set<String>getConfigListValues(String keyName)Scan all openwebbeans.properties files + system properties + syste.env for the given key.StringgetGeneratorJavaVersion()Set<String>getIgnoredExtensions()Set<String>getIgnoredInterfaces()StringgetProperty(String key)Gets property.StringgetProperty(String key, String defaultValue)Gets property value.List<String>getProxyReservedPackages()booleangetScanExtensionJars()booleanisJspApplication()Gets jsp property.booleanisSkipNoClassDefFoundErrorTriggers()voidparseConfiguration()(re)read the configuration from the resources in the classpath.booleanscanOnlyBeansXmlJars()Flag 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.List<String>splitValues(String commaSeparatedVals)Take the given commaSeparatedVals and spit them by ',' and trim them.booleanstrictDynamicValidation()Flag which indicates that programmatic invocations to vaious BeanManager methods should get strictly validated.booleansupportsConversation()Gets conversation supports property.booleansupportsInterceptionOnProducers()
-
-
-
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 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:
- 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
-
USE_EJB_DISCOVERY
public static final String USE_EJB_DISCOVERY
Use EJB Discovery or not- See Also:
- Constant Field Values
-
CONTAINER_LIFECYCLE
public static final String CONTAINER_LIFECYCLE
Container lifecycle- See Also:
- Constant Field Values
-
JNDI_SERVICE
public static final String JNDI_SERVICE
JNDI Service SPI- See Also:
- Constant Field Values
-
SCANNER_SERVICE
public static final String SCANNER_SERVICE
Scanner Service- See Also:
- Constant Field Values
-
CONTEXTS_SERVICE
public static final String CONTEXTS_SERVICE
Contexts Service- See Also:
- Constant Field Values
-
CONVERSATION_SERVICE
public static final String CONVERSATION_SERVICE
Conversation Service- See Also:
- Constant Field Values
-
RESOURCE_INJECTION_SERVICE
public static final String RESOURCE_INJECTION_SERVICE
Resource Injection Service- See Also:
- Constant Field Values
-
SECURITY_SERVICE
public static final String SECURITY_SERVICE
Security Service- See Also:
- Constant Field Values
-
VALIDATOR_SERVICE
public static final String VALIDATOR_SERVICE
Validator Service- See Also:
- Constant Field Values
-
TRANSACTION_SERVICE
public static final String TRANSACTION_SERVICE
Transaction Service- See Also:
- Constant Field Values
-
APPLICATION_IS_JSP
public static final String APPLICATION_IS_JSP
Application is core JSP- See Also:
- Constant Field Values
-
APPLICATION_SUPPORTS_CONVERSATION
public static final String APPLICATION_SUPPORTS_CONVERSATION
Supports conversations- See Also:
- Constant Field Values
-
PRODUCER_INTERCEPTION_SUPPORT
public static final String PRODUCER_INTERCEPTION_SUPPORT
- See Also:
- Constant Field Values
-
EL_ADAPTOR_SERVICE
public static final String EL_ADAPTOR_SERVICE
EL Adaptor- 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.javax.enterprise.context.ApplicationScoped=org.apache.webbeans.intercept.ApplicationScopedBeanInterceptorHandler org.apache.webbeans.proxy.mapping.javax.enterprise.context.RequestScoped=org.apache.webbeans.intercept.RequestScopedBeanInterceptorHandler org.apache.webbeans.proxy.mapping.javax.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 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:
- 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 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:
- 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
-
-
Constructor Detail
-
OpenWebBeansConfiguration
public OpenWebBeansConfiguration(Properties properties)
you can configure this externally as well.- Parameters:
properties-
-
OpenWebBeansConfiguration
public OpenWebBeansConfiguration()
Parse configuration.
-
-
Method Detail
-
parseConfiguration
public void parseConfiguration() throws WebBeansConfigurationException(re)read the configuration from the resources in the classpath.
-
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 namevalue- 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 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
-
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.
-
supportsInterceptionOnProducers
public boolean supportsInterceptionOnProducers()
-
getGeneratorJavaVersion
public String getGeneratorJavaVersion()
-
isSkipNoClassDefFoundErrorTriggers
public boolean isSkipNoClassDefFoundErrorTriggers()
-
-