Author: snoopdave
Date: Wed Jun 20 21:55:30 2007
New Revision: 549367

URL: http://svn.apache.org/viewvc?view=rev&rev=549367
Log:
Tests passing, apps running. New install/bootstrap stuff now implemented in 
roller_guice branch. Got drawn into implementing probably more Planet 
bootstrapping than necessary to prove the concept.

Added:
    
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/InitializationException.java
Modified:
    
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/PlanetFactory.java
    
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/PlanetContext.java
    
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/Roller.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManager.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManagerImpl.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManager.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/RollerContext.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/filters/PersistenceSessionFilter.java
    
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
    roller/branches/roller_guice/tools/roller-core/roller-core.jar
    roller/branches/roller_guice/tools/roller-planet/roller-planet-business.jar

Added: 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/InitializationException.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/InitializationException.java?view=auto&rev=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/InitializationException.java
 (added)
+++ 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/InitializationException.java
 Wed Jun 20 21:55:30 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+
+package org.apache.roller.planet.business;
+
+import org.apache.roller.planet.PlanetException;
+
+
+/**
+ * Exception generated from Weblogger initialization process.
+ */
+public class InitializationException extends PlanetException {
+    
+    public InitializationException(String msg) {
+        super(msg);
+    }
+    
+    public InitializationException(String msg, Throwable t) {
+        super(msg, t);
+    }
+    
+}

Modified: 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/PlanetFactory.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/PlanetFactory.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/PlanetFactory.java
 (original)
+++ 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/business/PlanetFactory.java
 Wed Jun 20 21:55:30 2007
@@ -81,7 +81,7 @@
         return bootstrapped;
     }
     
