svn commit: r1098322 - /struts/sandbox/trunk/struts2-cdi-plugin/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java

2011-05-01 Thread lukaszlenart
Author: lukaszlenart
Date: Sun May  1 14:29:02 2011
New Revision: 1098322

URL: http://svn.apache.org/viewvc?rev=1098322&view=rev
Log:
Removes unnecessary checking for log level and uses ConcurrentHashMap instead 
of HashMap

Modified:

struts/sandbox/trunk/struts2-cdi-plugin/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java

Modified: 
struts/sandbox/trunk/struts2-cdi-plugin/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-cdi-plugin/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java?rev=1098322&r1=1098321&r2=1098322&view=diff
==
--- 
struts/sandbox/trunk/struts2-cdi-plugin/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
 (original)
+++ 
struts/sandbox/trunk/struts2-cdi-plugin/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
 Sun May  1 14:29:02 2011
@@ -23,14 +23,14 @@ import com.opensymphony.xwork2.ObjectFac
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 
+import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.context.spi.CreationalContext;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import java.util.Map;
-import java.util.HashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * CdiObjectFactory allows Struts 2 managed objects, like Actions, 
Interceptors or Results, to be injected by a Contexts
@@ -52,7 +52,7 @@ public class CdiObjectFactory extends Ob
 protected BeanManager beanManager;
 protected CreationalContext ctx;
 
