[webbeans-commits] Webbeans SVN: r1199 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: util and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Fri Jan 23 08:30:20 EST 2009
Author: pete.muir at jboss.org
Date: 2009-01-23 08:30:20 -0500 (Fri, 23 Jan 2009)
New Revision: 1199
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ContextMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
Log:
minor
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ContextMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ContextMap.java 2009-01-23 07:38:07 UTC (rev 1198)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ContextMap.java 2009-01-23 13:30:20 UTC (rev 1199)
@@ -21,9 +21,7 @@
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Future;
-import javax.webbeans.ExecutionException;
import javax.webbeans.manager.Context;
import org.jboss.webbeans.util.ConcurrentCache;
@@ -46,34 +44,13 @@
*/
public AbstractContext getBuiltInContext(Class<? extends Annotation> scopeType)
{
- boolean interrupted = false;
- try
+ if (getContext(scopeType) != null)
{
- while (true)
- {
- try
- {
- Future<List<Context>> future = getFuture(scopeType);
- if (future == null)
- return null;
- return (AbstractContext) future.get().iterator().next();
- }
- catch (InterruptedException e)
- {
- interrupted = true;
- }
- catch (java.util.concurrent.ExecutionException e)
- {
- rethrow(e);
- }
- }
+ return (AbstractContext) getContext(scopeType).get(0);
}
- finally
+ else
{
- if (interrupted)
- {
- Thread.currentThread().interrupt();
- }
+ return null;
}
}
@@ -86,36 +63,7 @@
*/
public List<Context> getContext(Class<? extends Annotation> scopeType)
{
- boolean interrupted = false;
- try
- {
- while (true)
- {
- try
- {
- if (getFuture(scopeType) == null)
- {
- throw new ExecutionException("No scope registered for " + scopeType);
- }
- return getFuture(scopeType).get();
- }
- catch (InterruptedException e)
- {
- interrupted = true;
- }
- catch (java.util.concurrent.ExecutionException e)
- {
- rethrow(e);
- }
- }
- }
- finally
- {
- if (interrupted)
- {
- Thread.currentThread().interrupt();
- }
- }
+ return getValue(scopeType);
}
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2009-01-23 07:38:07 UTC (rev 1198)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2009-01-23 13:30:20 UTC (rev 1199)
@@ -88,7 +88,6 @@
{
rethrow(e);
}
- ;
}
}
finally
More information about the weld-commits
mailing list