You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2010/03/07 01:47:38 UTC
svn commit: r919897 - in /openwebbeans/trunk:
webbeans-ee-common/src/main/resources/META-INF/openwebbeans/
webbeans-ee/src/main/resources/META-INF/openwebbeans/
webbeans-impl/src/main/java/org/apache/webbeans/config/
webbeans-impl/src/main/resources/ME...
Author: gerdogdu
Date: Sun Mar 7 00:47:37 2010
New Revision: 919897
URL: http://svn.apache.org/viewvc?rev=919897&view=rev
Log:
[OWB-320] Remove Java EE Dependencies from WebBeans Core
Added:
openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-common.properties (with props)
openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-full.properties (with props)
openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans-jms.properties (with props)
openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/
openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/openwebbeans-jsf.properties (with props)
openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/
openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/
openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-web.properties (with props)
Removed:
openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java
Added: openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-common.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-common.properties?rev=919897&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-common.properties (added)
+++ openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-common.properties Sun Mar 7 00:47:37 2010
@@ -0,0 +1,32 @@
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements. See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership. The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied. See the License for the
+#specific language governing permissions and limitations
+#under the License.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+#
+#---------------------------------------------------------------
+
+################################################################################################
+################################### DEFAULT SPI CONFIGURATION SECTION ##########################
+################################################################################################
+
+################################### Default JNDI Service #######################################
+#Default implementation of org.apache.webbeans.spi.JNDIService.
+org.apache.webbeans.spi.JNDIService=org.apache.webbeans.ee.common.JNDIServiceEnterpriseImpl
+################################################################################################
Propchange: openwebbeans/trunk/webbeans-ee-common/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-common.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-full.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-full.properties?rev=919897&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-full.properties (added)
+++ openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-full.properties Sun Mar 7 00:47:37 2010
@@ -0,0 +1,42 @@
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements. See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership. The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied. See the License for the
+#specific language governing permissions and limitations
+#under the License.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+#
+#---------------------------------------------------------------
+
+################################################################################################
+################################### DEFAULT SPI CONFIGURATION SECTION ##########################
+################################################################################################
+
+################################### Default Security Service ###################################
+#Default implementation of org.apache.webbeans.spi.SecurityService.
+org.apache.webbeans.spi.SecurityService=org.apache.webbeans.ee.services.EnterpriseSecurityService
+################################################################################################
+
+################################### Default Validator Service ##################################
+#Default implementation of org.apache.webbeans.spi.ValidatorService.
+org.apache.webbeans.spi.ValidatorService=org.apache.webbeans.ee.services.EnterpriseValidatorService
+################################################################################################
+
+################################### Default Transaction Service ################################
+#Default implementation of org.apache.webbeans.spi.TransactionService.
+org.apache.webbeans.spi.TransactionService=org.apache.webbeans.ee.services.EnterpriseTransactionService
+################################################################################################
\ No newline at end of file
Propchange: openwebbeans/trunk/webbeans-ee/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-full.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java?rev=919897&r1=919896&r2=919897&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/OpenWebBeansConfiguration.java Sun Mar 7 00:47:37 2010
@@ -40,8 +40,13 @@
/**Logger instance*/
private static final WebBeansLogger logger = WebBeansLogger.getLogger(OpenWebBeansConfiguration.class);
- /**Default configuration file*/
- private final static String DEFALULT_CONFIG_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-default.properties";
+ /**Default configuration files*/
+ private final static String DEFAULT_CONFIG_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-default.properties";
+ private final static String CONFIG_EE_COMMON_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-ee-common.properties";
+ private final static String CONFIG_EE_FULL_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-ee-full.properties";
+ private final static String CONFIG_EE_WEB_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-ee-web.properties";
+ private final static String CONFIG_JMS_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-jms.properties";
+ private final static String CONFIG_JSF_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans-jsf.properties";
/**Application specified file*/
private final static String CONFIG_PROPERTIES_NAME = "META-INF/openwebbeans/openwebbeans.properties";
@@ -183,15 +188,23 @@
Properties newConfigProperties = new Properties();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- InputStream is = loader.getResourceAsStream(DEFALULT_CONFIG_PROPERTIES_NAME);
- try
- {
- newConfigProperties.load(is);
- }
- catch (IOException ioEx)
- {
- throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.EDCONF_FAIL), ioEx);
- }
+ InputStream is = loader.getResourceAsStream(DEFAULT_CONFIG_PROPERTIES_NAME);
+ load(is, newConfigProperties);
+
+ is = loader.getResourceAsStream(CONFIG_JMS_PROPERTIES_NAME);
+ load(is, newConfigProperties);
+
+ is = loader.getResourceAsStream(CONFIG_JSF_PROPERTIES_NAME);
+ load(is, newConfigProperties);
+
+ is = loader.getResourceAsStream(CONFIG_EE_COMMON_PROPERTIES_NAME);
+ load(is, newConfigProperties);
+
+ is = loader.getResourceAsStream(CONFIG_EE_WEB_PROPERTIES_NAME);
+ load(is, newConfigProperties);
+
+ is = loader.getResourceAsStream(CONFIG_EE_FULL_PROPERTIES_NAME);
+ load(is, newConfigProperties);
// and now overload those settings with the ones from the more specialized version (if available)
@@ -207,19 +220,39 @@
+ logger.getTokenString(OWBLogConst.TEXT_OVERRIDING));
is = loader.getResourceAsStream(CONFIG_PROPERTIES_NAME);
- try
+ load(is, newConfigProperties);
+ }
+
+ // set the new one as perfect fit.
+ configProperties = newConfigProperties;
+ }
+
+ private void load(InputStream is, Properties newConfigProperties)
+ {
+ try
+ {
+ if(is != null)
{
- newConfigProperties.load(is);
+ newConfigProperties.load(is);
}
- catch (IOException ioEx)
+ }
+ catch (IOException ioEx)
+ {
+ throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.EDCONF_FAIL), ioEx);
+ }
+ finally
+ {
+ if(is != null)
{
- throw new WebBeansConfigurationException(logger.getTokenString(OWBLogConst.ESCONF_FAIL), ioEx);
+ try
+ {
+ is.close();
+ }catch(Exception e)
+ {
+
+ }
}
-
}
-
- // set the new one as perfect fit.
- configProperties = newConfigProperties;
}
/**
Modified: openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties?rev=919897&r1=919896&r2=919897&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/resources/META-INF/openwebbeans/openwebbeans-default.properties Sun Mar 7 00:47:37 2010
@@ -46,11 +46,6 @@
org.apache.webbeans.spi.ContextsService=org.apache.webbeans.spi.se.DefaultContextsService
################################################################################################
-################################### Default Resource Injection Service #########################
-#Default implementation of org.apache.webbeans.spi.ResourceInjectionService
-org.apache.webbeans.spi.ResourceInjectionService=org.apache.webbeans.resource.spi.se.StandaloneResourceInjectionService
-################################################################################################
-
################################################################################################
#################################### SEVERAL CONFIGURATION PARAMETERS ##########################
################################################################################################
@@ -70,24 +65,4 @@
#If false, uses spec. defined injection with @Inject. Not recommended use as true.
#It will be removed in future development.
org.apache.webbeans.fieldInjection.useOwbSpecificInjection=false
-################################################################################################
-
-################################## Application Development is JSP ##############################
-#Used to register WebBeansELResolver with JSP EL
-org.apache.webbeans.application.jsp=false
-################################################################################################
-
-################################# Application Development JSF Version is 2.0 ###################
-#Add extra extensions for JSF2, for example adding ViewScope
-org.apache.webbeans.application.useJSF2Extensions=false
-################################################################################################
-
-#################################### Conversation Context Removal Thread Delay##################
-#Converation contexts are removed when idle timeout > timeout. Default timeout is 3 mins.
-org.apache.webbeans.conversation.Conversation.periodicDelay=150000
-################################################################################################
-
-################################### Default Conversation Service ###############################
-#Default implementation of org.apache.webbeans.spi.ConversationService.
-org.apache.webbeans.spi.ConversationService=org.apache.webbeans.spi.conversation.jsf.DefaultConversationService
################################################################################################
\ No newline at end of file
Added: openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans-jms.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans-jms.properties?rev=919897&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans-jms.properties (added)
+++ openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans-jms.properties Sun Mar 7 00:47:37 2010
@@ -0,0 +1,28 @@
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements. See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership. The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied. See the License for the
+#specific language governing permissions and limitations
+#under the License.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+#
+#---------------------------------------------------------------
+
+#################################### JMS ConnectionFactory JNDI Name ###########################
+# JMS ConnectionFactory instance global jndi name.
+org.apache.webbeans.spi.JNDIService.jmsConnectionFactoryJndi=ConnectionFactory
+################################################################################################
\ No newline at end of file
Propchange: openwebbeans/trunk/webbeans-jms/src/main/resources/META-INF/openwebbeans/openwebbeans-jms.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/openwebbeans-jsf.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/openwebbeans-jsf.properties?rev=919897&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/openwebbeans-jsf.properties (added)
+++ openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/openwebbeans-jsf.properties Sun Mar 7 00:47:37 2010
@@ -0,0 +1,33 @@
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements. See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership. The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied. See the License for the
+#specific language governing permissions and limitations
+#under the License.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+#
+#---------------------------------------------------------------
+
+#################################### Conversation Context Removal Thread Delay##################
+#Converation contexts are removed when idle timeout > timeout. Default timeout is 3 mins.
+org.apache.webbeans.conversation.Conversation.periodicDelay=150000
+################################################################################################
+
+################################### Default Conversation Service ###############################
+#Default implementation of org.apache.webbeans.spi.ConversationService.
+org.apache.webbeans.spi.ConversationService=org.apache.webbeans.spi.conversation.jsf.DefaultConversationService
+################################################################################################
\ No newline at end of file
Propchange: openwebbeans/trunk/webbeans-jsf/src/main/resources/META-INF/openwebbeans/openwebbeans-jsf.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java?rev=919897&r1=919896&r2=919897&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java (original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java Sun Mar 7 00:47:37 2010
@@ -26,14 +26,10 @@
import javax.servlet.http.HttpSessionListener;
import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.config.OpenWebBeansConfiguration;
import org.apache.webbeans.conversation.ConversationManager;
import org.apache.webbeans.lifecycle.LifecycleFactory;
import org.apache.webbeans.logger.WebBeansLogger;
import org.apache.webbeans.spi.ContainerLifecycle;
-import org.apache.webbeans.web.context.WebContextsService;
-import org.apache.webbeans.web.lifecycle.WebContainerLifecycle;
-import org.apache.webbeans.web.scanner.WebScannerService;
/**
* Initializing the beans container for using in an web application
@@ -62,17 +58,6 @@
*/
public void contextInitialized(ServletContextEvent event)
{
- //Push parse configuration
- OpenWebBeansConfiguration configuration = OpenWebBeansConfiguration.getInstance();
-
- //Set our parameters for Web Plugin
- //Container Lifecycle
- configuration.setProperty(OpenWebBeansConfiguration.CONTAINER_LIFECYCLE, WebContainerLifecycle.class.getName());
- //Scanner Service
- configuration.setProperty(OpenWebBeansConfiguration.SCANNER_SERVICE, WebScannerService.class.getName());
- //Contexts Service
- configuration.setProperty(OpenWebBeansConfiguration.CONTEXTS_SERVICE, WebContextsService.class.getName());
-
this.lifeCycle = LifecycleFactory.getInstance().getLifecycle();
try
Added: openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-web.properties
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-web.properties?rev=919897&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-web.properties (added)
+++ openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-web.properties Sun Mar 7 00:47:37 2010
@@ -0,0 +1,61 @@
+#Licensed to the Apache Software Foundation (ASF) under one
+#or more contributor license agreements. See the NOTICE file
+#distributed with this work for additional information
+#regarding copyright ownership. The ASF licenses this file
+#to you under the Apache License, Version 2.0 (the
+#"License"); you may not use this file except in compliance
+#with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+#Unless required by applicable law or agreed to in writing,
+#software distributed under the License is distributed on an
+#"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#KIND, either express or implied. See the License for the
+#specific language governing permissions and limitations
+#under the License.
+#---------------------------------------------------------------
+# The default configuration for OpenWebBeans
+#
+# The default configuration is intended for a JDK and a simple ServletContainer
+# like jetty, resin or tomcat.
+#
+#---------------------------------------------------------------
+
+################################################################################################
+################################### WEB SPI CONFIGURATION SECTION ##########################
+################################################################################################
+
+################################### WEB Container Lifecycle ################################
+#Default implementation of org.apache.webbeans.spi.ContainerLifecycle.
+org.apache.webbeans.spi.ContainerLifecycle=org.apache.webbeans.web.lifecycle.WebContainerLifecycle
+################################################################################################
+
+################################### WEB Scanner Service ####################################
+#Default implementation of org.apache.webbeans.spi.ScannerService.
+org.apache.webbeans.spi.ScannerService=org.apache.webbeans.web.scanner.WebScannerService
+################################################################################################
+
+################################### WEB Contexts Service ####################################
+#Default implementation of org.apache.webbeans.spi.ContextsService.
+org.apache.webbeans.spi.ContextsService=org.apache.webbeans.web.context.WebContextsService
+################################################################################################
+
+################################### Default Resource Injection Service #########################
+#Default implementation of org.apache.webbeans.spi.ResourceInjectionService
+org.apache.webbeans.spi.ResourceInjectionService=org.apache.webbeans.resource.spi.se.StandaloneResourceInjectionService
+################################################################################################
+
+################################################################################################
+#################################### SEVERAL WEB CONFIGURATION PARAMETERS ######################
+################################################################################################
+
+################################## Application Development is JSP ##############################
+#Used to register WebBeansELResolver with JSP EL
+org.apache.webbeans.application.jsp=false
+################################################################################################
+
+################################# Application Development JSF Version is 2.0 ###################
+#Add extra extensions for JSF2, for example adding ViewScope
+org.apache.webbeans.application.useJSF2Extensions=false
+################################################################################################
\ No newline at end of file
Propchange: openwebbeans/trunk/webbeans-web/src/main/resources/META-INF/openwebbeans/openwebbeans-ee-web.properties
------------------------------------------------------------------------------
svn:eol-style = native