geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r776387 - in /geronimo/sandbox/blueprint/blueprint-core/src: main/java/org/apache/geronimo/blueprint/ main/java/org/apache/geronimo/blueprint/container/ main/java/org/apache/geronimo/blueprint/namespace/ main/resources/org/apache/geronimo/b...
Date Tue, 19 May 2009 17:18:53 GMT
Author: gawor
Date: Tue May 19 17:18:53 2009
New Revision: 776387

URL: http://svn.apache.org/viewvc?rev=776387&view=rev
Log:
synch to latest schema: default init-method/destroy-method support was removed

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedComponentDefinitionRegistry.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintObjectRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-depends-on.xml
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-generics.xml
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedComponentDefinitionRegistry.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedComponentDefinitionRegistry.java?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedComponentDefinitionRegistry.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ExtendedComponentDefinitionRegistry.java
Tue May 19 17:18:53 2009
@@ -31,14 +31,6 @@
  */
 public interface ExtendedComponentDefinitionRegistry extends ComponentDefinitionRegistry
{
 
-    String getDefaultInitMethod();
-
-    void setDefaultInitMethod(String defaultInitMethod);
-
-    String getDefaultDestroyMethod();
-
-    void setDefaultDestroyMethod(String defaultDestroyMethod);
-
     void registerTypeConverter(Target component);
 