-        /**
+    /**
      * Bootstrap the Roller Planet business tier.
      *
      * Bootstrapping the application effectively instantiates all the necessary
@@ -107,5 +107,44 @@
         bootstrapped = true;            
         
         log.info("Roller Planet business tier successfully bootstrapped");
+    }
+    
+    /**
+     * Initialize the Roller Planet business tier.
+     *
+     * Initialization is used to perform any logic that needs to happen only
+     * once after the application has been properly bootstrapped.
+     *
+     * @throws IllegalStateException If the app has not been bootstrapped yet.
+     * @throws InitializationException If there is an error during 
initialization.
+     */
+    public static final void initialize() throws InitializationException {
+        
+        // TODO: this initialization process should probably be controlled by
+        // a more generalized application lifecycle event framework
+        
+        if(!isBootstrapped()) {
+            throw new IllegalStateException("Cannot initialize until 
application has been properly bootstrapped");
+        }
+        
+        log.info("Initializing Roller Planet business tier");
+        
+        String urlStratClass = 
PlanetConfig.getProperty("urlstrategy.classname");
+        if(urlStratClass == null || urlStratClass.trim().length() < 1) {
+            throw new InitializationException("No URLStrategy configured!!!");
+        }
+        
+        URLStrategy urlStrategy;
+        try {
+            Class stratClass = Class.forName(urlStratClass);
+            urlStrategy = (URLStrategy) stratClass.newInstance();
+        } catch (Throwable ex) {
+            throw new InitializationException("Error instantiating URL 
strategy: " + urlStratClass);
+        }
+        
+        // plug it in
+        PlanetFactory.getPlanet().setURLStrategy(urlStrategy);
+        
+        log.info("Roller Weblogger business tier successfully initialized");
     }
 }

Modified: 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/PlanetContext.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/PlanetContext.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/PlanetContext.java
 (original)
+++ 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/PlanetContext.java
 Wed Jun 20 21:55:30 2007
@@ -24,11 +24,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.planet.PlanetException;
-import org.apache.roller.planet.business.FeedFetcher;
-import org.apache.roller.planet.business.Planet;
+import org.apache.roller.planet.business.BootstrapException;
 import org.apache.roller.planet.business.PlanetFactory;
-import org.apache.roller.planet.business.URLStrategy;
-import org.apache.roller.planet.config.PlanetConfig;
+import org.apache.roller.planet.business.startup.PlanetStartup;
+import org.apache.roller.planet.business.startup.StartupException;
 import org.springframework.web.context.ContextLoaderListener;
 
 
@@ -75,22 +74,35 @@
         // because listeners don't initialize in the order specified in
         // 2.3 containers
         super.contextInitialized(sce);
-        
+                
+        // Now prepare the core services of the app so we can bootstrap
         try {
-            // always upgrade database first
-            upgradeDatabaseIfNeeded();
-            
-            Planet planet = PlanetFactory.getPlanet();
-            
-            setupRuntimeProperties();
-            setupURLStrategy();
-            
-            planet.flush();
-            planet.release();
-            
-        } catch (Throwable t) {
-            log.fatal("Roller Planet initialization failed", t);
-            throw new RuntimeException(t);
+            PlanetStartup.prepare();
+        } catch (StartupException ex) {
+            log.fatal("Roller Planet startup failed during app preparation", 
ex);
+            return;
+        }        
+        
+        // if preparation failed or is incomplete then we are done,
+        // otherwise try to bootstrap the business tier
+        if (!PlanetStartup.isPrepared()) {
+            log.info("Roller Planet startup requires interaction from user to 
continue");
+        } else {
+            try {
+                // trigger bootstrapping process
+                PlanetFactory.bootstrap();
+                
+                // trigger initialization process
+                PlanetFactory.initialize();
+                
+                // flush any changes made during initialization
+                PlanetFactory.getPlanet().flush();
+                
+            } catch (BootstrapException ex) {
+                log.fatal("Roller PlanetFactory bootstrap failed", ex);
+            } catch (PlanetException ex) {
+                log.fatal("Roller PlanetFactory initialization failed", ex);
+            }
         }
         
         log.info("Roller Planet Initialization Complete");
@@ -103,44 +115,4 @@
     public void contextDestroyed(ServletContextEvent sce) {
         PlanetFactory.getPlanet().shutdown();
     }
-    
-    
-    private void setupRuntimeProperties() {
-        // init property manager by loading it
-        PlanetFactory.getPlanet().getPropertiesManager();
-    }
-    
-    
-    /**
-     * Lookup configured URLStrategy from config and plug it in.
-     *
-     * If no URLStrategy can be configured then we bail and spew errors.
-     */
-    private void setupURLStrategy() throws Exception {
-        
-        String urlStratClass = 
PlanetConfig.getProperty("urlstrategy.classname");
-        if(urlStratClass == null || urlStratClass.trim().length() < 1) {
-            throw new Exception("No URLStrategy configured!!!");
-        }
-        
-        Class stratClass = Class.forName(urlStratClass);
-        URLStrategy urlStrategy = (URLStrategy) stratClass.newInstance();
-        
-        // plug it in
-        PlanetFactory.getPlanet().setURLStrategy(urlStrategy);
-    }        
-    
-    private void upgradeDatabaseIfNeeded() throws PlanetException {
-        
-//        try {
-//            Connection con = // get connection somehow
-//            UpgradeDatabase.upgradeDatabase(con, 
RollerFactory.getRoller().getVersion());
-//            con.close();
-//        } catch (NamingException e) {
-//            log.warn("Unable to access DataSource", e);
-//        } catch (SQLException e) {
-//            log.warn(e);
-//        }
-    }
-
 }

Modified: 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java
 (original)
+++ 
roller/branches/roller_guice/apps/planet/src/java/org/apache/roller/planet/ui/core/filters/PersistenceSessionFilter.java
 Wed Jun 20 21:55:30 2007
@@ -58,7 +58,9 @@
             chain.doFilter(request, response);
         } finally {
             log.debug("Releasing Planet Session");
-            planet.release();
+            if (PlanetFactory.isBootstrapped()) {
+                PlanetFactory.getPlanet().release();
+            }
         }
         
         log.debug("Exiting PersistenceSessionFilter");

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/Roller.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/Roller.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/Roller.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/Roller.java
 Wed Jun 20 21:55:30 2007
@@ -18,8 +18,10 @@
 
 package org.apache.roller.weblogger.business;
 
-import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.plugins.PluginManager;
+import java.io.Serializable;
+import java.sql.Connection;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.pings.AutoPingManager;
 import org.apache.roller.weblogger.business.pings.PingQueueManager;
 import org.apache.roller.weblogger.business.pings.PingTargetManager;
