commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r761276 - in /commons/sandbox/monitoring/branches/modules: pom.xml reporting/pom.xml spring/pom.xml spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java
Date Thu, 02 Apr 2009 12:52:27 GMT
Author: nicolas
Date: Thu Apr  2 12:52:27 2009
New Revision: 761276

URL: http://svn.apache.org/viewvc?rev=761276&view=rev
Log:
support for decorators in Spring configuration

Modified:
    commons/sandbox/monitoring/branches/modules/pom.xml
    commons/sandbox/monitoring/branches/modules/reporting/pom.xml
    commons/sandbox/monitoring/branches/modules/spring/pom.xml
    commons/sandbox/monitoring/branches/modules/spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java

Modified: commons/sandbox/monitoring/branches/modules/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/pom.xml?rev=761276&r1=761275&r2=761276&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/pom.xml (original)
+++ commons/sandbox/monitoring/branches/modules/pom.xml Thu Apr  2 12:52:27 2009
@@ -58,6 +58,24 @@
     <url>http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/</url>
   </scm>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>2.0.4</version>
+        <executions>
+          <execution>
+            <phase>install</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
   <distributionManagement>
     <site>
       <id>website</id>

Modified: commons/sandbox/monitoring/branches/modules/reporting/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/reporting/pom.xml?rev=761276&r1=761275&r2=761276&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/reporting/pom.xml (original)
+++ commons/sandbox/monitoring/branches/modules/reporting/pom.xml Thu Apr  2 12:52:27 2009
@@ -6,6 +6,7 @@
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>commons-monitoring-reporting</artifactId>
+  <name>Commons Monitoring (Sandbox) reporting</name>
   <dependencies>
     <dependency>
       <groupId>org.apache.commons.monitoring</groupId>

Modified: commons/sandbox/monitoring/branches/modules/spring/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/spring/pom.xml?rev=761276&r1=761275&r2=761276&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/spring/pom.xml (original)
+++ commons/sandbox/monitoring/branches/modules/spring/pom.xml Thu Apr  2 12:52:27 2009
@@ -7,16 +7,18 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.commons.monitoring</groupId>
   <artifactId>commons-monitoring-spring</artifactId>
+  <name>Commons Monitoring (Sandbox) spring integration</name>
+
   <dependencies>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
-      <version>2.5.5</version>
+      <version>2.5.6</version>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-beans</artifactId>
-      <version>2.5.5</version>
+      <version>2.5.6</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons.monitoring</groupId>
@@ -31,12 +33,12 @@
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-aop</artifactId>
-      <version>2.5.5</version>
+      <version>2.5.6</version>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-web</artifactId>
-      <version>2.5.5</version>
+      <version>2.5.6</version>
       <optional>true</optional>
     </dependency>
     <dependency>

Modified: commons/sandbox/monitoring/branches/modules/spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java?rev=761276&r1=761275&r2=761276&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java
(original)
+++ commons/sandbox/monitoring/branches/modules/spring/src/main/java/org/apache/commons/monitoring/spring/config/RepositoryFactoryBean.java
Thu Apr  2 12:52:27 2009
@@ -1,7 +1,11 @@
 package org.apache.commons.monitoring.spring.config;
 
+import java.util.LinkedList;
+import java.util.List;
+
 import org.apache.commons.monitoring.Repository;
 import org.apache.commons.monitoring.repositories.DefaultRepository;
+import org.apache.commons.monitoring.repositories.RepositoryDecorator;
 import org.springframework.beans.factory.FactoryBean;
 import org.springframework.beans.factory.InitializingBean;
 
@@ -18,6 +22,8 @@
     /** The configured implementation class */
     private Class<? extends Repository> clazz = DefaultRepository.class;
 
+    private List<RepositoryDecorator> decorators = new LinkedList<RepositoryDecorator>();
+
     /**
      * {@inheritDoc}
      * 
@@ -65,7 +71,16 @@
     public void afterPropertiesSet()
         throws Exception
     {
-        this.repository = clazz.newInstance();
+        repository = clazz.newInstance();
+        for ( RepositoryDecorator decorator : decorators )
+        {
+            repository = decorator.decorate( repository );
+        }
+    }
+
+    public void setDecorators( List<RepositoryDecorator> decorators )
+    {
+        this.decorators.addAll( decorators );
     }
 
 }
\ No newline at end of file



Mime
View raw message