geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r788721 - in /geronimo/sandbox/blueprint: blueprint-api/src/main/java/org/osgi/service/blueprint/container/ blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/c...
Date Fri, 26 Jun 2009 14:47:34 GMT
Author: gnodet
Date: Fri Jun 26 14:47:33 2009
New Revision: 788721

URL: http://svn.apache.org/viewvc?rev=788721&view=rev
Log:
Rename CollapsedType to ReifiedType

Added:
    geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/ReifiedType.java
      - copied, changed from r788646, geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/CollapsedType.java
Removed:
    geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/CollapsedType.java
Modified:
    geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/Converter.java
    geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmManagedProperties.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AggregateConverter.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/GenericType.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ArrayRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/container/AggregateConverterTest.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterA.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterB.java
    geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java
    geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java

Modified: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/Converter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/Converter.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/Converter.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/Converter.java
Fri Jun 26 14:47:33 2009
@@ -33,7 +33,7 @@
 	 * @return <code>true</code> if the conversion is possible,
 	 *         <code>false</code> otherwise.
 	 */
-	boolean canConvert(Object s, CollapsedType T);
+	boolean canConvert(Object s, ReifiedType T);
 
 	/**
 	 * Convert an object to an instance of the given class, using the built-in
@@ -49,6 +49,6 @@
 	 *             because callers should expect that not all source objects can
 	 *             be successfully converted.
 	 */
-	Object convert(Object s, CollapsedType T) throws Exception;
+	Object convert(Object s, ReifiedType T) throws Exception;
 
 }
\ No newline at end of file