@@ -133,16 +135,9 @@
     
     
     /**
-     * Initialize any resources necessary for this instance of Roller.
-     */
-    public void initialize() throws InitializationException;
-    
-    
-    /**
      * Release all resources necessary for this instance of Roller.
      */
     public void shutdown();
-    
     
     /** Roller version */
     public String getVersion();    

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
 Wed Jun 20 21:55:30 2007
@@ -18,13 +18,13 @@
 
 package org.apache.roller.weblogger.business;
 
-import com.google.inject.Binder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.business.startup.WebloggerStartup;
+import org.apache.roller.weblogger.config.PingConfig;
 import org.apache.roller.weblogger.config.RollerConfig;
 
 
@@ -35,6 +35,9 @@
     
     private static final Log log = LogFactory.getLog(RollerFactory.class);
     
+    // have we been bootstrapped yet?
+    private static boolean bootstrapped = false;
+    
     // a reference to the bootstrapped Roller instance
     private static Roller rollerInstance = null;
     
@@ -64,7 +67,7 @@
      * True if bootstrap process was completed, False otherwise.
      */
     public static boolean isBootstrapped() {
-        return (rollerInstance != null);
+        return bootstrapped;
     }
     
     
@@ -75,9 +78,10 @@
      * @throws IllegalStateException If the app has not been properly 
bootstrapped yet.
      */
     public static final Roller getRoller() {
-        if(rollerInstance == null) {
+        if (rollerInstance == null) {
             throw new IllegalStateException("Roller Weblogger has not been 
bootstrapped yet");
-        }        
+        }
+        
         return rollerInstance;
     }
     
@@ -109,11 +113,71 @@
         }
         
         log.info("Bootstrapping Roller Weblogger business tier");
-            
-        // do the invocation
+        
         rollerInstance = injector.getInstance(Roller.class);
-                   
+            
+        // note that we've now been bootstrapped
+        bootstrapped = true;
+            
         log.info("Roller Weblogger business tier successfully bootstrapped");
     }