     List<Target> getTypeConverters();

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintObjectRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintObjectRecipe.java?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintObjectRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintObjectRecipe.java
Tue May 19 17:18:53 2009
@@ -484,10 +484,7 @@
      */
     protected Method getInitMethod(Object instance) throws ConstructionException {
         Method method = null;        
-        if (initMethod == null) {
-            ExtendedComponentDefinitionRegistry registry = blueprintContainer.getComponentDefinitionRegistry();
-            method = ReflectionUtils.getLifecycleMethod(instance.getClass(), registry.getDefaultInitMethod());
-        } else if (initMethod.length() > 0) {
+        if (initMethod != null && initMethod.length() > 0) {
             method = ReflectionUtils.getLifecycleMethod(instance.getClass(), initMethod);
             if (method == null) {
                 throw new ConstructionException("Component '" + getName() + "' does not have
init-method: " + initMethod);
@@ -502,10 +499,7 @@
      */
     public Method getDestroyMethod(Object instance) throws ConstructionException {
         Method method = null;        
-        if (destroyMethod == null) {
-            ExtendedComponentDefinitionRegistry registry = blueprintContainer.getComponentDefinitionRegistry();
-            method = ReflectionUtils.getLifecycleMethod(instance.getClass(), registry.getDefaultDestroyMethod());
-        } else if (destroyMethod.length() > 0) {
+        if (destroyMethod != null && destroyMethod.length() > 0) {
             method = ReflectionUtils.getLifecycleMethod(instance.getClass(), destroyMethod);
             if (method == null) {
                 throw new ConstructionException("Component '" + getName() + "' does not have
destroy-method: " + destroyMethod);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/Parser.java
Tue May 19 17:18:53 2009
@@ -131,8 +131,6 @@
     public static final String KEY_ELEMENT = "key";
     public static final String COMPARATOR_ELEMENT = "comparator";
     public static final String DEFAULT_LAZY_INIT_ATTRIBUTE = "default-lazy-init";
-    public static final String DEFAULT_INIT_METHOD_ATTRIBUTE = "default-init-method";
-    public static final String DEFAULT_DESTROY_METHOD_ATTRIBUTE = "default-destroy-method";
     public static final String DEFAULT_TIMEOUT_ATTRIBUTE = "default-timeout";
     public static final String DEFAULT_AVAILABILITY_ATTRIBUTE = "default-availability";
     public static final String NAME_ATTRIBUTE = "name";
@@ -201,8 +199,6 @@
     private String defaultTimeout;
     private String defaultAvailability;
     private String defaultLazyInit;
-    private String defaultInitMethod;
-    private String defaultDestroyMethod;
     private Set<URI> namespaces;
     private boolean validated;
 
@@ -316,8 +312,6 @@
         defaultTimeout = TIMEOUT_DEFAULT;
         defaultAvailability = AVAILABILITY_DEFAULT;
         defaultLazyInit = LAZY_INIT_DEFAULT;
-        defaultInitMethod = null;
-        defaultDestroyMethod = null;
         Element root = doc.getDocumentElement();
         if (!isBlueprintNamespace(root.getNamespaceURI()) ||
                 !nodeNameEquals(root, BLUEPRINT_ELEMENT)) {
@@ -327,22 +321,13 @@
         if (root.hasAttribute(DEFAULT_LAZY_INIT_ATTRIBUTE)) {
             defaultLazyInit = root.getAttribute(DEFAULT_LAZY_INIT_ATTRIBUTE);
         }
-        if (root.hasAttribute(DEFAULT_INIT_METHOD_ATTRIBUTE)) {
-            defaultInitMethod = root.getAttribute(DEFAULT_INIT_METHOD_ATTRIBUTE);
-        }
-        if (root.hasAttribute(DEFAULT_DESTROY_METHOD_ATTRIBUTE)) {
-            defaultDestroyMethod = root.getAttribute(DEFAULT_DESTROY_METHOD_ATTRIBUTE);
-        }
         if (root.hasAttribute(DEFAULT_TIMEOUT_ATTRIBUTE)) {
             defaultTimeout = root.getAttribute(DEFAULT_TIMEOUT_ATTRIBUTE);
         }
         if (root.hasAttribute(DEFAULT_AVAILABILITY_ATTRIBUTE)) {
             defaultAvailability = root.getAttribute(DEFAULT_AVAILABILITY_ATTRIBUTE);
         }
-        
-        registry.setDefaultInitMethod(defaultInitMethod);
-        registry.setDefaultDestroyMethod(defaultDestroyMethod);
-        
+                
         /*
         // Parse custom attributes
         NamedNodeMap attributes = root.getAttributes();

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
Tue May 19 17:18:53 2009
@@ -43,8 +43,6 @@
 
     private final Map<String, ComponentMetadata> components;
     private final List<Target> typeConverters;
-    private String defaultInitMethod;
-    private String defaultDestroyMethod;
 
     public ComponentDefinitionRegistryImpl() {
         components = new ConcurrentHashMap<String, ComponentMetadata>();
@@ -89,21 +87,5 @@
     public List<Target> getTypeConverters() {
         return typeConverters;
     }
-
-    public void setDefaultInitMethod(String method) {
-        defaultInitMethod = method;
-    }
-    
-    public String getDefaultInitMethod() {
-        return defaultInitMethod;
-    }
-    
-    public void setDefaultDestroyMethod(String method) {
-        defaultDestroyMethod = method;
-    }
-    
-    public String getDefaultDestroyMethod() {
-        return defaultDestroyMethod;
-    }
     
 }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
Tue May 19 17:18:53 2009
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!--
     /*
-    * $Revision: 7017 $
+    * $Revision: 7065 $
     *
     * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
     *
@@ -105,36 +105,6 @@
                 </xsd:documentation>
             </xsd:annotation>
         </xsd:attribute>
-        <xsd:attribute name="default-init-method" type="Tmethod">
-            <xsd:annotation>
-                <xsd:documentation>
-                  <![CDATA[
-                  Specifies the default init-method that will be defined
-                  for <bean> components.  If not specified, no default
-                  init-method is defined.  It is not an error for a
-                  bean to not implement the indicated default init-method.
-                  The value will be ignored.  A bean can also specify
-                  a different init-method or disable the init-method
-                  call by specifying an init-method value of "".
-                  ]]>
-                </xsd:documentation>
-            </xsd:annotation>
-        </xsd:attribute>
-        <xsd:attribute name="default-destroy-method" type="Tmethod">
-            <xsd:annotation>
-                <xsd:documentation>
-                  <![CDATA[
-                  Specifies the default destroy-method that will be defined
-                  for <bean> components.  If not specified, no default
-                  destroy-method is defined.  It is not an error for a
-                  bean to not implement the indicated default destroy-method.
-                  The value will be ignored.  A bean can also specify
-                  a different destroy-method or disable the destroy-method
-                  call by specifying a destroy-method value of "".
-                  ]]>
-                </xsd:documentation>
-            </xsd:annotation>
-        </xsd:attribute>
         <xsd:attribute name="default-timeout" type="Ttimeout" default="300000">
             <xsd:annotation>
                 <xsd:documentation>

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-constructor.xml Tue
May 19 17:18:53 2009
@@ -2,9 +2,7 @@
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-            default-availability="mandatory"
-            default-init-method = "init"
-            default-destroy-method = "destroy" >
+            default-availability="mandatory" >
 
     <bean id="pojoB" class="org.apache.geronimo.blueprint.pojos.PojoB">
         <argument value="urn:myuri" />

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-depends-on.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-depends-on.xml?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-depends-on.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-depends-on.xml Tue May
19 17:18:53 2009
@@ -1,13 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-           default-init-method="init"
-           default-destroy-method="destroy">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
 
-    <bean id="c" class="org.apache.geronimo.blueprint.pojos.BeanC" depends-on="d" init-method="init"/>
+    <bean id="c" class="org.apache.geronimo.blueprint.pojos.BeanC" depends-on="d" init-method="init"
destroy-method="destroy"/>
 
-    <bean id="d" class="org.apache.geronimo.blueprint.pojos.BeanD" init-method="init"/>
+    <bean id="d" class="org.apache.geronimo.blueprint.pojos.BeanD" init-method="init"
destroy-method="destroy"/>
     
-    <bean id="e" class="org.apache.geronimo.blueprint.pojos.BeanE" init-method="init">
+    <bean id="e" class="org.apache.geronimo.blueprint.pojos.BeanE" init-method="init"
destroy-method="destroy">
         <argument ref="c"/>
     </bean>
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-generics.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-generics.xml?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-generics.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-generics.xml Tue May
19 17:18:53 2009
@@ -2,9 +2,7 @@
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-            default-availability="mandatory"
-            default-init-method = "init"
-            default-destroy-method = "destroy" >
+            default-availability="mandatory" >
 
     <bean id="method" class="org.apache.geronimo.blueprint.pojos.PojoGenerics">
         <property name="list">

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-simple-component.xml
Tue May 19 17:18:53 2009
@@ -1,7 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-           default-init-method="init"
-           default-destroy-method="destroy">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
 
     <bean id="pojoA" class="org.apache.geronimo.blueprint.pojos.PojoA" depends-on=" pojoB
, pojoC ,">
         <argument value="val0"/>

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml?rev=776387&r1=776386&r2=776387&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml Tue May 19
17:18:53 2009
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-           default-availability="mandatory"
-           default-init-method="init"
-           default-destroy-method="destroy">
+           default-availability="mandatory" >
 
     <type-converters>
             <bean id="converter1" class="org.apache.geronimo.blueprint.pojos.ConverterA">
@@ -21,7 +19,7 @@
         <property name="uri" value="urn:myuri" />
     </bean>
     
-    <bean id="pojoB" class="org.apache.geronimo.blueprint.pojos.PojoB" init-method = "init">
+    <bean id="pojoB" class="org.apache.geronimo.blueprint.pojos.PojoB" init-method = "init"
destroy-method = "destroy" >
         <property name="uri" value="urn:myuri" />
     </bean>
 



Mime
View raw message