← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1873: Replaced deletionManager bean with annotations

 

------------------------------------------------------------
revno: 1873
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Tue 2010-05-18 00:56:52 +0200
message:
  Replaced deletionManager bean with annotations
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-mapping/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionInterceptor.java
  dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/deletion/DeletionManagerTest.java
  dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 14:19:14 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -171,7 +171,7 @@
   <!-- DeletionManager -->
   
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+    <property name="targetObject" ref="deletionManager"/>
     <property name="targetMethod" value="addDeletionHandlers"/>
     <property name="arguments">
       <list>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:46:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -984,7 +984,7 @@
   <!-- DeletionManager -->
   
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+    <property name="targetObject" ref="deletionManager"/>
     <property name="targetMethod" value="addDeletionHandlers"/>
     <property name="arguments">
 	  <list>

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 14:19:14 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -213,7 +213,7 @@
   <!-- DeletionManager -->
   
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+    <property name="targetObject" ref="deletionManager"/>
     <property name="targetMethod" value="addDeletionHandlers"/>
     <property name="arguments">
       <list>

=== modified file 'dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 16:30:35 +0000
+++ dhis-2/dhis-services/dhis-service-excel-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -50,7 +50,7 @@
 	<!-- DeletionManager -->
   
   	<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-		<property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+		<property name="targetObject" ref="deletionManager"/>
 		<property name="targetMethod" value="addDeletionHandlers"/>
 		<property name="arguments">
 		  <list>

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 14:19:14 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -60,7 +60,7 @@
   <!-- DeletionManager -->
   
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+    <property name="targetObject" ref="deletionManager"/>
     <property name="targetMethod" value="addDeletionHandlers"/>
     <property name="arguments">
       <list>

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 16:30:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -243,7 +243,7 @@
 	<!-- DeletionManager -->
   
   	<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-		<property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+		<property name="targetObject" ref="deletionManager"/>
 		<property name="targetMethod" value="addDeletionHandlers"/>
 		<property name="arguments">
 		  <list>

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 21:05:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -292,7 +292,7 @@
   <!-- DeletionManager -->
   
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-    <property name="targetObject" ref="org.hisp.dhis.system.deletion.DeletionManager"/>
+    <property name="targetObject" ref="deletionManager"/>
     <property name="targetMethod" value="addDeletionHandlers"/>
     <property name="arguments">
       <list>

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java	2010-04-23 10:50:13 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java	2010-05-17 22:56:52 +0000
@@ -38,11 +38,13 @@
 import org.hisp.dhis.common.DeleteNotAllowedException;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.source.Source;
+import org.springframework.stereotype.Component;
 
 /**
  * @author Lars Helge Overland
  * @version $Id$
  */
+@Component("deletionManager")
 public class DefaultDeletionManager
     implements DeletionManager
 {

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionInterceptor.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionInterceptor.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionInterceptor.java	2010-05-17 22:56:52 +0000
@@ -28,6 +28,7 @@
  */
 
 import org.aspectj.lang.JoinPoint;
+import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * @author Lars Helge Overland
@@ -39,13 +40,9 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
+    @Autowired
     private DeletionManager deletionManager;
 
-    public void setDeletionManager( DeletionManager deletionManager )
-    {
-        this.deletionManager = deletionManager;
-    }
-
     public void intercept( JoinPoint joinPoint )
     {
         if ( joinPoint.getArgs() != null && joinPoint.getArgs().length > 0 )

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 21:31:03 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/resources/META-INF/dhis/beans.xml	2010-05-17 22:56:52 +0000
@@ -11,13 +11,8 @@
     class="org.amplecode.cave.process.SpringProcessCoordinator"
     destroy-method="close"/>
 
-  <bean id="org.hisp.dhis.system.deletion.DeletionManager"
-    class="org.hisp.dhis.system.deletion.DefaultDeletionManager"/>
-  
   <bean id="deletionInterceptor"
     class="org.hisp.dhis.system.deletion.DeletionInterceptor">
-    <property name="deletionManager"
-      ref="org.hisp.dhis.system.deletion.DeletionManager"/>
   </bean>
   
   <bean id="org.hisp.dhis.system.database.DatabaseInfoProvider"

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/deletion/DeletionManagerTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/deletion/DeletionManagerTest.java	2010-05-10 17:50:39 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/deletion/DeletionManagerTest.java	2010-05-17 22:56:52 +0000
@@ -30,6 +30,7 @@
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataelement.DataElement;
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * @author Lars Helge Overland
@@ -38,6 +39,7 @@
 public class DeletionManagerTest
     extends DhisSpringTest
 {
+    @Autowired
     private DeletionManager deletionManager;
     
     private DataElement dataElement;
@@ -45,8 +47,6 @@
     @Override
     public void setUpTest()
     {
-        deletionManager = (DeletionManager) getBean( DeletionManager.ID );
-        
         dataElement = createDataElement( 'A' );
     }
     

=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisTest.java	2010-05-17 21:54:30 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisTest.java	2010-05-17 22:56:52 +0000
@@ -88,8 +88,6 @@
         
         if ( emptyDatabaseAfterTest() )
         {
-            //DbmsManager dbmsManager = (DbmsManager) getBean( DbmsManager.ID );
-                        
             dbmsManager.emptyDatabase();
         }
     }