+    
+    
+    /**
+     * Initialize the Roller Weblogger business tier.
+     *
+     * Initialization is used to perform any logic that needs to happen only
+     * once after the application has been properly bootstrapped.
+     *
+     * @throws IllegalStateException If the app has not been bootstrapped yet.
+     * @throws InitializationException If there is an error during 
initialization.
+     */
+    public static final void initialize() throws InitializationException {
+        
+        // TODO: this initialization process should probably be controlled by
+        // a more generalized application lifecycle event framework
+        
+        if(!isBootstrapped()) {
+            throw new IllegalStateException("Cannot initialize until 
application has been properly bootstrapped");
+        }
+        
+        log.info("Initializing Roller Weblogger business tier");
+        
+        try {
+            
+            Roller roller = getRoller();
+            
+            // Now that Roller has been bootstrapped, initialize individual 
managers
+            roller.getPropertiesManager().initialize();
+            roller.getIndexManager().initialize();
+            roller.getThemeManager().initialize();
+            
+            // And this will schedule all configured tasks
+            roller.getThreadManager().startTasks();
+            
+            // Initialize ping systems
 
+            // Initialize common targets from the configuration
+            PingConfig.initializeCommonTargets();
+            
+            // Initialize ping variants
+            PingConfig.initializePingVariants();
+            
+            // Remove custom ping targets if they have been disallowed
+            if (PingConfig.getDisallowCustomTargets()) {
+                log.info("Custom ping targets have been disallowed.  Removing 
any existing custom targets.");
+                
RollerFactory.getRoller().getPingTargetManager().removeAllCustomPingTargets();
+            }
+            
+            // Remove all autoping configurations if ping usage has been 
disabled.
+            if (PingConfig.getDisablePingUsage()) {
+                log.info("Ping usage has been disabled.  Removing any existing 
auto ping configurations.");
+                
RollerFactory.getRoller().getAutopingManager().removeAllAutoPings();
+            }
+        } catch (Throwable t) {
+            throw new InitializationException("Error initializing ping 
systems", t);
+        }
+        
+        log.info("Roller Weblogger business tier successfully initialized");
+    }
 }

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
 Wed Jun 20 21:55:30 2007
@@ -239,56 +239,7 @@
         }
     }
     
-    
-    /**
-     * @inheritDoc
-     */
-    public void initialize() throws InitializationException {
-        
-        mLogger.info("Initializing Roller Weblogger business tier");
-        
-        // TODO: this should probably be done in a more uniform fashion, 
possibly
-        // using annotations?  biggest issue is controlling ordering
-        getPropertiesManager().initialize();
-        getThemeManager().initialize();
-        getThreadManager().initialize();
-        getIndexManager().initialize();
-        
-        try {
-            // Initialize ping systems
-            // TODO: this should probably be moving inside ping manager 
initialize() methods?
-            
-            // Initialize common targets from the configuration
-            PingConfig.initializeCommonTargets();
-            
-            // Initialize ping variants
-            PingConfig.initializePingVariants();
-            
-            // Remove custom ping targets if they have been disallowed
-            if (PingConfig.getDisallowCustomTargets()) {
-                mLogger.info("Custom ping targets have been disallowed.  
Removing any existing custom targets.");
-                
RollerFactory.getRoller().getPingTargetManager().removeAllCustomPingTargets();
-            }
-            
-            // Remove all autoping configurations if ping usage has been 
disabled.
-            if (PingConfig.getDisablePingUsage()) {
-                mLogger.info("Ping usage has been disabled.  Removing any 
existing auto ping configurations.");
-                
RollerFactory.getRoller().getAutopingManager().removeAllAutoPings();
-            }
-        } catch (Throwable t) {
-            throw new InitializationException("Error initializing ping 
systems", t);
-        }
-        
-        // we always need to do a flush after initialization because it's
-        // possible that some changes need to be persisted
-        try {
-            flush();
-        } catch(WebloggerException ex) {
-            throw new InitializationException("Error flushing after 
initialization", ex);
-        }
-        
-        mLogger.info("Roller Weblogger business tier successfully 
initialized");
-    }
+
     
     
     public void shutdown() {

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManager.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManager.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManager.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManager.java
 Wed Jun 20 21:55:30 2007
@@ -19,7 +19,6 @@
 package org.apache.roller.weblogger.business.runnable;
 
 import java.util.Date;
-import org.apache.roller.weblogger.business.InitializationException;
 
 
 /**
@@ -31,11 +30,9 @@
     
     
     /**
-     * Initialize the thread management system.
-     *
-     * @throws InitializationException If there is a problem during 
initialization.
+     * Schedule execution of all configured tasks.
      */
-    public void initialize() throws InitializationException;
+    public void startTasks();
     
     
     /**

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManagerImpl.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManagerImpl.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManagerImpl.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/runnable/ThreadManagerImpl.java
 Wed Jun 20 21:55:30 2007
@@ -19,6 +19,7 @@
 package org.apache.roller.weblogger.business.runnable;
 
 import java.util.Date;
+import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
@@ -27,7 +28,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
-import org.apache.roller.weblogger.business.InitializationException;
 import org.apache.roller.weblogger.config.RollerConfig;
 
 
@@ -50,8 +50,7 @@
         serviceScheduler = Executors.newScheduledThreadPool(10);
     }
     
-    
-    public void initialize() throws InitializationException {
+    public void startTasks() {
         
         Date now = new Date();
         
@@ -85,10 +84,8 @@
                     log.error("Error instantiating task", ex);
                 }
             }
-        }
-        
+        }        
     }
-    
     
     public void executeInBackground(Runnable runnable)
             throws InterruptedException {

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManager.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManager.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManager.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManager.java
 Wed Jun 20 21:55:30 2007
@@ -46,10 +46,7 @@
     
     /** Execute operation immediately */
     public abstract void executeIndexOperationNow(final IndexOperation op);
-    
-    /** Init index manager by checking and rebuilding index */
-    public void bootstrap();
-    
+
     /**
      * Release all resources associated with Roller session.
      */

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
 Wed Jun 20 21:55:30 2007
@@ -96,11 +96,7 @@
     @com.google.inject.Inject
     public IndexManagerImpl(Roller roller) {
         this.roller = roller;
-    }
-        
-    public void bootstrap() {
-        
-        
+
         // check config to see if the internal search is enabled
         String enabled = RollerConfig.getProperty("search.enabled");
         if("false".equalsIgnoreCase(enabled))

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/RollerContext.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/RollerContext.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/RollerContext.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/RollerContext.java
 Wed Jun 20 21:55:30 2007
@@ -37,8 +37,8 @@
 import org.apache.roller.weblogger.business.startup.StartupException;
 import org.apache.roller.weblogger.config.RollerConfig;
 import org.apache.roller.weblogger.business.RollerFactory;
-import org.apache.roller.planet.business.Planet;
 import org.apache.roller.planet.business.PlanetFactory;
+import org.apache.roller.planet.business.startup.PlanetStartup;
 import org.apache.roller.weblogger.business.startup.WebloggerStartup;
 import org.apache.roller.weblogger.ui.core.plugins.UIPluginManager;
 import org.apache.roller.weblogger.ui.core.plugins.UIPluginManagerImpl;
@@ -110,7 +110,7 @@
         
         
         // Now prepare the core services of the app so we can bootstrap
-        try {        
+        try {
             WebloggerStartup.prepare();
         } catch (StartupException ex) {
             log.fatal("Roller Weblogger startup failed during app 
preparation", ex);
@@ -128,7 +128,10 @@
                 RollerFactory.bootstrap();
                 
                 // trigger initialization process
-                RollerFactory.getRoller().initialize();
+                RollerFactory.initialize();
+                
+                // flush any changes made during initialization
+                RollerFactory.getRoller().flush();
                 
             } catch (BootstrapException ex) {
                 log.fatal("Roller Weblogger bootstrap failed", ex);
@@ -139,11 +142,21 @@
             // Initialize Planet if necessary
             if (RollerFactory.isBootstrapped()) {
                 if 
(RollerConfig.getBooleanProperty("planet.aggregator.enabled")) {
+                    
+                    // Now prepare the core services of planet so we can 
bootstrap it
+                    try {
+                        PlanetStartup.prepare();
+                    } catch (Throwable ex) {
+                        log.fatal("Roller Planet startup failed during app 
preparation", ex);
+                        return;
+                    }
+        
                     try {
-                        Planet planet = PlanetFactory.getPlanet();
-                        PlanetFactory.getPlanet().getPropertiesManager();
-                        planet.flush();
-                        planet.release();
+                        // trigger planet bootstrapping process
+                        PlanetFactory.bootstrap();
+
+                        // flush any changes made during initialization
+                        PlanetFactory.getPlanet().flush();
                         
                     } catch (Throwable t) {
                         log.fatal("Roller Planet initialization failed", t);

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/filters/PersistenceSessionFilter.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/filters/PersistenceSessionFilter.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/filters/PersistenceSessionFilter.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/filters/PersistenceSessionFilter.java
 Wed Jun 20 21:55:30 2007
@@ -65,9 +65,7 @@
                 
                 // if planet is enabled then release planet backend as well
                 if 
(RollerConfig.getBooleanProperty("planet.aggregator.enabled")) {
-                    // TODO: once planet uses same lifecycle options as 
weblogger
-                    // then this should be updated to 
if(PlanetFactory.isBootstrapped())
-                    if (PlanetFactory.getPlanet() != null) {
+                    if (PlanetFactory.isBootstrapped()) {
                         PlanetFactory.getPlanet().release();
                     }
                 }

Modified: 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
--- 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
 (original)
+++ 
roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/core/Install.java
 Wed Jun 20 21:55:30 2007
@@ -126,7 +126,10 @@
             RollerFactory.bootstrap();
             
             // trigger initialization process
-            RollerFactory.getRoller().initialize();
+            RollerFactory.initialize();
+            
+            // flush any changes made during initialization
+            RollerFactory.getRoller().flush();
             
             return SUCCESS;
             

Modified: roller/branches/roller_guice/tools/roller-core/roller-core.jar
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/tools/roller-core/roller-core.jar?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
Binary files - no diff available.

Modified: 
roller/branches/roller_guice/tools/roller-planet/roller-planet-business.jar
URL: 
http://svn.apache.org/viewvc/roller/branches/roller_guice/tools/roller-planet/roller-planet-business.jar?view=diff&rev=549367&r1=549366&r2=549367
==============================================================================
Binary files - no diff available.


Reply via email to