You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by in...@apache.org on 2009/06/11 09:31:36 UTC

svn commit: r783660 - /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/datasource/factory/DataSourceInformationRepositoryFactory.java

Author: indika
Date: Thu Jun 11 07:31:35 2009
New Revision: 783660

URL: http://svn.apache.org/viewvc?rev=783660&view=rev
Log:
allow configuration of DataSourceInformationRepository through empty properties 

Modified:
    synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/datasource/factory/DataSourceInformationRepositoryFactory.java

Modified: synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/datasource/factory/DataSourceInformationRepositoryFactory.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/datasource/factory/DataSourceInformationRepositoryFactory.java?rev=783660&r1=783659&r2=783660&view=diff
==============================================================================
--- synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/datasource/factory/DataSourceInformationRepositoryFactory.java (original)
+++ synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/datasource/factory/DataSourceInformationRepositoryFactory.java Thu Jun 11 07:31:35 2009
@@ -31,7 +31,7 @@
 public class DataSourceInformationRepositoryFactory {
 
     private static final Log log = LogFactory.getLog(DataSourceInformationRepositoryFactory.class);
-    
+
     /**
      * Factory method to create a DataSourceInformationRepository
      * Use 'DataSourceRepositoryManager' as RepositoryListener
@@ -43,8 +43,8 @@
             Properties properties) {
         return createDataSourceInformationRepository(
                 new DataSourceRepositoryManager(
-                    new InMemoryDataSourceRepository(),
-                    new JNDIBasedDataSourceRepository()), properties);
+                        new InMemoryDataSourceRepository(),
+                        new JNDIBasedDataSourceRepository()), properties);
     }
 
     /**
@@ -61,36 +61,36 @@
         if (log.isDebugEnabled()) {
             log.debug("Creating a new DataSourceInformationRepository");
         }
-        DataSourceInformationRepository datasourceInformationRepository = 
-            new DataSourceInformationRepository();
-        
+        DataSourceInformationRepository datasourceInformationRepository =
+                new DataSourceInformationRepository();
+
         datasourceInformationRepository.setRepositoryListener(listener);
         setupDatasourceInformationRepository(datasourceInformationRepository, properties);
-        
+
         return datasourceInformationRepository;
     }
-    
+
      /**
-     * Setup an existing datasource inforamtion repository adding the provided 
+     * Setup an existing datasource inforamtion repository adding the provided
      * datasource information.
      *
      * @param datasourceInformationRepository an existing data source information repository
      * @param properties DataSource properties
      */
     public static void setupDatasourceInformationRepository(
-            DataSourceInformationRepository datasourceInformationRepository,
-            Properties properties) {
-        
-        if (properties != null && !properties.isEmpty()) {
-            datasourceInformationRepository.setConfigurationProperties(properties);
-        }
-        List<DataSourceInformation> sourceInformationList =
-            DataSourceInformationListFactory.createDataSourceInformationList(properties);
-        
-        for (DataSourceInformation information : sourceInformationList) {
-            if (information != null) {
-                datasourceInformationRepository.addDataSourceInformation(information);
-            }
-        }
-    }
+             DataSourceInformationRepository datasourceInformationRepository,
+             Properties properties) {
+
+         if (properties != null) {
+             datasourceInformationRepository.setConfigurationProperties(properties);
+         }
+         List<DataSourceInformation> sourceInformationList =
+                 DataSourceInformationListFactory.createDataSourceInformationList(properties);
+
+         for (DataSourceInformation information : sourceInformationList) {
+             if (information != null) {
+                 datasourceInformationRepository.addDataSourceInformation(information);
+             }
+         }
+     }
 }