Author: nickarls
Date: 2008-11-03 02:40:49 -0500 (Mon, 03 Nov 2008)
New Revision: 219
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyMethodHandler.java
Log:
Beans data structure from Set -> List in ManagerImpl
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-11-02
22:41:01 UTC (rev 218)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-11-03
07:40:49 UTC (rev 219)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -42,7 +43,7 @@
public class ManagerImpl implements Manager
{
-
+
private class ContextMap extends MapWrapper<Class<? extends Annotation>,
List<Context>>
{
public ContextMap()
@@ -177,7 +178,7 @@
private <T> Set<Bean<T>> resolveByType(Injectable<T, ?>
injectable)
{
Set<Bean<T>> beans = getResolutionManager().get(injectable);
-
+
if (beans == null)
{
return new HashSet<Bean<T>>();
@@ -194,19 +195,11 @@
return resolutionManager;
}
- public Bean<?> getBean(int beanIndex)
+ public List<Bean<?>> getBeans()
{
- return beans.get(beanIndex);
+ return beans;
}
- public Set<Bean<? extends Object>> getBeans()
- {
- // TODO List to Set?
- Set<Bean<?>> beanSet = new HashSet<Bean<?>>();
- beanSet.addAll(beans);
- return beanSet;
- }
-
public Manager addContext(Context context)
{
List<Context> contexts = contextMap.get(context.getScopeType());
@@ -389,5 +382,4 @@
return null;
}
-
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-11-02
22:41:01 UTC (rev 218)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-11-03
07:40:49 UTC (rev 219)
@@ -2,6 +2,7 @@
import java.lang.annotation.Annotation;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import javax.webbeans.BindingType;
@@ -62,7 +63,7 @@
return annotatedItem;
}
- public Set<Bean<?>> getMatchingBeans(Set<Bean<?>> beans,
ModelManager modelManager)
+ public Set<Bean<?>> getMatchingBeans(List<Bean<?>> beans,
ModelManager modelManager)
{
Set<Bean<?>> resolvedBeans = new HashSet<Bean<?>>();
for (Bean<?> bean : beans)
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-11-02
22:41:01 UTC (rev 218)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-11-03
07:40:49 UTC (rev 219)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.injectable;
import java.lang.annotation.Annotation;
+import java.util.List;
import java.util.Set;
import javax.webbeans.manager.Bean;
@@ -25,7 +26,7 @@
}
@Override
- public Set<Bean<?>> getMatchingBeans(Set<Bean<?>>
possibleBeans, ModelManager modelManager)
+ public Set<Bean<?>> getMatchingBeans(List<Bean<?>>
possibleBeans, ModelManager modelManager)
{
return delegate.getMatchingBeans(possibleBeans, modelManager);
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-11-02
22:41:01 UTC (rev 218)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-11-03
07:40:49 UTC (rev 219)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.injectable;
import java.lang.annotation.Annotation;
+import java.util.List;
import java.util.Set;
import javax.webbeans.manager.Bean;
@@ -25,7 +26,7 @@
}
@Override
- public Set<Bean<?>> getMatchingBeans(Set<Bean<?>>
possibleBeans, ModelManager modelManager)
+ public Set<Bean<?>> getMatchingBeans(List<Bean<?>>
possibleBeans, ModelManager modelManager)
{
return delegate.getMatchingBeans(possibleBeans, modelManager);
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyMethodHandler.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyMethodHandler.java 2008-11-02
22:41:01 UTC (rev 218)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ProxyMethodHandler.java 2008-11-03
07:40:49 UTC (rev 219)
@@ -2,6 +2,7 @@
import java.io.Serializable;
import java.lang.reflect.Method;
+import java.util.List;
import javassist.util.proxy.MethodHandler;
@@ -30,7 +31,7 @@
{
if (bean == null)
{
- bean = manager.getBean(beanIndex);
+ bean = manager.getBeans().get(beanIndex);
}
Context context = manager.getContext(bean.getScopeType());
Object proxiedInstance = context.get(bean, true);