-Map, InjectionTarget> injectionTargetCache = new 
HashMap, InjectionTarget>();
+Map, InjectionTarget> injectionTargetCache = new 
ConcurrentHashMap, InjectionTarget>();
 
 public CdiObjectFactory() {
 super();
@@ -76,25 +76,17 @@ public class CdiObjectFactory extends Ob
 BeanManager bm;
 try {
 Context initialContext = new InitialContext();
-if (LOG.isInfoEnabled()) {
-LOG.info("[findBeanManager]: Checking for BeanManager under 
JNDI key " + CDI_JNDIKEY_BEANMANAGER_COMP);
-}
+LOG.info("[findBeanManager]: Checking for BeanManager under JNDI 
key " + CDI_JNDIKEY_BEANMANAGER_COMP);
 try {
 bm = (BeanManager) 
initialContext.lookup(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_COMP);
-} catch ( NamingException e ) {
-if (LOG.isWarnEnabled()) {
-LOG.warn("[findBeanManager]: Lookup failed.");
-}
-if (LOG.isInfoEnabled()) {
-LOG.info("[findBeanManager]: Checking for BeanManager 
under JNDI key " + CDI_JNDIKEY_BEANMANAGER_APP);
-}
+} catch (NamingException e) {
+LOG.warn("[findBeanManager]: Lookup failed.", e);
+LOG.info("[findBeanManager]: Checking for BeanManager under 
JNDI key " + CDI_JNDIKEY_BEANMANAGER_APP);
 bm = (BeanManager) 
initialContext.lookup(CdiObjectFactory.CDI_JNDIKEY_BEANMANAGER_APP);
 }
-if (LOG.isInfoEnabled()) {
-LOG.info("[findBeanManager]: BeanManager found.");
-}
+LOG.info("[findBeanManager]: BeanManager found.");
 return bm;
-} catch ( NamingException e ) {
+} catch (NamingException e) {
 LOG.error("Could not get BeanManager from JNDI context", e);
 }
 return null;
@@ -102,7 +94,7 @@ public class CdiObjectFactory extends Ob
 
 @Override
 @SuppressWarnings("unchecked")
-public Object buildBean( String className, Map 
extraContext, boolean injectInternal )
+public Object buildBean(String className, Map 
extraContext, boolean injectInternal)
 throws Exception {
 
 Class clazz = getClassInstance(className);
@@ -124,19 +116,16 @@ public class CdiObjectFactory extends Ob
  * will be created.
  *
  * @param clazz The class to get a InjectionTarget instance for.
- *
  * @return if found in cache, an existing instance. A new instance 
otherwise.
  */
-protected InjectionTarget getInjectionTarget( Class clazz ) {
+protected InjectionTarget getInjectionTarget(Class clazz) {
 InjectionTarget result;
-synchronized ( this ) {
-result = injectionTargetCache.get(clazz);
-if (result == null) {
-result = 
beanManager.createInjectionTarget(beanManager.createAnnotatedType(clazz));
-injectionTargetCache.put(clazz, result);
-}
-
+result = injectionTargetCache.get(clazz);
+if (result == null) {
+result = 
beanManager.createInjectionTarget(bean

svn commit: r1098325 - /struts/sandbox/trunk/struts2-cdi-plugin/pom.xml

2011-05-01 Thread lukaszlenart
Author: lukaszlenart
Date: Sun May  1 14:30:34 2011
New Revision: 1098325

URL: http://svn.apache.org/viewvc?rev=1098325&view=rev
Log:
Upgrades parent to latest version

Modified:
struts/sandbox/trunk/struts2-cdi-plugin/pom.xml

Modified: struts/sandbox/trunk/struts2-cdi-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-cdi-plugin/pom.xml?rev=1098325&r1=1098324&r2=1098325&view=diff
==
--- struts/sandbox/trunk/struts2-cdi-plugin/pom.xml (original)
+++ struts/sandbox/trunk/struts2-cdi-plugin/pom.xml Sun May  1 14:30:34 2011
@@ -5,7 +5,7 @@
 
 org.apache.struts
 struts2-plugins
-2.2.0-SNAPSHOT
+2.3-SNAPSHOT
 
 struts2-cdi-plugin
 
@@ -55,21 +55,18 @@
 
 org.springframework
 spring-test
-2.5.6
 test
 
 
 
 junit
 junit
-4.5
 test
 
 
 
 log4j
 log4j
-1.2.14
 test
 
 




svn commit: r1098398 - /struts/sandbox/trunk/struts2-cdi-example/pom.xml

2011-05-01 Thread jogep
Author: jogep
Date: Sun May  1 19:55:39 2011
New Revision: 1098398

URL: http://svn.apache.org/viewvc?rev=1098398&view=rev
Log:
Upgrades parent to latest version

Modified:
struts/sandbox/trunk/struts2-cdi-example/pom.xml

Modified: struts/sandbox/trunk/struts2-cdi-example/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-cdi-example/pom.xml?rev=1098398&r1=1098397&r2=1098398&view=diff
==
--- struts/sandbox/trunk/struts2-cdi-example/pom.xml (original)
+++ struts/sandbox/trunk/struts2-cdi-example/pom.xml Sun May  1 19:55:39 2011
@@ -5,7 +5,7 @@
 
 org.apache.struts
 struts2-apps
-2.2.0-SNAPSHOT
+2.3-SNAPSHOT
 
 org.apache.struts
 struts2-cdi-example
@@ -36,44 +36,41 @@
 
 org.apache.struts
 struts2-core
-${pom.version}
+${project.version}
 
 
 
 org.apache.struts
 struts2-junit-plugin
-${pom.version}
+${project.version}
 
 
 
 org.apache.struts
 struts2-cdi-plugin
-2.2.0-SNAPSHOT
+${project.version}
 
 
 
 commons-logging
 commons-logging
-1.1.1
 
 
 
 log4j
 log4j
-1.2.14
 
 
 
 javax.enterprise
 cdi-api
-1.0
+1.0-SP1
 provided
 
 
 
 junit
 junit
-4.5
 test
 
 




[CONF] Confluence Changes in the last 24 hours

2011-05-01 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache Camel (https://cwiki.apache.org/confluence/display/CAMEL)

Pages
-
Camel 2.8.0 Release edited by  davsclaus  (06:49 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.8.0+Release

Support edited by  davsclaus  (03:34 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Support



Apache Felix (https://cwiki.apache.org/confluence/display/FELIX)

Pages
-
news edited by  karlpauls  (04:44 PM)
https://cwiki.apache.org/confluence/display/FELIX/news

downloads edited by  karlpauls  (04:42 PM)
https://cwiki.apache.org/confluence/display/FELIX/downloads



Apache Tuscany (https://cwiki.apache.org/confluence/display/TUSCANY)

Pages
-
SCA Java Development Guide edited by  lrese...@apache.org  (04:00 PM)
https://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+Development+Guide

Making releases edited by  scnash  (11:39 AM)
https://cwiki.apache.org/confluence/display/TUSCANY/Making+releases




Change your notification preferences: 
https://cwiki.apache.org/confluence/users/viewnotifications.action