Copied: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/ReifiedType.java
(from r788646, geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/CollapsedType.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/ReifiedType.java?p2=geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/ReifiedType.java&p1=geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/CollapsedType.java&r1=788646&r2=788721&rev=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/CollapsedType.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/container/ReifiedType.java
Fri Jun 26 14:47:33 2009
@@ -32,8 +32,8 @@
  *@Immutable
  */
 
-public class CollapsedType {
-	final static CollapsedType ALL = new CollapsedType(Object.class);
+public class ReifiedType {
+	final static ReifiedType ALL = new ReifiedType(Object.class);
 
 	private final Class clazz;
 
@@ -44,7 +44,7 @@
 	 * @param clazz
 	 *            The class that is the collapsed type.
 	 */
-	public CollapsedType(Class clazz) {
+	public ReifiedType(Class clazz) {
 		this.clazz = clazz;
 	}
 
@@ -92,21 +92,18 @@
 	 *            The index of the type argument
 	 * @return A Collapsed Type that represents a type argument. If
 	 */
-	public CollapsedType getActualTypeArgument(int i) {
+	public ReifiedType getActualTypeArgument(int i) {
 		return ALL;
 	}
 
-    /**
-     * Number of type arguments.
-     *
-     * @return number of type arguments
-     */
-    public int size() {
-        return 0;
-    }
-    
-    public String toString() {
-        return clazz.toString();
-    }
-
+	/**
+	 * Return the number of type arguments.
+	 *
+	 * This method should be overridden by a subclass for Java 5 types.
+	 *
+	 * @return 0, subclasses must override this
+	 */
+	public int size() {
+		return 0;
+	}
 }

Modified: geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmManagedProperties.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmManagedProperties.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmManagedProperties.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-cm/src/main/java/org/apache/geronimo/blueprint/compendium/cm/CmManagedProperties.java
Fri Jun 26 14:47:33 2009
@@ -32,8 +32,6 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 import org.apache.geronimo.blueprint.BeanProcessor;
 import org.apache.geronimo.blueprint.ExtendedBlueprintContainer;
@@ -42,7 +40,7 @@
 import org.osgi.framework.Constants;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -236,7 +234,7 @@
                             Class methodParameterType = method.getParameterTypes()[0];
                             Object propertyValue;
                             try {
-                                propertyValue = blueprintContainer.getConverter().convert(val,
new CollapsedType(methodParameterType));
+                                propertyValue = blueprintContainer.getConverter().convert(val,
new ReifiedType(methodParameterType));
                             } catch (Throwable t) {
                                 LOGGER.debug("Unable to convert value for setter: " + method,
t);
                                 continue;

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AbstractServiceReferenceRecipe.java
Fri Jun 26 14:47:33 2009
@@ -47,7 +47,7 @@
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.reflect.ReferenceListener;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
@@ -192,7 +192,7 @@
         return classes;
     }
 
-    protected CollapsedType loadType(String typeName, ClassLoader fromClassLoader) {
+    protected ReifiedType loadType(String typeName, ClassLoader fromClassLoader) {
         if (typeName == null) {
             return null;
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AggregateConverter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AggregateConverter.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AggregateConverter.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/AggregateConverter.java
Fri Jun 26 14:47:33 2009
@@ -36,7 +36,7 @@
 import org.apache.geronimo.blueprint.di.MapRecipe;
 import static org.apache.geronimo.blueprint.utils.ReflectionUtils.getRealCause;
 import org.osgi.service.blueprint.container.BlueprintContainer;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.Converter;
 
 /**
@@ -60,7 +60,7 @@
      */
     public static interface Convertible {
 
-        Object convert(CollapsedType type) throws Exception;
+        Object convert(ReifiedType type) throws Exception;
     }
 
     private ExtendedBlueprintContainer blueprintContainer;
@@ -78,7 +78,7 @@
         converters.remove(converter);
     }
 
-    public boolean canConvert(Object fromValue, CollapsedType toType) {
+    public boolean canConvert(Object fromValue, ReifiedType toType) {
         if (fromValue == null) {
             return true;
         }
@@ -97,7 +97,7 @@
         return false;
     }
 
-    public Object convert(Object fromValue, CollapsedType type) throws Exception {
+    public Object convert(Object fromValue, ReifiedType type) throws Exception {
         // Discard null values
         if (fromValue == null) {
             return null;
@@ -127,7 +127,7 @@
         return value;
     }
 
-    private Object convertWithConverters(Object source, CollapsedType type) throws Exception
{
+    private Object convertWithConverters(Object source, ReifiedType type) throws Exception
{
         Object value = null;
         for (Converter converter : converters) {
             if (converter.canConvert(source, type)) {
@@ -141,7 +141,7 @@
     }
 
     public Object convertFromString(String value, Class toType, Object loader) throws Exception
{
-        if (CollapsedType.class == toType && blueprintContainer.getCompliance() ==
BlueprintContainer.COMPLIANCE_LOOSE) {
+        if (ReifiedType.class == toType && blueprintContainer.getCompliance() ==
BlueprintContainer.COMPLIANCE_LOOSE) {
             try {
                 return GenericType.parse(value, loader);
             } catch (ClassNotFoundException e) {
@@ -224,8 +224,8 @@
         }
     }
 
-    private Object convertCollection(Object obj, CollapsedType type) throws Exception {
-        CollapsedType valueType = type.getActualTypeArgument(0);
+    private Object convertCollection(Object obj, ReifiedType type) throws Exception {
+        ReifiedType valueType = type.getActualTypeArgument(0);
         Collection newCol = (Collection) CollectionRecipe.getCollection(toClass(type)).newInstance();
         if (obj.getClass().isArray()) {
             for (int i = 0; i < Array.getLength(obj); i++) {
@@ -247,9 +247,9 @@
         return newCol;
     }
 
-    private Object convertMap(Object obj, CollapsedType type) throws Exception {
-        CollapsedType keyType = type.getActualTypeArgument(0);
-        CollapsedType valueType = type.getActualTypeArgument(1);
+    private Object convertMap(Object obj, ReifiedType type) throws Exception {
+        ReifiedType keyType = type.getActualTypeArgument(0);
+        ReifiedType valueType = type.getActualTypeArgument(1);
         Map newMap = (Map) MapRecipe.getMap(toClass(type)).newInstance();
         for (Map.Entry e : ((Map<Object,Object>) obj).entrySet()) {
             try {
@@ -261,14 +261,14 @@
         return newMap;
     }
 
-    private Object convertArray(Object obj, CollapsedType type) throws Exception {
+    private Object convertArray(Object obj, ReifiedType type) throws Exception {
         if (obj instanceof Collection) {
             obj = ((Collection) obj).toArray();
         }
         if (!obj.getClass().isArray()) {
             throw new Exception("Unable to convert from " + obj + " to " + type);
         }
-        CollapsedType componentType = type.getActualTypeArgument(0);
+        ReifiedType componentType = type.getActualTypeArgument(0);
         Object array = Array.newInstance(toClass(componentType), Array.getLength(obj));
         for (int i = 0; i < Array.getLength(obj); i++) {
             try {
@@ -306,7 +306,7 @@
             return null;
     }
 
-    private boolean isAssignable(Object source, CollapsedType target) {
+    private boolean isAssignable(Object source, ReifiedType target) {
         return target.size() == 0
                 && unwrap(target.getRawClass()).isAssignableFrom(unwrap(source.getClass()));
     }
@@ -339,7 +339,7 @@
         return blueprintContainer.loadClass(s);
     }
 
-    private Class toClass(CollapsedType type) {
+    private Class toClass(ReifiedType type) {
         return type.getRawClass();
     }
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
Fri Jun 26 14:47:33 2009
@@ -37,7 +37,7 @@
 import org.apache.geronimo.blueprint.utils.ReflectionUtils;
 import static org.apache.geronimo.blueprint.utils.ReflectionUtils.getRealCause;
 import static org.apache.geronimo.blueprint.utils.TypeUtils.isInstance;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -161,12 +161,12 @@
     @Override
     protected Class loadClass(String className) {
         ClassLoader loader = type instanceof Class ? ((Class) type).getClassLoader() : null;
-        CollapsedType t = loadType(className, loader);
+        ReifiedType t = loadType(className, loader);
         return t != null ? t.getRawClass() : null;
     }
 
     @Override
-    protected CollapsedType loadType(String className) {
+    protected ReifiedType loadType(String className) {
         return loadType(className, type instanceof Class ? ((Class) type).getClassLoader()
: null);
     }
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
Fri Jun 26 14:47:33 2009
@@ -38,7 +38,7 @@
 import org.apache.geronimo.blueprint.di.Recipe;
 import org.apache.geronimo.blueprint.di.RefRecipe;
 import org.apache.geronimo.blueprint.di.Repository;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.container.NoSuchComponentException;
 import org.slf4j.Logger;
@@ -148,7 +148,7 @@
                 Object obj = createInstance(name);
                 try {
                     // Make sure to go through the conversion step in case we have a Convertible
object
-                    obj = convert(obj, new CollapsedType(Object.class));
+                    obj = convert(obj, new ReifiedType(Object.class));
                 } catch (Exception e) {
                     throw new ComponentDefinitionException("Unable to convert instance "
+ name, e);
                 }
@@ -320,7 +320,7 @@
         return obj;
     }
 
-    public Object convert(Object value, CollapsedType type) throws Exception {
+    public Object convert(Object value, ReifiedType type) throws Exception {
         return blueprintContainer.getConverter().convert(value, type);
     }
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/GenericType.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/GenericType.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/GenericType.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/GenericType.java
Fri Jun 26 14:47:33 2009
@@ -29,14 +29,14 @@
 import org.apache.geronimo.blueprint.ExtendedBlueprintContainer;
 import org.apache.geronimo.blueprint.di.ExecutionContext;
 import org.osgi.framework.Bundle;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 
 /**
  * XXXX: Currently, in case of arrays getActualTypeArgument(0) returns something similar
to what
  * Class.getComponentType() does for arrays.  I don't think this is quite right since getActualTypeArgument()
  * should return the given parameterized type not the component type. Need to check this
behavior with the spec.
  */
-public class GenericType extends CollapsedType {
+public class GenericType extends ReifiedType {
 
 	private static final GenericType[] EMPTY = new GenericType[0];
 
@@ -104,7 +104,7 @@
     }
 
     @Override
-    public CollapsedType getActualTypeArgument(int i) {
+    public ReifiedType getActualTypeArgument(int i) {
         if (parameters.length == 0) {
             return super.getActualTypeArgument(i);
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RefListRecipe.java
Fri Jun 26 14:47:33 2009
@@ -37,7 +37,7 @@
 import org.apache.geronimo.blueprint.utils.DynamicCollection;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.container.ServiceUnavailableException;
 import org.osgi.service.blueprint.reflect.ReferenceListMetadata;
@@ -230,7 +230,7 @@
 
     public class ProvidedObject implements AggregateConverter.Convertible {
 
-        public Object convert(CollapsedType type) {
+        public Object convert(ReifiedType type) {
             LOGGER.debug("Converting ManagedCollection to {}", type);
             if (!type.getRawClass().isAssignableFrom(List.class)) {
                 throw new ComponentDefinitionException("<ref-list/> can only be converted
to a List, not " + type);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
Fri Jun 26 14:47:33 2009
@@ -26,7 +26,7 @@
 import org.apache.geronimo.blueprint.di.Recipe;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.blueprint.container.BlueprintEvent;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.container.ServiceUnavailableException;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
@@ -206,7 +206,7 @@
 
     public class ServiceProxyWrapper implements AggregateConverter.Convertible {
 
-        public Object convert(CollapsedType type) throws Exception {
+        public Object convert(ReifiedType type) throws Exception {
             if (type.getRawClass() == ServiceReference.class) {
                 return getServiceReference();
             } else if (type.getRawClass().isInstance(proxy)) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
Fri Jun 26 14:47:33 2009
@@ -20,7 +20,7 @@
 import java.lang.reflect.Type;
 
 import org.apache.geronimo.blueprint.container.GenericType;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 
 public abstract class AbstractRecipe implements Recipe {
@@ -82,7 +82,7 @@
         ExecutionContext.Holder.getContext().addObject(name, obj, partial);
     }
     
-    protected Object convert(Object obj, CollapsedType type) throws Exception {
+    protected Object convert(Object obj, ReifiedType type) throws Exception {
         return ExecutionContext.Holder.getContext().convert(obj, type);
     }
 
@@ -91,15 +91,15 @@
     }
 
     protected Class loadClass(String className) {
-        CollapsedType t = loadType(className, null);
+        ReifiedType t = loadType(className, null);
         return t != null ? t.getRawClass() : null;
     }
 
-    protected CollapsedType loadType(String typeName) {
+    protected ReifiedType loadType(String typeName) {
         return loadType(typeName, null);
     }
 
-    protected CollapsedType loadType(String typeName, ClassLoader fromClassLoader) {
+    protected ReifiedType loadType(String typeName, ClassLoader fromClassLoader) {
         if (typeName == null) {
             return null;
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ArrayRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ArrayRecipe.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ArrayRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ArrayRecipe.java
Fri Jun 26 14:47:33 2009
@@ -17,13 +17,11 @@
 package org.apache.geronimo.blueprint.di;
 
 import java.lang.reflect.Array;
-import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.List;
 
-import static org.apache.geronimo.blueprint.utils.TypeUtils.toClass;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 
 /**
  * @version $Rev$ $Date$
@@ -50,13 +48,13 @@
     }
 
     protected Object internalCreate() throws ComponentDefinitionException {
-        CollapsedType type;
+        ReifiedType type;
         if (this.type instanceof Class) {
-            type = new CollapsedType((Class) this.type);
+            type = new ReifiedType((Class) this.type);
         } else if (this.type instanceof String) {
             type = loadType((String) this.type);
         } else {
-            type = new CollapsedType(Object.class);
+            type = new ReifiedType(Object.class);
         }
 
         // create array instance

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
Fri Jun 26 14:47:33 2009
@@ -17,7 +17,7 @@
  */
 package org.apache.geronimo.blueprint.di;
 
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 
 public interface ExecutionContext {
 
@@ -92,7 +92,7 @@
     
     public abstract Object getPartialObject(String name);
 
-    public abstract Object convert(Object value, CollapsedType type) throws Exception;
+    public abstract Object convert(Object value, ReifiedType type) throws Exception;
 
     public abstract Class loadClass(String className) throws ClassNotFoundException;
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/container/AggregateConverterTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/container/AggregateConverterTest.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/container/AggregateConverterTest.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/container/AggregateConverterTest.java
Fri Jun 26 14:47:33 2009
@@ -29,7 +29,7 @@
 
 import junit.framework.TestCase;
 import org.apache.geronimo.blueprint.TestBlueprintContainer;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.Converter;
 
 public class AggregateConverterTest extends TestCase {
@@ -188,28 +188,28 @@
     private interface AsianRegion extends Region {}
     
     private static class RegionConverter implements Converter {
-        public boolean canConvert(Object fromValue, CollapsedType toType) {
+        public boolean canConvert(Object fromValue, ReifiedType toType) {
             return Region.class == toType.getRawClass();
         }
-        public Object convert(Object source, CollapsedType toType) throws Exception {
+        public Object convert(Object source, ReifiedType toType) throws Exception {
             return new Region() {} ;
         }
     }
     
     private static class EuRegionConverter implements Converter {
-        public boolean canConvert(Object fromValue, CollapsedType toType) {
+        public boolean canConvert(Object fromValue, ReifiedType toType) {
             return toType.getRawClass().isAssignableFrom(EuRegion.class);
         }
-        public Object convert(Object source, CollapsedType toType) throws Exception {
+        public Object convert(Object source, ReifiedType toType) throws Exception {
             return new EuRegion() {} ;
         }
     }
     
     private static class AsianRegionConverter implements Converter {
-        public boolean canConvert(Object fromValue, CollapsedType toType) {
+        public boolean canConvert(Object fromValue, ReifiedType toType) {
             return toType.getRawClass().isAssignableFrom(AsianRegion.class);
         }
-        public Object convert(Object source, CollapsedType toType) throws Exception {
+        public Object convert(Object source, ReifiedType toType) throws Exception {
             return new AsianRegion() {} ;
         }
     }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterA.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterA.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterA.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterA.java
Fri Jun 26 14:47:33 2009
@@ -20,16 +20,16 @@
 
 import java.io.File;
 
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.Converter;
 
 public class ConverterA implements Converter {
 
-    public boolean canConvert(Object fromValue, CollapsedType toType) {
+    public boolean canConvert(Object fromValue, ReifiedType toType) {
         return fromValue instanceof String && toType.getRawClass() == File.class;
     }
 
-    public Object convert(Object source, CollapsedType toType) throws Exception {
+    public Object convert(Object source, ReifiedType toType) throws Exception {
         if (source instanceof String) {
             return new File((String) source);
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterB.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterB.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterB.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/ConverterB.java
Fri Jun 26 14:47:33 2009
@@ -20,16 +20,16 @@
 
 import java.net.URI;
 
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 import org.osgi.service.blueprint.container.Converter;
 
 public class ConverterB implements Converter {
 
-    public boolean canConvert(Object fromValue, CollapsedType toType) {
+    public boolean canConvert(Object fromValue, ReifiedType toType) {
         return fromValue instanceof String && toType.getRawClass() == URI.class;
     }
 
-    public Object convert(Object source, CollapsedType toType) throws Exception {
+    public Object convert(Object source, ReifiedType toType) throws Exception {
         if (source instanceof String) {
             return new URI((String) source);
         }

Modified: geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/CurrencyTypeConverter.java
Fri Jun 26 14:47:33 2009
@@ -19,15 +19,15 @@
 import java.util.Currency;
 
 import org.osgi.service.blueprint.container.Converter;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 
 public class CurrencyTypeConverter implements Converter {
 
-    public boolean canConvert(Object fromValue, CollapsedType toType) {
+    public boolean canConvert(Object fromValue, ReifiedType toType) {
         return Currency.class.isAssignableFrom(toType.getRawClass());
     }
 
-    public Object convert(Object source, CollapsedType toType) throws Exception {
+    public Object convert(Object source, ReifiedType toType) throws Exception {
         return Currency.getInstance(source.toString());
     }
 

Modified: geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java?rev=788721&r1=788720&r2=788721&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-sample/src/main/java/org/apache/geronimo/blueprint/sample/DateTypeConverter.java
Fri Jun 26 14:47:33 2009
@@ -21,7 +21,7 @@
 import java.util.Date;
 
 import org.osgi.service.blueprint.container.Converter;
-import org.osgi.service.blueprint.container.CollapsedType;
+import org.osgi.service.blueprint.container.ReifiedType;
 
 public class DateTypeConverter implements Converter {
 
@@ -31,11 +31,11 @@
         dateFormat = new SimpleDateFormat(format);
     }
     
-    public Object convert(Object source, CollapsedType toType) throws Exception {
+    public Object convert(Object source, ReifiedType toType) throws Exception {
         return dateFormat.parse(source.toString());
     }
 
-    public boolean canConvert(Object fromValue, CollapsedType toType) {
+    public boolean canConvert(Object fromValue, ReifiedType toType) {
         return Date.class.isAssignableFrom(toType.getRawClass());
     }
 



Mime
View raw message