roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r550853 - in /roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business: ./ hibernate/ jpa/ referrers/ search/ themes/
Date Tue, 26 Jun 2007 16:50:33 GMT
Author: agilliland
Date: Tue Jun 26 09:50:30 2007
New Revision: 550853

URL: http://svn.apache.org/viewvc?view=rev&rev=550853
Log:
lets be anal about the immutability of our business tier classes.


Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateAutoPingManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateBookmarkManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerFactory.java
Tue Jun 26 09:50:30 2007
@@ -24,20 +24,16 @@
 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;
 
 
 /**
- * Provides access to the Roller instance.
+ * Provides access to the Roller instance and bootstraps the business tier.
  */
 public final class RollerFactory {
     
     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,10 +60,10 @@
     
     
     /**
-     * True if bootstrap process was completed, False otherwise.
+     * True if bootstrap process has been completed, False otherwise.
      */
     public static boolean isBootstrapped() {
-        return bootstrapped;
+        return (rollerInstance != null);
     }
     
     
@@ -115,9 +111,7 @@
         
         rollerInstance = injector.getInstance(Roller.class);
             
-        // note that we've now been bootstrapped
-        bootstrapped = true;
-            
         log.info("Roller Weblogger business tier successfully bootstrapped");
-    }    
+    }
+    
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/RollerImpl.java
Tue Jun 26 09:50:30 2007
@@ -36,6 +36,7 @@
 import org.apache.roller.weblogger.business.themes.ThemeManager;
 import org.apache.roller.weblogger.config.PingConfig;
 
