geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r788747 - in /geronimo/sandbox/blueprint: blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ blue...
Date Fri, 26 Jun 2009 15:45:56 GMT
Author: gawor
Date: Fri Jun 26 15:45:56 2009
New Revision: 788747

URL: http://svn.apache.org/viewvc?rev=788747&view=rev
Log:
BeanMetadata.getRuntimeClass() was removed

Modified:
    geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedBeanMetadata.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/BlueprintContainerImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/PlaceholdersUtils.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java

Modified: geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java?rev=788747&r1=788746&r2=788747&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-api/src/main/java/org/osgi/service/blueprint/reflect/BeanMetadata.java
Fri Jun 26 15:45:56 2009
@@ -117,13 +117,4 @@
 	 */
 	String getScope();
 
-	/**
-	 * Provide an actual class, this overrides the class name if set. This is
-	 * useful for Namespace Handler services that do not want to force the
-	 * Blueprint bundle to import implementation classes.
-	 *
-	 * @return Return the class to use in runtime or <code>null</code>.
-	 */
-
-	Class<?> getRuntimeClass();
 }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedBeanMetadata.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedBeanMetadata.java?rev=788747&r1=788746&r2=788747&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedBeanMetadata.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedBeanMetadata.java
Fri Jun 26 15:45:56 2009
@@ -30,5 +30,15 @@
 public interface ExtendedBeanMetadata extends BeanMetadata {
 
     boolean isProcessor();
+    
+    /**
+     * Provide an actual class, this overrides the class name if set. This is
+     * useful for Namespace Handler services that do not want to force the
+     * Blueprint bundle to import implementation classes.
+     *
+     * @return Return the class to use in runtime or <code>null</code>.
+     */
+    
+    Class<?> getRuntimeClass();
 
 }

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=788747&r1=788746&r2=788747&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 15:45:56 2009
@@ -141,7 +141,7 @@
     }
 
     public Object convertFromString(String value, Class toType, Object loader) throws Exception
{
-        if (ReifiedType.class == toType && blueprintContainer.getCompliance() ==
BlueprintContainer.COMPLIANCE_LOOSE) {
+        if (ReifiedType.class == toType) {
             try {
                 return GenericType.parse(value, loader);
             } catch (ClassNotFoundException e) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java?rev=788747&r1=788746&r2=788747&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
Fri Jun 26 15:45:56 2009
@@ -351,14 +351,19 @@
         for (BeanMetadata bean : getMetadata(BeanMetadata.class)) {
             if (bean instanceof ExtendedBeanMetadata && !((ExtendedBeanMetadata)
bean).isProcessor()) {
                 continue;
-            }
-            Class clazz = bean.getRuntimeClass();
+            }     
+            
+            Class clazz = null;
+            if (bean instanceof ExtendedBeanMetadata) {
+                clazz = ((ExtendedBeanMetadata) bean).getRuntimeClass();
+            }            
             if (clazz == null && bean.getClassName() != null) {
                 clazz = loadClass(bean.getClassName());
             }
             if (clazz == null) {
                 continue;
             }
+
             if (ComponentDefinitionRegistryProcessor.class.isAssignableFrom(clazz)) {
                 Object obj = repository.create(bean.getId());
                 ((ComponentDefinitionRegistryProcessor) obj).process(componentDefinitionRegistry);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java?rev=788747&r1=788746&r2=788747&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/RecipeBuilder.java
Fri Jun 26 15:45:56 2009
@@ -27,6 +27,7 @@
 import java.util.Set;
 
 import org.apache.geronimo.blueprint.ComponentDefinitionRegistry;
+import org.apache.geronimo.blueprint.ExtendedBeanMetadata;
 import org.apache.geronimo.blueprint.ExtendedBlueprintContainer;
 import org.apache.geronimo.blueprint.di.ArrayRecipe;
 import org.apache.geronimo.blueprint.di.CollectionRecipe;
@@ -186,11 +187,21 @@
         }
     }
     
+    private Object getBeanClass(BeanMetadata beanMetadata) {
+        if (beanMetadata instanceof ExtendedBeanMetadata) {
+            ExtendedBeanMetadata extBeanMetadata = (ExtendedBeanMetadata) beanMetadata;
+            if (extBeanMetadata.getRuntimeClass() != null) {
+                return extBeanMetadata.getRuntimeClass();
+            }
+        }
+        return beanMetadata.getClassName();        
+    }
+    
     private BeanRecipe createBeanRecipe(BeanMetadata beanMetadata) {
         BeanRecipe recipe = new BeanRecipe(
                 getName(beanMetadata.getId()),
                 blueprintContainer,
-                beanMetadata.getRuntimeClass() != null ? beanMetadata.getRuntimeClass() :
beanMetadata.getClassName());
+                getBeanClass(beanMetadata));
         // Create refs for explicit dependencies
         List<Recipe> deps = new ArrayList<Recipe>();
         for (String name : beanMetadata.getDependsOn()) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/PlaceholdersUtils.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/PlaceholdersUtils.java?rev=788747&r1=788746&r2=788747&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/PlaceholdersUtils.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ext/PlaceholdersUtils.java
Fri Jun 26 15:45:56 2009
@@ -19,6 +19,7 @@
 package org.apache.geronimo.blueprint.ext;
 
 import org.apache.geronimo.blueprint.ComponentDefinitionRegistry;
+import org.apache.geronimo.blueprint.ExtendedBeanMetadata;
 import org.apache.geronimo.blueprint.mutable.MutableBeanMetadata;
 import org.osgi.service.blueprint.container.ComponentDefinitionException;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
@@ -39,8 +40,8 @@
         String suffix = getPlaceholderProperty(metadata, "placeholderSuffix");
         for (String id : registry.getComponentDefinitionNames()) {
             ComponentMetadata component = registry.getComponentDefinition(id);
-            if (component instanceof BeanMetadata) {
-                BeanMetadata bean = (BeanMetadata) component;
+            if (component instanceof ExtendedBeanMetadata) {
+                ExtendedBeanMetadata bean = (ExtendedBeanMetadata) component;
                 if (bean.getRuntimeClass() != null && AbstractPropertyPlaceholder.class.isAssignableFrom(bean.getRuntimeClass()))
{
                     String otherPrefix = getPlaceholderProperty(bean, "placeholderPrefix");
                     String otherSuffix = getPlaceholderProperty(bean, "placeholderSuffix");

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java?rev=788747&r1=788746&r2=788747&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/reflect/BeanMetadataImpl.java
Fri Jun 26 15:45:56 2009
@@ -22,6 +22,7 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.geronimo.blueprint.ExtendedBeanMetadata;
 import org.apache.geronimo.blueprint.mutable.MutableBeanMetadata;
 import org.osgi.service.blueprint.reflect.BeanArgument;
 import org.osgi.service.blueprint.reflect.BeanMetadata;
@@ -68,10 +69,12 @@
         this.factoryMethod = source.getFactoryMethod();
         this.factoryComponent = MetadataUtil.cloneTarget(source.getFactoryComponent());
         this.scope = source.getScope();
-        this.runtimeClass = source.getRuntimeClass();
         this.dependsOn = new ArrayList<String>(source.getDependsOn());
+        if (source instanceof ExtendedBeanMetadata) {
+            this.runtimeClass = ((ExtendedBeanMetadata) source).getRuntimeClass();
+        }
     }
-
+    
     public String getClassName() {
         return className;
     }



Mime
View raw message