You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ca...@apache.org on 2008/04/24 00:17:09 UTC

svn commit: r651089 - /continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java

Author: carlos
Date: Wed Apr 23 15:16:55 2008
New Revision: 651089

URL: http://svn.apache.org/viewvc?rev=651089&view=rev
Log:
Encapsulate the store

Modified:
    continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java

Modified: continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=651089&r1=651088&r2=651089&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java (original)
+++ continuum/trunk/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java Wed Apr 23 15:16:55 2008
@@ -68,6 +68,15 @@
     // ----------------------------------------------------------------------
 
 
+    public void setStore( ContinuumStore store )
+    {
+        this.store = store;
+    }
+
+    public ContinuumStore getStore()
+    {
+        return store;
+    }
 
     public File getApplicationHome()
     {
@@ -264,13 +273,13 @@
     {
         try
         {
-            systemConf = store.getSystemConfiguration();
+            systemConf = getStore().getSystemConfiguration();
 
             if ( systemConf == null )
             {
                 systemConf = new SystemConfiguration();
 
-                systemConf = store.addSystemConfiguration( systemConf );
+                systemConf = getStore().addSystemConfiguration( systemConf );
             }
 
             loaded = true;
@@ -286,7 +295,7 @@
     {
         try
         {
-            store.updateSystemConfiguration( systemConf );
+            getStore().updateSystemConfiguration( systemConf );
         }
         catch ( ContinuumStoreException e )
         {
@@ -298,13 +307,13 @@
         throws ContinuumStoreException, ConfigurationLoadingException
     {
         // Schedule
-        Schedule defaultSchedule = store.getScheduleByName( DEFAULT_SCHEDULE_NAME );
+        Schedule defaultSchedule = getStore().getScheduleByName( DEFAULT_SCHEDULE_NAME );
 
         if ( defaultSchedule == null )
         {
             defaultSchedule = createDefaultSchedule();
 
-            defaultSchedule = store.addSchedule( defaultSchedule );
+            defaultSchedule = getStore().addSchedule( defaultSchedule );
         }
 
         return defaultSchedule;
@@ -336,6 +345,6 @@
         schedule.setActive( true );
 
         return schedule;
-    }    
+    }
 
 }