+
 /**
  * The abstract version of the Roller implementation.
  *
@@ -44,26 +45,30 @@
  */
 @com.google.inject.Singleton
 public abstract class RollerImpl implements Roller {
-    private static Log mLogger = LogFactory.getLog(RollerImpl.class);
     
-    private AutoPingManager      autoPingManager = null;
-    private BookmarkManager      bookmarkManager = null;
-    private FileManager          fileManager = null;
-    private IndexManager         indexManager = null;
-    private PingQueueManager     pingQueueManager = null;
-    private PingTargetManager    pingTargetManager = null;
-    private PluginManager        pluginManager = null;
-    private PropertiesManager    propertiesManager = null;
-    private RefererManager       refererManager = null;
-    private ReferrerQueueManager refererQueueManager = null;
-    private ThemeManager         themeManager = null;
-    private ThreadManager        threadManager = null;
-    private UserManager          userManager = null;
-    private WeblogManager        weblogManager = null;
-            
-    private String version = null;
-    private String buildTime = null;
-    private String buildUser = null;
+    private static Log log = LogFactory.getLog(RollerImpl.class);
+    
+    // managers
+    private final AutoPingManager      autoPingManager;
+    private final BookmarkManager      bookmarkManager;
+    private final FileManager          fileManager;
+    private final IndexManager         indexManager;
+    private final PingQueueManager     pingQueueManager;
+    private final PingTargetManager    pingTargetManager;
+    private final PluginManager        pluginManager;
+    private final PropertiesManager    propertiesManager;
+    private final RefererManager       refererManager;
+    private final ReferrerQueueManager refererQueueManager;
+    private final ThemeManager         themeManager;
+    private final ThreadManager        threadManager;
+    private final UserManager          userManager;
+    private final WeblogManager        weblogManager;
+    
+    // some simple attributes
+    private final String version;
+    private final String buildTime;
+    private final String buildUser;
+    
     
     protected RollerImpl(
         AutoPingManager      autoPingManager,
@@ -100,7 +105,7 @@
         try {
             props.load(getClass().getResourceAsStream("/version.properties"));
         } catch (IOException e) {
-            mLogger.error("version.properties not found", e);
+            log.error("version.properties not found", e);
         }
         
         version = props.getProperty("ro.version", "UNKNOWN");
@@ -222,6 +227,9 @@
     }
     
     
+    /**
+     * @inheritDoc
+     */
     public void release() {
         try {
             autoPingManager.release();
@@ -235,20 +243,17 @@
             userManager.release();
             weblogManager.release();
         } catch(Throwable e) {
-            mLogger.error("Error calling Roller.release()", e);
+            log.error("Error calling Roller.release()", e);
         }
     }
     
-
-    
-    
     
     /**
      * @inheritDoc
      */
     public void initialize() throws InitializationException {
         
-        mLogger.info("Initializing Roller Weblogger business tier");
+        log.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
@@ -269,13 +274,13 @@
             
             // 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.");
+                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()) {
-                mLogger.info("Ping usage has been disabled.  Removing any existing auto ping
configurations.");
+                log.info("Ping usage has been disabled.  Removing any existing auto ping
configurations.");
                 RollerFactory.getRoller().getAutopingManager().removeAllAutoPings();
             }
         } catch (Throwable t) {
@@ -290,10 +295,13 @@
             throw new InitializationException("Error flushing after initialization", ex);
         } 
         
-        mLogger.info("Roller Weblogger business tier successfully initialized");
+        log.info("Roller Weblogger business tier successfully initialized");
     }
     
     
+    /**
+     * @inheritDoc
+     */
     public void shutdown() {
         try {
             HitCountQueue.getInstance().shutdown();
@@ -301,9 +309,10 @@
             if (indexManager != null) indexManager.shutdown();
             if (threadManager != null) threadManager.shutdown();
         } catch(Throwable e) {
-            mLogger.error("Error calling Roller.shutdown()", e);
+            log.error("Error calling Roller.shutdown()", e);
         }
     }
+    
     
     /** Roller version */
     public String getVersion() {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateAutoPingManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateAutoPingManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateAutoPingManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateAutoPingManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -48,16 +48,18 @@
 @com.google.inject.Singleton
 public class HibernateAutoPingManagerImpl implements AutoPingManager {
     
-    private Roller roller;
-    
     static final long serialVersionUID = 5420615676256979199L;
     
     private static Log log = LogFactory.getLog(HibernateAutoPingManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
+    
     
     @com.google.inject.Inject    
     protected HibernateAutoPingManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
+        
+        log.debug("Instantiating Hibernate Auto Ping Manager");
         this.roller = roller;
         this.strategy = strat;
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateBookmarkManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateBookmarkManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateBookmarkManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateBookmarkManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -48,8 +48,8 @@
     
     private static Log log = LogFactory.getLog(HibernateBookmarkManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     
     /**
@@ -58,9 +58,10 @@
      */
     @com.google.inject.Inject    
     protected HibernateBookmarkManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
+        
+        log.debug("Instantiating Hibernate Bookmark Manager");
         this.roller = roller;
         this.strategy = strat;
-        log.debug("Instantiating Hibernate Bookmark Manager");
     }
     
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -31,6 +31,7 @@
 import org.apache.roller.weblogger.pojos.PingQueueEntry;
 import java.sql.Timestamp;
 import java.util.List;
+import org.apache.roller.weblogger.business.Roller;
 import org.apache.roller.weblogger.business.pings.PingQueueManager;
 
 
@@ -46,11 +47,15 @@
     
     private static Log log = LogFactory.getLog(HibernatePingQueueManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     
     @com.google.inject.Inject    
-    protected HibernatePingQueueManagerImpl(HibernatePersistenceStrategy strat) {
+    protected HibernatePingQueueManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
+        
+        log.debug("Instantiating Hibernate Ping Queue Manager");
+        this.roller = roller;
         this.strategy = strat;
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -54,12 +54,14 @@
     
     private static Log log = LogFactory.getLog(HibernatePingTargetManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     
     @com.google.inject.Inject    
     protected HibernatePingTargetManagerImpl(Roller roller, HibernatePersistenceStrategy
strat) {
+        
+        log.debug("Instantiating Hibernate Ping Target Manager");
         this.roller = roller;
         this.strategy = strat;
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -49,8 +49,8 @@
     
     private static Log log = LogFactory.getLog(HibernatePropertiesManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     
     /** 

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -67,8 +67,8 @@
     protected static final String DAYHITS = "dayHits";
     protected static final String TOTALHITS = "totalHits";
     
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
 
     private Date mRefDate = new Date();
     
@@ -77,10 +77,10 @@
     protected HibernateRefererManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
         
         log.debug("Instantiating Hibernate Referer Manager");
-        
         this.strategy = strat;
         this.roller = roller;
     }
+    
     
     public void saveReferer(WeblogReferrer referer) throws WebloggerException {
         strategy.store(referer);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java
Tue Jun 26 09:50:30 2007
@@ -18,8 +18,6 @@
 
 package org.apache.roller.weblogger.business.hibernate;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.RollerImpl;
 import org.apache.roller.weblogger.business.BookmarkManager;
@@ -42,11 +40,11 @@
  * A Hibernate specific implementation of the Roller business layer.
  */
 @com.google.inject.Singleton
-public class HibernateRollerImpl extends RollerImpl {    
-    private static Log mLogger = LogFactory.getLog(HibernateRollerImpl.class);    
+public class HibernateRollerImpl extends RollerImpl {
     
     // a persistence utility class
-    private HibernatePersistenceStrategy strategy = null;
+    private final HibernatePersistenceStrategy strategy;
+    
     
     @com.google.inject.Inject
     protected HibernateRollerImpl(
@@ -80,12 +78,35 @@
             themeManager,
             threadManager,
             userManager,
-            weblogManager); 
+            weblogManager);
+        
         this.strategy = strategy;
     }
-        
+    
+    
     public void flush() throws WebloggerException {
         this.strategy.flush();
-    }    
+    }
+    
+    
+    public void release() {
+        
+        // tell Hibernate to close down
+        this.strategy.release();
+        
+        // then let parent do its thing
+        super.release();
+    }
+    
+    
+    public void shutdown() {
+        
+        // do our own shutdown first
+        this.release();
+        
+        // then let parent do its thing
+        super.shutdown();
+    }
+    
 }
 

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -44,16 +44,16 @@
     
     private static Log log = LogFactory.getLog(HibernateThreadManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     
     @com.google.inject.Inject    
-    protected HibernateThreadManagerImpl(HibernatePersistenceStrategy strat) {
+    protected HibernateThreadManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
         super();
         
         log.debug("Instantiating Hibernate Thread Manager");
-        this.roller = roller;        
+        this.roller = roller;
         this.strategy = strat;
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -69,10 +69,12 @@
 @com.google.inject.Singleton
 public class HibernateUserManagerImpl implements UserManager {
     
-    static final long serialVersionUID = -5128460637997081121L;    
-    private static Log log = LogFactory.getLog(HibernateUserManagerImpl.class);    
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    static final long serialVersionUID = -5128460637997081121L;
+    
+    private static Log log = LogFactory.getLog(HibernateUserManagerImpl.class);
+    
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     // cached mapping of weblogHandles -> weblogIds
     private Map weblogHandleToIdMap = new Hashtable();
@@ -80,12 +82,15 @@
     // cached mapping of userNames -> userIds
     private Map userNameToIdMap = new Hashtable();
    
+    
     @com.google.inject.Inject
     protected HibernateUserManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
+        
         log.debug("Instantiating Hibernate User Manager");
         this.roller = roller;       
         this.strategy = strat;
     }
+    
     
     /**
      * Update existing website.

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -62,6 +62,7 @@
 import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Restrictions;
 
+
 /**
  * Hibernate implementation of the WeblogManager.
  */
@@ -72,8 +73,8 @@
     
     private static Log log = LogFactory.getLog(HibernateWeblogManagerImpl.class);
     
-    private HibernatePersistenceStrategy strategy = null;
-    private Roller roller;
+    private final Roller roller;
+    private final HibernatePersistenceStrategy strategy;
     
     // cached mapping of entryAnchors -> entryIds
     private Hashtable entryAnchorToIdMap = new Hashtable();
@@ -83,8 +84,10 @@
     
     private Comparator tagStatComparator = new TagStatComparator();
     
+    
     @com.google.inject.Inject    
     protected HibernateWeblogManagerImpl(Roller roller, HibernatePersistenceStrategy strat)
{
+        
         log.debug("Instantiating Hibernate Weblog Manager");
         this.roller = roller;        
         this.strategy = strat;

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -46,14 +46,16 @@
 @com.google.inject.Singleton
 public class JPAAutoPingManagerImpl implements AutoPingManager {
 
-    private JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
+    
     
     /**
      * The logger instance for this class.
      */
     private static Log logger = 
         LogFactory.getFactory().getInstance(JPAAutoPingManagerImpl.class);
+    
 
     /**
      * Creates a new instance of JPAAutoPingManagerImpl
@@ -63,6 +65,7 @@
         this.roller = roller;
         this.strategy = strategy;
     }
+    
 
     public AutoPing getAutoPing(String id) throws WebloggerException {
         return (AutoPing)strategy.load(AutoPing.class, id);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -46,8 +46,9 @@
 @com.google.inject.Singleton
 public class JPABookmarkManagerImpl implements BookmarkManager {
     
-    private JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
+    
     
     /**
      * The logger instance for this class.
@@ -65,6 +66,7 @@
         this.strategy = strategy;
     }
 
+   
     public void saveBookmark(WeblogBookmark bookmark) throws WebloggerException {
         boolean exists = getBookmark(bookmark.getId()) != null;        
         if (!exists) {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
Tue Jun 26 09:50:30 2007
@@ -44,6 +44,7 @@
  */
 @com.google.inject.Singleton
 public class JPAPersistenceStrategy {
+    
     private static Log logger = 
         LogFactory.getFactory().getInstance(JPAPersistenceStrategy.class);
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingQueueManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -46,8 +46,9 @@
         JPAPingQueueManagerImpl.class);
 
     /** The strategy for this manager. */
-    private JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
+    
 
     /**
      * Creates a new instance of JPAPingQueueManagerImpl
@@ -58,6 +59,7 @@
         this.strategy =  strategy;
     }
 
+    
     public PingQueueEntry getQueueEntry(String id) 
             throws WebloggerException {
         return (PingQueueEntry)strategy.load(

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPingTargetManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -50,8 +50,9 @@
     private static Log log = LogFactory.getLog(
         JPAPingTargetManagerImpl.class);
 
-    private JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
+    
     
     @com.google.inject.Inject
     protected JPAPingTargetManagerImpl(Roller roller, JPAPersistenceStrategy strategy) {
@@ -59,6 +60,7 @@
         this.strategy = strategy;
     }
 
+    
     public void removePingTarget(PingTarget pingTarget) 
             throws WebloggerException {
         // remove contents and then target

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAPropertiesManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -52,8 +52,9 @@
     private static Log log = LogFactory.getLog(
         JPAPropertiesManagerImpl.class);
 
-    private JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
+    
     
     /**
      * Creates a new instance of JPAPropertiesManagerImpl

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -63,8 +63,9 @@
             Collections.reverseOrder(StatCountCountComparator.getInstance());
     
     /** The strategy for this manager. */
-    protected JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
+    
 
     /**
      * Creates a new instance of JPARefererManagerImpl
@@ -76,6 +77,7 @@
         this.strategy = strategy;
     }
 
+    
     public void saveReferer(WeblogReferrer referer) throws WebloggerException {
         strategy.store(referer);
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java
Tue Jun 26 09:50:30 2007
@@ -45,25 +45,11 @@
 
     static final long serialVersionUID = 5256135928578074652L;
 
-    protected static Log logger = LogFactory.getLog(JPARollerImpl.class);
-
-    // our singleton instance
-    private static JPARollerImpl me = null;
+    private static Log logger = LogFactory.getLog(JPARollerImpl.class);
 
     // a persistence utility class
-    protected JPAPersistenceStrategy strategy = null;
-    private Roller roller = null;
-
-    // references to the managers we maintain
-    private BookmarkManager bookmarkManager = null;
-    private PropertiesManager propertiesManager = null;
-    private RefererManager referrerManager = null;
-    private UserManager userManager = null;
-    private WeblogManager weblogManager = null;
-    private PingQueueManager pingQueueManager = null;
-    private AutoPingManager autoPingManager = null;
-    private PingTargetManager pingTargetManager = null;
-    private ThreadManager threadManager = null;    
+    private final JPAPersistenceStrategy strategy;
+    
     
     /**
      * Single constructor.
@@ -101,14 +87,12 @@
             themeManager,
             threadManager,
             userManager,
-            weblogManager); 
-        this.strategy = strategy;
-    }
+            weblogManager);
         
-    public void initialize() {
-        // no-op
+        this.strategy = strategy;
     }
     
+    
     public void flush() throws WebloggerException {
         this.strategy.flush();
     }
@@ -127,5 +111,6 @@
 
         // then let parent do its thing
         super.shutdown();
-    }    
+    }
+    
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -43,8 +43,8 @@
 
     private static final Log log = LogFactory.getLog(JPAThreadManagerImpl.class);
 
+    private final Roller roller;
     private final JPAPersistenceStrategy strategy;
-    private Roller roller = null;
 
 
     @com.google.inject.Inject

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -61,14 +61,15 @@
     private static final Comparator statCountCountReverseComparator =
             Collections.reverseOrder(StatCountCountComparator.getInstance());
     
-    protected JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
     
     // cached mapping of weblogHandles -> weblogIds
     private Map weblogHandleToIdMap = new Hashtable();
     
     // cached mapping of userNames -> userIds
     private Map userNameToIdMap = new Hashtable();
+    
     
     @com.google.inject.Inject
     protected JPAUserManagerImpl(Roller roller, JPAPersistenceStrategy strat) {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -71,8 +71,8 @@
     protected static Log log = LogFactory.getLog(
             JPAWeblogManagerImpl.class);
     
-    protected JPAPersistenceStrategy strategy;
-    private Roller roller = null;
+    private final Roller roller;
+    private final JPAPersistenceStrategy strategy;
     
     // cached mapping of entryAnchors -> entryIds
     private Hashtable entryAnchorToIdMap = new Hashtable();
@@ -87,6 +87,7 @@
     
     private static final Comparator statCountCountReverseComparator =
             Collections.reverseOrder(StatCountCountComparator.getInstance());
+    
     
     @com.google.inject.Inject
     protected JPAWeblogManagerImpl(Roller roller, JPAPersistenceStrategy strategy) {

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/referrers/ReferrerQueueManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -1,24 +1,19 @@
 /*
-* 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.
-*/
-/*
- * ReferrerQueueManagerImpl.java
+ * 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
  *
- * Created on December 16, 2005, 5:06 PM
+ *     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.weblogger.business.referrers;
@@ -63,7 +58,7 @@
     
     private static Log mLogger = LogFactory.getLog(ReferrerQueueManagerImpl.class);
     
-    private Roller roller = null;
+    private final Roller roller;
     
     private boolean asyncMode = false;
     private int numWorkers = 1;
@@ -121,6 +116,7 @@
             }
         }
     }
+    
     
     /**
      * Process an incoming referrer.

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/search/IndexManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -47,6 +47,7 @@
 import org.apache.roller.weblogger.config.RollerConfig;
 import org.apache.commons.lang.StringUtils;
 
+
 /**
  * Lucene implementation of IndexManager. This is the central entry point 
  * into the Lucene searching API.
@@ -59,7 +60,7 @@
     // =============================================
     
     private IndexReader reader;
-    private Roller roller;
+    private final Roller roller;
     
     static Log mLogger = LogFactory.getFactory().getInstance(
             IndexManagerImpl.class);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java?view=diff&rev=550853&r1=550852&r2=550853
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/themes/ThemeManagerImpl.java
Tue Jun 26 09:50:30 2007
@@ -55,7 +55,8 @@
 public class ThemeManagerImpl implements ThemeManager {
     
     private static Log log = LogFactory.getLog(ThemeManagerImpl.class);
-    private Roller roller = null;
+    
+    private final Roller roller;
     
     // directory where themes are kept
     private String themeDir = null;
@@ -63,9 +64,12 @@
     // the Map contains ... (theme id, Theme)
     private Map themes = null;
     
+    
     @com.google.inject.Inject
     protected ThemeManagerImpl(Roller roller) {
+        
         this.roller = roller;
+        
         // get theme directory from config and verify it
         this.themeDir = RollerConfig.getProperty("themes.dir");
         if(themeDir == null || themeDir.trim().length() < 1) {



Mime
View raw message