You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2007/06/03 22:18:33 UTC
svn commit: r543978 [4/8] - in /roller/branches/roller_guice/apps/weblogger:
src/java/org/apache/roller/weblogger/
src/java/org/apache/roller/weblogger/business/
src/java/org/apache/roller/weblogger/business/hibernate/
src/java/org/apache/roller/weblog...
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARefererManagerImpl.java Sun Jun 3 13:18:24 2007
@@ -31,9 +31,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.lang.StringUtils;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.Roller;
import org.apache.roller.weblogger.business.RollerFactory;
import org.apache.roller.weblogger.business.UserManager;
@@ -50,9 +50,6 @@
/*
* JPARefererManagerImpl.java
- *
- * Created on May 31, 2006, 4:06 PM
- *
*/
public class JPARefererManagerImpl implements RefererManager {
@@ -67,28 +64,30 @@
/** The strategy for this manager. */
protected JPAPersistenceStrategy strategy;
+ private Roller roller = null;
/**
* Creates a new instance of JPARefererManagerImpl
*/
- public JPARefererManagerImpl(JPAPersistenceStrategy strategy) {
+ @com.google.inject.Inject
+ public JPARefererManagerImpl(Roller roller, JPAPersistenceStrategy strategy) {
log.debug("Instantiating JPA Referer Manager");
-
+ this.roller = roller;
this.strategy = strategy;
}
- public void saveReferer(WeblogReferrer referer) throws RollerException {
+ public void saveReferer(WeblogReferrer referer) throws WebloggerException {
strategy.store(referer);
}
- public void removeReferer(WeblogReferrer referer) throws RollerException {
+ public void removeReferer(WeblogReferrer referer) throws WebloggerException {
strategy.remove(referer);
}
/**
* Clear referrer dayhits and remove referrers without excerpts.
*/
- public void clearReferrers() throws RollerException {
+ public void clearReferrers() throws WebloggerException {
clearDayHits();
Query q = strategy.getNamedUpdate("WeblogReferrer.removeByNullOrEmptyExcerpt");
q.executeUpdate();
@@ -97,7 +96,7 @@
/**
* Clear referrer dayhits and remove referrers without excerpts.
*/
- public void clearReferrers(Weblog website) throws RollerException {
+ public void clearReferrers(Weblog website) throws WebloggerException {
clearDayHitsByWebsite(website);
Query q = strategy.getNamedUpdate("WeblogReferrer.removeByNullOrEmptyExcerpt&Website");
q.setParameter(1, website);
@@ -107,7 +106,7 @@
/**
* Apply ignoreWord/spam filters to all referers in system.
*/
- public void applyRefererFilters() throws RollerException {
+ public void applyRefererFilters() throws WebloggerException {
String spamwords = RollerRuntimeConfig.getProperty("spam.blacklist");
String[] blacklist = StringUtils.split(
StringUtils.deleteWhitespace(spamwords),",");
@@ -123,8 +122,8 @@
* Apply ignoreWord/spam filters to all referers in website.
*/
public void applyRefererFilters(Weblog website)
- throws RollerException {
- if (null == website) throw new RollerException("website is null");
+ throws WebloggerException {
+ if (null == website) throw new WebloggerException("website is null");
if (null == website.getBlacklist()) return;
String[] blacklist = StringUtils.split(
@@ -138,7 +137,7 @@
}
protected List getExistingReferers(Weblog website, String dateString,
- String permalink) throws RollerException {
+ String permalink) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsite&DateString&RefererPermalink");
@@ -149,7 +148,7 @@
}
protected List getMatchingReferers(Weblog website, String requestUrl,
- String refererUrl) throws RollerException {
+ String refererUrl) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsite&RequestUrl&RefererUrl");
@@ -168,7 +167,7 @@
* @return List of StatCount objects.
*/
public List getHotWeblogs(int sinceDays, int offset, int length)
- throws RollerException {
+ throws WebloggerException {
String msg = "Getting hot weblogs";
List results = new ArrayList();
@@ -214,7 +213,7 @@
}
protected int getHits(Weblog website, String type)
- throws RollerException {
+ throws WebloggerException {
int hits = -1;
if (log.isDebugEnabled()) {
log.debug("getHits: " + website.getName());
@@ -250,7 +249,7 @@
* @param weblog
* @return List of type WeblogReferrer
*/
- public List getReferers(Weblog weblog) throws RollerException {
+ public List getReferers(Weblog weblog) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsiteOrderByTotalHitsDesc");
q.setParameter(1, weblog);
@@ -262,7 +261,7 @@
* @param website Web site.
* @return List of type WeblogReferrer
*/
- public List getTodaysReferers(Weblog website) throws RollerException {
+ public List getTodaysReferers(Weblog website) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsite&DayHitsGreaterZeroOrderByDayHitsDesc");
q.setParameter(1, website);
@@ -274,16 +273,16 @@
* @param website Web site.
* @param date YYYYMMDD format of day's date.
* @return List of type WeblogReferrer.
- * @throws org.apache.roller.RollerException
+ * @throws org.apache.roller.weblogger.WebloggerException
*/
public List getReferersToDate(Weblog website, String date)
- throws RollerException {
+ throws WebloggerException {
if (website==null )
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
if (date==null )
- throw new RollerException("Date is null");
+ throw new WebloggerException("Date is null");
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsite&DateString&DuplicateOrderByTotalHitsDesc");
@@ -297,11 +296,11 @@
* Get referers that refer to a specific weblog entry.
* @param entryid Weblog entry ID
* @return List of WeblogReferrer objects.
- * @throws org.apache.roller.RollerException
+ * @throws org.apache.roller.weblogger.WebloggerException
*/
- public List getReferersToEntry(String entryid) throws RollerException {
+ public List getReferersToEntry(String entryid) throws WebloggerException {
if (null == entryid)
- throw new RollerException("entryid is null");
+ throw new WebloggerException("entryid is null");
//TODO: DataMapperPort: Change calling code to pass WeblogEntry instead of id
// we should change calling code to pass instance of WeblogEntry instead
// of extracting and passing id. Once that is done, change the code below to
@@ -316,7 +315,7 @@
* Query for collection of referers.
*/
protected List getReferersToWebsite(Weblog website, String refererUrl)
- throws RollerException {
+ throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsite&RefererUrl");
q.setParameter(1, website);
@@ -331,7 +330,7 @@
String requestUrl,
String title,
String excerpt)
- throws RollerException {
+ throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogReferrer.getByWebsite&RequestURL&TitleOrExcerpt");
q.setParameter(1, website);
@@ -344,21 +343,21 @@
/**
* Get user's day hits
*/
- public int getDayHits(Weblog website) throws RollerException {
+ public int getDayHits(Weblog website) throws WebloggerException {
return getHits(website, DAYHITS);
}
/**
* Get user's all-time total hits
*/
- public int getTotalHits(Weblog website) throws RollerException {
+ public int getTotalHits(Weblog website) throws WebloggerException {
return getHits(website, TOTALHITS);
}
/**
* Retrieve referer by id.
*/
- public WeblogReferrer getReferer(String id) throws RollerException {
+ public WeblogReferrer getReferer(String id) throws WebloggerException {
return (WeblogReferrer)strategy.load(WeblogReferrer.class, id);
}
@@ -379,17 +378,17 @@
// lookup the weblog now
try {
- UserManager userMgr = RollerFactory.getRoller().getUserManager();
+ UserManager userMgr = roller.getUserManager();
weblog = userMgr.getWebsiteByHandle(weblogHandle);
if (weblog == null) return;
// now lookup weblog entry if possible
if (entryAnchor != null) {
- WeblogManager weblogMgr = RollerFactory.getRoller().
+ WeblogManager weblogMgr = roller.
getWeblogManager();
entry = weblogMgr.getWeblogEntryByAnchor(weblog, entryAnchor);
}
- } catch (RollerException re) {
+ } catch (WebloggerException re) {
// problem looking up website, gotta bail
log.error("Error looking up website object", re);
return;
@@ -485,7 +484,7 @@
// Launch thread to extract referer linkback
try {
- Roller mRoller = RollerFactory.getRoller();
+ Roller mRoller = roller;
mRoller.getThreadManager().executeInBackground(
new LinkbackExtractorRunnable(ref));
} catch (InterruptedException e) {
@@ -495,7 +494,7 @@
saveReferer(ref);
}
}
- } catch (RollerException pe) {
+ } catch (WebloggerException pe) {
log.error(pe);
} catch (NullPointerException npe) {
log.error(npe);
@@ -632,26 +631,26 @@
*/
public void release() {}
- protected void clearDayHits() throws RollerException {
+ protected void clearDayHits() throws WebloggerException {
Query query = strategy.getNamedUpdate("WeblogReferrer.clearDayHits");
query.executeUpdate();
}
- protected void clearDayHitsByWebsite(Weblog website) throws RollerException {
+ protected void clearDayHitsByWebsite(Weblog website) throws WebloggerException {
Query query = strategy.getNamedUpdate("WeblogReferrer.clearDayHitsByWebsite");
query.setParameter(1, website);
query.executeUpdate();
}
protected List getBlackListedReferer(String[] blacklist) throws
- RollerException {
+ WebloggerException {
StringBuffer queryString = getQueryStringForBlackList(blacklist);
Query query = strategy.getDynamicQuery(queryString.toString());
return (List) query.getResultList();
}
protected List getBlackListedReferer(Weblog website, String[] blacklist)
- throws RollerException {
+ throws WebloggerException {
StringBuffer queryString = getQueryStringForBlackList(blacklist);
queryString.append(" AND r.website = ?1 ");
Query query = strategy.getDynamicQuery(queryString.toString());
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPARollerImpl.java Sun Jun 3 13:18:24 2007
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
@@ -26,8 +25,8 @@
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.BookmarkManager;
import org.apache.roller.weblogger.business.DatabaseProvider;
import org.apache.roller.weblogger.business.FileManager;
@@ -43,6 +42,7 @@
import org.apache.roller.weblogger.business.pings.PingQueueManager;
import org.apache.roller.weblogger.business.pings.PingTargetManager;
import org.apache.roller.weblogger.business.referrers.RefererManager;
+import org.apache.roller.weblogger.business.referrers.ReferrerQueueManager;
import org.apache.roller.weblogger.business.search.IndexManager;
import org.apache.roller.weblogger.business.themes.ThemeManager;
import org.apache.roller.weblogger.config.RollerConfig;
@@ -62,6 +62,7 @@
// a persistence utility class
protected JPAPersistenceStrategy strategy = null;
+ private Roller roller = null;
// references to the managers we maintain
private BookmarkManager bookmarkManager = null;
@@ -76,24 +77,25 @@
/**
* Single constructor.
- * @throws org.apache.roller.RollerException on any error
+ * @throws org.apache.roller.weblogger.WebloggerException on any error
*/
@com.google.inject.Inject
public JPARollerImpl(
JPAPersistenceStrategy strategy,
- AutoPingManager autoPingManager,
- BookmarkManager bookmarkManager,
- FileManager fileManager,
- IndexManager indexManager,
- PingQueueManager pingQueueManager,
- PingTargetManager pingTargetManager,
- PluginManager pluginManager,
- PropertiesManager propertiesManager,
- RefererManager refererManager,
- ThemeManager themeManager,
- ThreadManager threadManager,
- UserManager userManager,
- WeblogManager weblogManager) throws RollerException {
+ AutoPingManager autoPingManager,
+ BookmarkManager bookmarkManager,
+ FileManager fileManager,
+ IndexManager indexManager,
+ PingQueueManager pingQueueManager,
+ PingTargetManager pingTargetManager,
+ PluginManager pluginManager,
+ PropertiesManager propertiesManager,
+ RefererManager refererManager,
+ ReferrerQueueManager refererQueueManager,
+ ThemeManager themeManager,
+ ThreadManager threadManager,
+ UserManager userManager,
+ WeblogManager weblogManager) throws WebloggerException {
super(
autoPingManager,
@@ -105,6 +107,7 @@
pluginManager,
propertiesManager,
refererManager,
+ refererQueueManager,
themeManager,
threadManager,
userManager,
@@ -139,27 +142,10 @@
}
}
- protected UserManager createJPAUserManager(JPAPersistenceStrategy strategy) {
- return new JPAUserManagerImpl((JPAPersistenceStrategy) strategy);
- }
-
- protected WeblogManager createJPAWeblogManager(
- JPAPersistenceStrategy strategy) {
- return new JPAWeblogManagerImpl((JPAPersistenceStrategy) strategy);
- }
-
- protected ThreadManager createJPAThreadManager(
- JPAPersistenceStrategy strategy) {
- return new JPAThreadManagerImpl((JPAPersistenceStrategy) strategy);
- }
-
- protected RefererManager createJPARefererManagerImpl(JPAPersistenceStrategy strategy) {
- return new JPARefererManagerImpl((JPAPersistenceStrategy) strategy);
- }
-
+
/**
* Construct and return the singleton instance of the class.
- * @throws org.apache.roller.RollerException on any error
+ * @throws org.apache.roller.weblogger.WebloggerException on any error
* @return the singleton
*/
/*public static Roller instantiate() throws RollerException {
@@ -173,27 +159,16 @@
return roller;
}*/
- public void flush() throws RollerException {
+ public void flush() throws WebloggerException {
this.strategy.flush();
}
public void release() {
-
- // release our own stuff first
- if (bookmarkManager != null) bookmarkManager.release();
- if (referrerManager != null) referrerManager.release();
- if (userManager != null) userManager.release();
- if (weblogManager != null) weblogManager.release();
- if (pingTargetManager != null) pingTargetManager.release();
- if (pingQueueManager != null) pingQueueManager.release();
- if (autoPingManager != null) autoPingManager.release();
+ super.release();
// tell JPA to close down
this.strategy.release();
-
- // then let parent do its thing
- super.release();
}
@@ -205,143 +180,28 @@
// then let parent do its thing
super.shutdown();
}
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getAutopingManager()
- */
- public AutoPingManager getAutopingManager() {
- if (autoPingManager == null) {
- autoPingManager = createJPAAutoPingManager(strategy);
- }
- return autoPingManager;
- }
-
- protected AutoPingManager createJPAAutoPingManager(
- JPAPersistenceStrategy strategy) {
- return new JPAAutoPingManagerImpl(strategy);
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getBookmarkManager()
- */
- public BookmarkManager getBookmarkManager() {
- if ( bookmarkManager == null ) {
- bookmarkManager = createJPABookmarkManager(strategy);
- }
- return bookmarkManager;
- }
-
- protected BookmarkManager createJPABookmarkManager(
- JPAPersistenceStrategy strategy) {
- return new JPABookmarkManagerImpl(strategy);
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getPingTargetManager()
- */
- public PingQueueManager getPingQueueManager() {
- if (pingQueueManager == null) {
- pingQueueManager = createJPAPingQueueManager(strategy);
- }
- return pingQueueManager;
- }
-
- protected PingQueueManager createJPAPingQueueManager(
- JPAPersistenceStrategy strategy) {
- return new JPAPingQueueManagerImpl(strategy);
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getPingTargetManager()
- */
- public PingTargetManager getPingTargetManager() {
- if (pingTargetManager == null) {
- pingTargetManager = createJPAPingTargetManager(strategy);
- }
- return pingTargetManager;
- }
-
- protected PingTargetManager createJPAPingTargetManager(
- JPAPersistenceStrategy strategy) {
- return new JPAPingTargetManagerImpl(strategy);
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getPropertiesManager()
- */
- public PropertiesManager getPropertiesManager() {
- if (propertiesManager == null) {
- propertiesManager = createJPAPropertiesManager(strategy);
- }
- return propertiesManager;
- }
-
- protected PropertiesManager createJPAPropertiesManager(
- JPAPersistenceStrategy strategy) {
- return new JPAPropertiesManagerImpl(strategy);
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getRefererManager()
- */
- public RefererManager getRefererManager() {
- if ( referrerManager == null ) {
- referrerManager = createJPARefererManagerImpl(strategy);
- }
- return referrerManager;
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getUserManager()
- */
- public UserManager getUserManager() {
- if ( userManager == null ) {
- userManager = createJPAUserManager(strategy);
- }
- return userManager;
- }
-
- /**
- * @see org.apache.roller.weblogger.business.Roller#getWeblogManager()
- */
- public WeblogManager getWeblogManager() {
- if ( weblogManager == null ) {
- weblogManager = createJPAWeblogManager(strategy);
- }
- return weblogManager;
- }
-
- /**
- * @see org.apache.roller.weblogger.model.Roller#getThreadManager()
- */
- public ThreadManager getThreadManager() {
- if (threadManager == null) {
- threadManager = createJPAThreadManager(strategy);
- }
- return threadManager;
- }
/**
* Loads properties from given resourceName using given class loader
* @param resourceName The name of the resource containing properties
* @param cl Classloeder to be used to locate the resouce
* @return A properties object
- * @throws RollerException
+ * @throws WebloggerException
*/
private static Properties loadPropertiesFromResourceName(
- String resourceName, ClassLoader cl) throws RollerException {
+ String resourceName, ClassLoader cl) throws WebloggerException {
Properties props = new Properties();
InputStream in = null;
in = cl.getResourceAsStream(resourceName);
if (in == null) {
//TODO: Check how i18n is done in roller
- throw new RollerException(
+ throw new WebloggerException(
"Could not locate properties to load " + resourceName);
}
try {
props.load(in);
} catch (IOException ioe) {
- throw new RollerException(
+ throw new WebloggerException(
"Could not load properties from " + resourceName);
} finally {
if (in != null) {
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java Sun Jun 3 13:18:24 2007
@@ -24,11 +24,11 @@
import javax.persistence.Query;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.Roller;
import org.apache.roller.weblogger.business.runnable.ThreadManagerImpl;
import org.apache.roller.weblogger.business.runnable.RollerTask;
-import org.apache.roller.weblogger.business.RollerFactory;
import org.apache.roller.weblogger.pojos.TaskLock;
@@ -43,13 +43,16 @@
private static final Log log = LogFactory.getLog(JPAThreadManagerImpl.class);
private final JPAPersistenceStrategy strategy;
+ private Roller roller = null;
- public JPAThreadManagerImpl(JPAPersistenceStrategy strat) {
+ @com.google.inject.Inject
+ public JPAThreadManagerImpl(Roller roller, JPAPersistenceStrategy strat) {
super();
log.debug("Instantiating JPA Thread Manager");
+ this.roller = roller;
this.strategy = strat;
}
@@ -73,10 +76,10 @@
// save it and flush
this.saveTaskLock(taskLock);
- RollerFactory.getRoller().flush();
+ roller.flush();
}
- } catch (RollerException ex) {
+ } catch (WebloggerException ex) {
log.warn("Error getting or inserting TaskLock", ex);
return false;
}
@@ -125,7 +128,7 @@
return false;
}
- } catch (RollerException ex) {
+ } catch (WebloggerException ex) {
log.warn("Error getting TaskLock", ex);
return false;
}
@@ -153,7 +156,7 @@
}
- private TaskLock getTaskLockByName(String name) throws RollerException {
+ private TaskLock getTaskLockByName(String name) throws WebloggerException {
// do lookup
Query q = strategy.getNamedQuery("TaskLock.getByName");
q.setParameter(1, name);
@@ -165,7 +168,7 @@
}
- private void saveTaskLock(TaskLock data) throws RollerException {
+ private void saveTaskLock(TaskLock data) throws WebloggerException {
this.strategy.store(data);
}
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAUserManagerImpl.java Sun Jun 3 13:18:24 2007
@@ -23,9 +23,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.BookmarkManager;
-import org.apache.roller.weblogger.business.RollerFactory;
import org.apache.roller.weblogger.business.UserManager;
import org.apache.roller.weblogger.business.WeblogManager;
import org.apache.roller.weblogger.business.pings.AutoPingManager;
@@ -44,7 +43,8 @@
import java.util.Collection;
import java.util.Comparator;
import javax.persistence.Query;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.business.Roller;
/*
* JPAUserManagerImpl.java
@@ -61,6 +61,7 @@
Collections.reverseOrder(StatCountCountComparator.getInstance());
protected JPAPersistenceStrategy strategy;
+ private Roller roller = null;
// cached mapping of weblogHandles -> weblogIds
private Map weblogHandleToIdMap = new Hashtable();
@@ -68,22 +69,23 @@
// cached mapping of userNames -> userIds
private Map userNameToIdMap = new Hashtable();
- public JPAUserManagerImpl(JPAPersistenceStrategy strat) {
+ @com.google.inject.Inject
+ public JPAUserManagerImpl(Roller roller, JPAPersistenceStrategy strat) {
log.debug("Instantiating JPA User Manager");
-
+ this.roller = roller;
this.strategy = strat;
}
/**
* Update existing website.
*/
- public void saveWebsite(Weblog website) throws RollerException {
+ public void saveWebsite(Weblog website) throws WebloggerException {
website.setLastModified(new java.util.Date());
strategy.store(website);
}
- public void removeWebsite(Weblog weblog) throws RollerException {
+ public void removeWebsite(Weblog weblog) throws WebloggerException {
// remove contents first, then remove website
this.removeWebsiteContents(weblog);
@@ -98,10 +100,10 @@
* TODO BACKEND: use manager methods instead of queries here
*/
private void removeWebsiteContents(Weblog website)
- throws RollerException {
+ throws WebloggerException {
- BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
- WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+ BookmarkManager bmgr = roller.getBookmarkManager();
+ WeblogManager wmgr = roller.getWeblogManager();
// remove tags
Query tagQuery = strategy.getNamedQuery("WeblogEntryTag.getByWeblog");
@@ -140,7 +142,7 @@
}
// Remove the website's auto ping configurations
- AutoPingManager autoPingMgr = RollerFactory.getRoller()
+ AutoPingManager autoPingMgr = roller
.getAutopingManager();
List autopings = autoPingMgr.getAutoPingsByWebsite(website);
it = autopings.iterator();
@@ -149,7 +151,7 @@
}
// Remove the website's custom ping targets
- PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
+ PingTargetManager pingTargetMgr = roller.getPingTargetManager();
List pingtargets = pingTargetMgr.getCustomPingTargets(website);
it = pingtargets.iterator();
while(it.hasNext()) {
@@ -218,7 +220,7 @@
this.strategy.flush();
}
- protected void updateTagAggregates(List tags) throws RollerException {
+ protected void updateTagAggregates(List tags) throws WebloggerException {
for(Iterator iter = tags.iterator(); iter.hasNext();) {
TagStat stat = (TagStat) iter.next();
Query query = strategy.getNamedUpdate(
@@ -231,11 +233,11 @@
}
}
- public void saveUser(User data) throws RollerException {
+ public void saveUser(User data) throws WebloggerException {
this.strategy.store(data);
}
- public void removeUser(User user) throws RollerException {
+ public void removeUser(User user) throws WebloggerException {
//remove permissions
// make sure that both sides of the relationship are maintained
for (Iterator iterator = user.getPermissions().iterator(); iterator.hasNext();) {
@@ -256,7 +258,7 @@
}
public void savePermissions(WeblogPermission perms)
- throws RollerException {
+ throws WebloggerException {
if (getPermissions(perms.getId()) == null) {
// This is a new object make sure that relationship is set on managed
// copy of other side
@@ -270,7 +272,7 @@
}
public void removePermissions(WeblogPermission perms)
- throws RollerException {
+ throws WebloggerException {
this.strategy.remove(perms);
// make sure that relationship is set on managed
// copy of other side
@@ -284,25 +286,25 @@
/**
* @see org.apache.roller.weblogger.model.UserManager#storePage(org.apache.roller.weblogger.pojos.WeblogTemplate)
*/
- public void savePage(WeblogTemplate page) throws RollerException {
+ public void savePage(WeblogTemplate page) throws WebloggerException {
this.strategy.store(page);
// update weblog last modified date. date updated by saveWebsite()
- RollerFactory.getRoller().getUserManager()
+ roller.getUserManager()
.saveWebsite(page.getWebsite());
}
- public void removePage(WeblogTemplate page) throws RollerException {
+ public void removePage(WeblogTemplate page) throws WebloggerException {
this.strategy.remove(page);
// update weblog last modified date. date updated by saveWebsite()
- RollerFactory.getRoller().getUserManager().saveWebsite(page.getWebsite());
+ roller.getUserManager().saveWebsite(page.getWebsite());
}
- public void addUser(User newUser) throws RollerException {
+ public void addUser(User newUser) throws WebloggerException {
if(newUser == null)
- throw new RollerException("cannot add null user");
+ throw new WebloggerException("cannot add null user");
// TODO BACKEND: we must do this in a better fashion, like getUserCnt()?
boolean adminUser = false;
@@ -319,7 +321,7 @@
if(getUserByUserName(newUser.getUserName()) != null ||
getUserByUserName(newUser.getUserName().toLowerCase()) != null) {
- throw new RollerException("error.add.user.userNameInUse");
+ throw new WebloggerException("error.add.user.userNameInUse");
}
newUser.grantRole("editor");
@@ -330,7 +332,7 @@
this.strategy.store(newUser);
}
- public void addWebsite(Weblog newWeblog) throws RollerException {
+ public void addWebsite(Weblog newWeblog) throws WebloggerException {
this.strategy.store(newWeblog);
this.strategy.flush();
@@ -338,7 +340,7 @@
}
private void addWeblogContents(Weblog newWeblog)
- throws RollerException {
+ throws WebloggerException {
// grant weblog creator ADMIN permissions
WeblogPermission perms = new WeblogPermission();
@@ -408,9 +410,9 @@
}
// add any auto enabled ping targets
- PingTargetManager pingTargetMgr = RollerFactory.getRoller()
+ PingTargetManager pingTargetMgr = roller
.getPingTargetManager();
- AutoPingManager autoPingMgr = RollerFactory.getRoller()
+ AutoPingManager autoPingMgr = roller
.getAutopingManager();
Iterator pingTargets = pingTargetMgr.getCommonPingTargets().iterator();
@@ -431,10 +433,10 @@
* TODO BACKEND: do we really need this? can't we just use storePermissions()?
*/
public WeblogPermission inviteUser(Weblog website,
- User user, short mask) throws RollerException {
+ User user, short mask) throws WebloggerException {
- if (website == null) throw new RollerException("Website cannot be null");
- if (user == null) throw new RollerException("User cannot be null");
+ if (website == null) throw new WebloggerException("Website cannot be null");
+ if (user == null) throw new WebloggerException("User cannot be null");
WeblogPermission perms = new WeblogPermission();
perms.setWebsite(website);
@@ -450,10 +452,10 @@
*
* TODO: replace this with a domain model method like weblog.retireUser(user)
*/
- public void retireUser(Weblog website, User user) throws RollerException {
+ public void retireUser(Weblog website, User user) throws WebloggerException {
- if (website == null) throw new RollerException("Website cannot be null");
- if (user == null) throw new RollerException("User cannot be null");
+ if (website == null) throw new WebloggerException("Website cannot be null");
+ if (user == null) throw new WebloggerException("User cannot be null");
Iterator perms = website.getPermissions().iterator();
WeblogPermission target = null;
@@ -464,13 +466,13 @@
break;
}
}
- if (target == null) throw new RollerException("User not member of website");
+ if (target == null) throw new WebloggerException("User not member of website");
website.removePermission(target);
this.strategy.remove(target);
}
- public void revokeRole(String roleName, User user) throws RollerException {
+ public void revokeRole(String roleName, User user) throws WebloggerException {
Collection roles = user.getRoles();
Iterator iter = roles.iterator();
while (iter.hasNext()) {
@@ -482,11 +484,11 @@
}
}
- public Weblog getWebsite(String id) throws RollerException {
+ public Weblog getWebsite(String id) throws WebloggerException {
return (Weblog) this.strategy.load(Weblog.class, id);
}
- public Weblog getWebsiteByHandle(String handle) throws RollerException {
+ public Weblog getWebsiteByHandle(String handle) throws WebloggerException {
return getWebsiteByHandle(handle, Boolean.TRUE);
}
@@ -494,10 +496,10 @@
* Return website specified by handle.
*/
public Weblog getWebsiteByHandle(String handle, Boolean enabled)
- throws RollerException {
+ throws WebloggerException {
if (handle==null )
- throw new RollerException("Handle cannot be null");
+ throw new WebloggerException("Handle cannot be null");
// check cache first
// NOTE: if we ever allow changing handles then this needs updating
@@ -545,7 +547,7 @@
*/
public List getWebsites(
User user, Boolean enabled, Boolean active,
- Date startDate, Date endDate, int offset, int length) throws RollerException {
+ Date startDate, Date endDate, int offset, int length) throws WebloggerException {
//if (endDate == null) endDate = new Date();
@@ -611,19 +613,19 @@
return query.getResultList();
}
- public User getUser(String id) throws RollerException {
+ public User getUser(String id) throws WebloggerException {
return (User)this.strategy.load(User.class, id);
}
- public User getUserByUserName(String userName) throws RollerException {
+ public User getUserByUserName(String userName) throws WebloggerException {
return getUserByUserName(userName, Boolean.TRUE);
}
public User getUserByUserName(String userName, Boolean enabled)
- throws RollerException {
+ throws WebloggerException {
if (userName==null )
- throw new RollerException("userName cannot be null");
+ throw new WebloggerException("userName cannot be null");
// check cache first
// NOTE: if we ever allow changing usernames then this needs updating
@@ -676,7 +678,7 @@
public List getUsers(Weblog weblog, Boolean enabled, Date startDate,
Date endDate, int offset, int length)
- throws RollerException {
+ throws WebloggerException {
Query query = null;
List results = null;
@@ -733,13 +735,13 @@
return query.getResultList();
}
- public List getUsers(int offset, int length) throws RollerException {
+ public List getUsers(int offset, int length) throws WebloggerException {
return getUsers(Boolean.TRUE, null, null, offset, length);
}
public List getUsers(Boolean enabled, Date startDate, Date endDate,
int offset, int length)
- throws RollerException {
+ throws WebloggerException {
Query query = null;
List results = null;
boolean setRange = offset != 0 || length != -1;
@@ -789,7 +791,7 @@
/**
* Get users of a website
*/
- public List getUsers(Weblog website, Boolean enabled, int offset, int length) throws RollerException {
+ public List getUsers(Weblog website, Boolean enabled, int offset, int length) throws WebloggerException {
Query query = null;
List results = null;
boolean setRange = offset != 0 || length != -1;
@@ -825,7 +827,7 @@
}
public List getUsersStartingWith(String startsWith, Boolean enabled,
- int offset, int length) throws RollerException {
+ int offset, int length) throws WebloggerException {
Query query = null;
if (enabled != null) {
@@ -858,7 +860,7 @@
return query.getResultList();
}
- public WeblogTemplate getPage(String id) throws RollerException {
+ public WeblogTemplate getPage(String id) throws WebloggerException {
// Don't hit database for templates stored on disk
if (id != null && id.endsWith(".vm")) return null;
@@ -869,13 +871,13 @@
* Use JPA directly because Roller's Query API does too much allocation.
*/
public WeblogTemplate getPageByLink(Weblog website, String pagelink)
- throws RollerException {
+ throws WebloggerException {
if (website == null)
- throw new RollerException("userName is null");
+ throw new WebloggerException("userName is null");
if (pagelink == null)
- throw new RollerException("Pagelink is null");
+ throw new WebloggerException("Pagelink is null");
Query query = strategy.getNamedQuery("WeblogTemplate.getByWebsite&Link");
query.setParameter(1, website);
@@ -891,13 +893,13 @@
* @see org.apache.roller.weblogger.model.UserManager#getPageByAction(Weblog, java.lang.String)
*/
public WeblogTemplate getPageByAction(Weblog website, String action)
- throws RollerException {
+ throws WebloggerException {
if (website == null)
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
if (action == null)
- throw new RollerException("Action name is null");
+ throw new WebloggerException("Action name is null");
Query query = strategy.getNamedQuery("WeblogTemplate.getByAction");
@@ -914,13 +916,13 @@
* @see org.apache.roller.weblogger.model.UserManager#getPageByName(Weblog, java.lang.String)
*/
public WeblogTemplate getPageByName(Weblog website, String pagename)
- throws RollerException {
+ throws WebloggerException {
if (website == null)
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
if (pagename == null)
- throw new RollerException("Page name is null");
+ throw new WebloggerException("Page name is null");
Query query = strategy.getNamedQuery("WeblogTemplate.getByWebsite&Name");
query.setParameter(1, website);
@@ -935,9 +937,9 @@
/**
* @see org.apache.roller.weblogger.model.UserManager#getPages(Weblog)
*/
- public List getPages(Weblog website) throws RollerException {
+ public List getPages(Weblog website) throws WebloggerException {
if (website == null)
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
Query q = strategy.getNamedQuery(
"WeblogTemplate.getByWebsiteOrderByName");
q.setParameter(1, website);
@@ -945,7 +947,7 @@
}
public WeblogPermission getPermissions(String inviteId)
- throws RollerException {
+ throws WebloggerException {
return (WeblogPermission)this.strategy.load(
WeblogPermission.class, inviteId);
}
@@ -954,7 +956,7 @@
* Return permissions for specified user in website
*/
public WeblogPermission getPermissions(
- Weblog website, User user) throws RollerException {
+ Weblog website, User user) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogPermission.getByWebsiteAndUser");
q.setParameter(1, website);
@@ -969,7 +971,7 @@
/**
* Get pending permissions for user
*/
- public List getPendingPermissions(User user) throws RollerException {
+ public List getPendingPermissions(User user) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogPermission.getByUserAndPending");
q.setParameter(1, user);
@@ -980,7 +982,7 @@
/**
* Get pending permissions for website
*/
- public List getPendingPermissions(Weblog website) throws RollerException {
+ public List getPendingPermissions(Weblog website) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogPermission.getByWebsiteAndPending");
q.setParameter(1, website);
@@ -991,7 +993,7 @@
/**
* Get all permissions of a website (pendings not including)
*/
- public List getAllPermissions(Weblog website) throws RollerException {
+ public List getAllPermissions(Weblog website) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogPermission.getByWebsiteAndPending");
q.setParameter(1, website);
@@ -1002,7 +1004,7 @@
/**
* Get all permissions of a user.
*/
- public List getAllPermissions(User user) throws RollerException {
+ public List getAllPermissions(User user) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogPermission.getByUserAndPending");
q.setParameter(1, user);
@@ -1012,7 +1014,7 @@
public void release() {}
- public Map getUserNameLetterMap() throws RollerException {
+ public Map getUserNameLetterMap() throws WebloggerException {
String lc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Map results = new TreeMap();
Query query = strategy.getNamedQuery(
@@ -1028,7 +1030,7 @@
}
public List getUsersByLetter(char letter, int offset, int length)
- throws RollerException {
+ throws WebloggerException {
Query query = strategy.getNamedQuery(
"User.getByUserNameOrderByUserName");
query.setParameter(1, letter + "%");
@@ -1041,7 +1043,7 @@
return query.getResultList();
}
- public Map getWeblogHandleLetterMap() throws RollerException {
+ public Map getWeblogHandleLetterMap() throws WebloggerException {
String lc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Map results = new TreeMap();
Query query = strategy.getNamedQuery(
@@ -1057,7 +1059,7 @@
}
public List getWeblogsByLetter(char letter, int offset, int length)
- throws RollerException {
+ throws WebloggerException {
Query query = strategy.getNamedQuery(
"Weblog.getByLetterOrderByHandle");
query.setParameter(1, letter + "%");
@@ -1072,7 +1074,7 @@
public List getMostCommentedWebsites(Date startDate, Date endDate,
int offset, int length)
- throws RollerException {
+ throws WebloggerException {
Query query = null;
@@ -1118,7 +1120,7 @@
/**
* Get count of weblogs, active and inactive
*/
- public long getWeblogCount() throws RollerException {
+ public long getWeblogCount() throws WebloggerException {
long ret = 0;
List results = strategy.getNamedQuery(
"Weblog.getCountAllDistinct").getResultList();
@@ -1132,7 +1134,7 @@
/**
* Get count of users, enabled only
*/
- public long getUserCount() throws RollerException {
+ public long getUserCount() throws WebloggerException {
long ret = 0;
Query q = strategy.getNamedQuery("User.getCountEnabledDistinct");
q.setParameter(1, Boolean.TRUE);
@@ -1142,9 +1144,9 @@
return ret;
}
- public User getUserByActivationCode(String activationCode) throws RollerException {
+ public User getUserByActivationCode(String activationCode) throws WebloggerException {
if (activationCode == null)
- throw new RollerException("activationcode is null");
+ throw new WebloggerException("activationcode is null");
Query q = strategy.getNamedQuery("User.getUserByActivationCode");
q.setParameter(1, activationCode);
try {
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAWeblogManagerImpl.java Sun Jun 3 13:18:24 2007
@@ -37,10 +37,10 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
-import org.apache.roller.RollerException;
-import org.apache.roller.weblogger.business.RollerFactory;
+import org.apache.roller.weblogger.WebloggerException;
+import org.apache.roller.weblogger.business.Roller;
import org.apache.roller.weblogger.business.WeblogManager;
import org.apache.roller.weblogger.pojos.WeblogEntryComment;
import org.apache.roller.weblogger.pojos.WeblogHitCount;
@@ -71,6 +71,7 @@
JPAWeblogManagerImpl.class);
protected JPAPersistenceStrategy strategy;
+ private Roller roller = null;
// cached mapping of entryAnchors -> entryIds
private Hashtable entryAnchorToIdMap = new Hashtable();
@@ -86,21 +87,21 @@
private static final Comparator statCountCountReverseComparator =
Collections.reverseOrder(StatCountCountComparator.getInstance());
- public JPAWeblogManagerImpl
- (JPAPersistenceStrategy strategy) {
+ @com.google.inject.Inject
+ public JPAWeblogManagerImpl(Roller roller, JPAPersistenceStrategy strategy) {
log.debug("Instantiating JPA Weblog Manager");
-
+ this.roller = roller;
this.strategy = strategy;
}
/**
* @inheritDoc
*/
- public void saveWeblogCategory(WeblogCategory cat) throws RollerException {
+ public void saveWeblogCategory(WeblogCategory cat) throws WebloggerException {
boolean exists = getWeblogCategory(cat.getId()) != null;
if (!exists) {
if (isDuplicateWeblogCategoryName(cat)) {
- throw new RollerException("Duplicate category name, cannot save category");
+ throw new WebloggerException("Duplicate category name, cannot save category");
}
// Newly added object. If it has a parent,
// maintain relationship from both sides
@@ -111,7 +112,7 @@
}
// update weblog last modified date. date updated by saveWebsite()
- RollerFactory.getRoller().getUserManager().saveWebsite(cat.getWebsite());
+ roller.getUserManager().saveWebsite(cat.getWebsite());
this.strategy.store(cat);
}
@@ -119,9 +120,9 @@
* @inheritDoc
*/
public void removeWeblogCategory(WeblogCategory cat)
- throws RollerException {
+ throws WebloggerException {
if(cat.retrieveWeblogEntries(true).size() > 0) {
- throw new RollerException("Cannot remove category with entries");
+ throw new WebloggerException("Cannot remove category with entries");
}
// remove cat
@@ -146,7 +147,7 @@
}
// update weblog last modified date. date updated by saveWebsite()
- RollerFactory.getRoller().getUserManager().saveWebsite(
+ roller.getUserManager().saveWebsite(
cat.getWebsite());
}
@@ -154,11 +155,11 @@
* @inheritDoc
*/
public void moveWeblogCategory(WeblogCategory srcCat, WeblogCategory destCat)
- throws RollerException {
+ throws WebloggerException {
// TODO: this check should be made before calling this method?
if (destCat.descendentOf(srcCat)) {
- throw new RollerException(
+ throw new WebloggerException(
"ERROR cannot move parent category into it's own child");
}
@@ -188,7 +189,7 @@
// updates the paths of all descendents of the given category
private void updatePathTree(WeblogCategory cat)
- throws RollerException {
+ throws WebloggerException {
log.debug("Updating path tree for category "+cat.getPath());
@@ -219,11 +220,11 @@
*/
public void moveWeblogCategoryContents(WeblogCategory srcCat,
WeblogCategory destCat)
- throws RollerException {
+ throws WebloggerException {
// TODO: this check should be made before calling this method?
if (destCat.descendentOf(srcCat)) {
- throw new RollerException(
+ throw new WebloggerException(
"ERROR cannot move parent category into it's own child");
}
@@ -261,22 +262,22 @@
/**
* @inheritDoc
*/
- public void saveComment(WeblogEntryComment comment) throws RollerException {
+ public void saveComment(WeblogEntryComment comment) throws WebloggerException {
this.strategy.store(comment);
// update weblog last modified date. date updated by saveWebsite()
- RollerFactory.getRoller().getUserManager()
+ roller.getUserManager()
.saveWebsite(comment.getWeblogEntry().getWebsite());
}
/**
* @inheritDoc
*/
- public void removeComment(WeblogEntryComment comment) throws RollerException {
+ public void removeComment(WeblogEntryComment comment) throws WebloggerException {
this.strategy.remove(comment);
// update weblog last modified date. date updated by saveWebsite()
- RollerFactory.getRoller().getUserManager()
+ roller.getUserManager()
.saveWebsite(comment.getWeblogEntry().getWebsite());
}
@@ -284,7 +285,7 @@
* @inheritDoc
*/
// TODO: perhaps the createAnchor() and queuePings() items should go outside this method?
- public void saveWeblogEntry(WeblogEntry entry) throws RollerException {
+ public void saveWeblogEntry(WeblogEntry entry) throws WebloggerException {
if (entry.getAnchor() == null || entry.getAnchor().trim().equals("")) {
entry.setAnchor(this.createAnchor(entry));
@@ -315,13 +316,13 @@
// update weblog last modified date. date updated by saveWebsite()
if(entry.isPublished()) {
- RollerFactory.getRoller().getUserManager()
+ roller.getUserManager()
.saveWebsite(entry.getWebsite());
}
if(entry.isPublished()) {
// Queue applicable pings for this update.
- RollerFactory.getRoller().getAutopingManager()
+ roller.getAutopingManager()
.queueApplicableAutoPings(entry);
}
}
@@ -330,7 +331,7 @@
* @inheritDoc
*/
public void removeWeblogEntry(WeblogEntry entry)
- throws RollerException {
+ throws WebloggerException {
Query q = strategy.getNamedQuery("WeblogReferrer.getByWeblogEntry");
q.setParameter(1, entry);
List referers = q.getResultList();
@@ -370,7 +371,7 @@
// update weblog last modified date. date updated by saveWebsite()
if(entry.isPublished()) {
- RollerFactory.getRoller().getUserManager()
+ roller.getUserManager()
.saveWebsite(entry.getWebsite());
}
@@ -380,7 +381,7 @@
public List getNextPrevEntries(WeblogEntry current, String catName,
String locale, int maxEntries, boolean next)
- throws RollerException {
+ throws WebloggerException {
Query query = null;
List results = null;
WeblogCategory category = null;
@@ -416,7 +417,7 @@
params.add(size++, category);
whereClause.append(" AND e.category = ?" + size);
} else {
- throw new RollerException("Cannot find category: " + catName);
+ throw new WebloggerException("Cannot find category: " + catName);
}
}
@@ -443,9 +444,9 @@
* @inheritDoc
*/
public WeblogCategory getRootWeblogCategory(Weblog website)
- throws RollerException {
+ throws WebloggerException {
if (website == null)
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
Query q = strategy.getNamedQuery(
"WeblogCategory.getByWebsite&ParentNull");
@@ -461,9 +462,9 @@
* @inheritDoc
*/
public List getWeblogCategories(Weblog website, boolean includeRoot)
- throws RollerException {
+ throws WebloggerException {
if (website == null)
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
if (includeRoot) return getWeblogCategories(website);
@@ -477,9 +478,9 @@
* @inheritDoc
*/
public List getWeblogCategories(Weblog website)
- throws RollerException {
+ throws WebloggerException {
if (website == null)
- throw new RollerException("website is null");
+ throw new WebloggerException("website is null");
Query q = strategy.getNamedQuery(
"WeblogCategory.getByWebsite");
@@ -503,7 +504,7 @@
String sortOrder,
String locale,
int offset,
- int length) throws RollerException {
+ int length) throws WebloggerException {
WeblogCategory cat = null;
if (StringUtils.isNotEmpty(catName) && website != null) {
@@ -631,7 +632,7 @@
* @inheritDoc
*/
public List getWeblogEntriesPinnedToMain(Integer max)
- throws RollerException {
+ throws WebloggerException {
Query query = strategy.getNamedQuery(
"WeblogEntry.getByPinnedToMain&statusOrderByPubTimeDesc");
query.setParameter(1, Boolean.TRUE);
@@ -643,7 +644,7 @@
}
public void removeWeblogEntryAttribute(String name, WeblogEntry entry)
- throws RollerException {
+ throws WebloggerException {
for (Iterator it = entry.getEntryAttributes().iterator(); it.hasNext();) {
WeblogEntryAttribute entryAttribute = (WeblogEntryAttribute) it.next();
if (entryAttribute.getName().equals(name)) {
@@ -658,7 +659,7 @@
}
public void removeWeblogEntryTag(String name, WeblogEntry entry)
- throws RollerException {
+ throws WebloggerException {
for (Iterator it = entry.getTags().iterator(); it.hasNext();) {
WeblogEntryTag tag = (WeblogEntryTag) it.next();
if (tag.getName().equals(name)) {
@@ -676,13 +677,13 @@
* @inheritDoc
*/
public WeblogEntry getWeblogEntryByAnchor(Weblog website,
- String anchor) throws RollerException {
+ String anchor) throws WebloggerException {
if (website == null)
- throw new RollerException("Website is null");
+ throw new WebloggerException("Website is null");
if (anchor == null)
- throw new RollerException("Anchor is null");
+ throw new WebloggerException("Anchor is null");
// mapping key is combo of weblog + anchor
String mappingKey = website.getHandle()+":"+anchor;
@@ -726,7 +727,7 @@
*/
// TODO: this method should be removed and it's functionality moved to getWeblogEntries()
public List getWeblogEntries(WeblogCategory cat, boolean subcats)
- throws RollerException {
+ throws WebloggerException {
List results = null;
if (!subcats) {
@@ -750,7 +751,7 @@
/**
* @inheritDoc
*/
- public String createAnchor(WeblogEntry entry) throws RollerException {
+ public String createAnchor(WeblogEntry entry) throws WebloggerException {
// Check for uniqueness of anchor
String base = entry.createAnchorBase();
String name = base;
@@ -780,7 +781,7 @@
* @inheritDoc
*/
public boolean isDuplicateWeblogCategoryName(WeblogCategory cat)
- throws RollerException {
+ throws WebloggerException {
// ensure that no sibling categories share the same name
WeblogCategory parent = cat.getParent();
@@ -796,7 +797,7 @@
* @inheritDoc
*/
public boolean isWeblogCategoryInUse(WeblogCategory cat)
- throws RollerException {
+ throws WebloggerException {
Query q = strategy.getNamedQuery("WeblogEntry.getByCategory");
q.setParameter(1, cat);
@@ -837,7 +838,7 @@
String status,
boolean reverseChrono,
int offset,
- int length) throws RollerException {
+ int length) throws WebloggerException {
List params = new ArrayList();
int size = 0;
@@ -919,7 +920,7 @@
String searchString,
Date startDate,
Date endDate,
- String status) throws RollerException {
+ String status) throws WebloggerException {
// TODO dynamic bulk delete query: I'd MUCH rather use a bulk delete,
// but MySQL says "General error, message from server: "You can't
@@ -942,7 +943,7 @@
* @inheritDoc
*/
public WeblogCategory getWeblogCategory(String id)
- throws RollerException {
+ throws WebloggerException {
return (WeblogCategory) this.strategy.load(
WeblogCategory.class, id);
}
@@ -953,7 +954,7 @@
* @inheritDoc
*/
public WeblogCategory getWeblogCategoryByPath(Weblog website,
- String categoryPath) throws RollerException {
+ String categoryPath) throws WebloggerException {
return getWeblogCategoryByPath(website, null, categoryPath);
}
@@ -962,7 +963,7 @@
*/
// TODO: ditch this method in favor of getWeblogCategoryByPath(weblog, path)
public WeblogCategory getWeblogCategoryByPath(Weblog website,
- WeblogCategory category, String path) throws RollerException {
+ WeblogCategory category, String path) throws WebloggerException {
if (path == null || path.trim().equals("/")) {
return getRootWeblogCategory(website);
@@ -990,14 +991,14 @@
/**
* @inheritDoc
*/
- public WeblogEntryComment getComment(String id) throws RollerException {
+ public WeblogEntryComment getComment(String id) throws WebloggerException {
return (WeblogEntryComment) this.strategy.load(WeblogEntryComment.class, id);
}
/**
* @inheritDoc
*/
- public WeblogEntry getWeblogEntry(String id) throws RollerException {
+ public WeblogEntry getWeblogEntry(String id) throws WebloggerException {
return (WeblogEntry)strategy.load(WeblogEntry.class, id);
}
@@ -1013,7 +1014,7 @@
String status,
String locale,
int offset,
- int length) throws RollerException {
+ int length) throws WebloggerException {
return getWeblogEntryMap(
website,
startDate,
@@ -1040,7 +1041,7 @@
String locale,
int offset,
int length
- ) throws RollerException {
+ ) throws WebloggerException {
return getWeblogEntryMap(
website,
startDate,
@@ -1064,7 +1065,7 @@
boolean stringsOnly,
String locale,
int offset,
- int length) throws RollerException {
+ int length) throws WebloggerException {
TreeMap map = new TreeMap(reverseComparator);
@@ -1112,7 +1113,7 @@
*/
public List getMostCommentedWeblogEntries(Weblog website,
Date startDate, Date endDate, int offset,
- int length) throws RollerException {
+ int length) throws WebloggerException {
Query query = null;
List queryResults = null;
if (endDate == null) endDate = new Date();
@@ -1176,7 +1177,7 @@
* @inheritDoc
*/
public WeblogEntry getNextEntry(WeblogEntry current,
- String catName, String locale) throws RollerException {
+ String catName, String locale) throws WebloggerException {
WeblogEntry entry = null;
List entryList = getNextPrevEntries(current, catName, locale, 1, true);
if (entryList != null && entryList.size() > 0) {
@@ -1189,7 +1190,7 @@
* @inheritDoc
*/
public WeblogEntry getPreviousEntry(WeblogEntry current,
- String catName, String locale) throws RollerException {
+ String catName, String locale) throws WebloggerException {
WeblogEntry entry = null;
List entryList = getNextPrevEntries(current, catName, locale, 1, false);
if (entryList != null && entryList.size() > 0) {
@@ -1207,7 +1208,7 @@
* @inheritDoc
*/
public void applyCommentDefaultsToEntries(Weblog website)
- throws RollerException {
+ throws WebloggerException {
if (log.isDebugEnabled()) {
log.debug("applyCommentDefaults");
}
@@ -1225,7 +1226,7 @@
* @inheritDoc
*/
public List getPopularTags(Weblog website, Date startDate, int limit)
- throws RollerException {
+ throws WebloggerException {
Query query = null;
List queryResults = null;
@@ -1294,7 +1295,7 @@
* @inheritDoc
*/
public List getTags(Weblog website, String sortBy,
- String startsWith, int limit) throws RollerException {
+ String startsWith, int limit) throws WebloggerException {
Query query = null;
List queryResults = null;
boolean sortByName = sortBy == null || !sortBy.equals("count");
@@ -1355,7 +1356,7 @@
/**
* @inheritDoc
*/
- public boolean getTagComboExists(List tags, Weblog weblog) throws RollerException{
+ public boolean getTagComboExists(List tags, Weblog weblog) throws WebloggerException{
if(tags == null || tags.size() == 0) {
return false;
@@ -1404,13 +1405,13 @@
* @inheritDoc
*/
public void updateTagCount(String name, Weblog website, int amount)
- throws RollerException {
+ throws WebloggerException {
if(amount == 0) {
- throw new RollerException("Tag increment amount cannot be zero.");
+ throw new WebloggerException("Tag increment amount cannot be zero.");
}
if(website == null) {
- throw new RollerException("Website cannot be NULL.");
+ throw new WebloggerException("Website cannot be NULL.");
}
// The reason why add order lastUsed desc is to make sure we keep picking the most recent
@@ -1487,7 +1488,7 @@
/**
* @inheritDoc
*/
- public WeblogHitCount getHitCount(String id) throws RollerException {
+ public WeblogHitCount getHitCount(String id) throws WebloggerException {
// do lookup
return (WeblogHitCount) strategy.load(WeblogHitCount.class, id);
@@ -1497,7 +1498,7 @@
* @inheritDoc
*/
public WeblogHitCount getHitCountByWeblog(Weblog weblog)
- throws RollerException {
+ throws WebloggerException {
Query q = strategy.getNamedQuery("WeblogHitCount.getByWeblog");
q.setParameter(1, weblog);
try {
@@ -1511,7 +1512,7 @@
* @inheritDoc
*/
public List getHotWeblogs(int sinceDays, int offset, int length)
- throws RollerException {
+ throws WebloggerException {
// figure out start date
Calendar cal = Calendar.getInstance();
@@ -1538,7 +1539,7 @@
/**
* @inheritDoc
*/
- public void saveHitCount(WeblogHitCount hitCount) throws RollerException {
+ public void saveHitCount(WeblogHitCount hitCount) throws WebloggerException {
this.strategy.store(hitCount);
}
@@ -1546,7 +1547,7 @@
/**
* @inheritDoc
*/
- public void removeHitCount(WeblogHitCount hitCount) throws RollerException {
+ public void removeHitCount(WeblogHitCount hitCount) throws WebloggerException {
this.strategy.remove(hitCount);
}
@@ -1555,14 +1556,14 @@
* @inheritDoc
*/
public void incrementHitCount(Weblog weblog, int amount)
- throws RollerException {
+ throws WebloggerException {
if(amount == 0) {
- throw new RollerException("Tag increment amount cannot be zero.");
+ throw new WebloggerException("Tag increment amount cannot be zero.");
}
if(weblog == null) {
- throw new RollerException("Website cannot be NULL.");
+ throw new WebloggerException("Website cannot be NULL.");
}
Query q = strategy.getNamedQuery("WeblogHitCount.getByWeblog");
@@ -1589,7 +1590,7 @@
/**
* @inheritDoc
*/
- public void resetAllHitCounts() throws RollerException {
+ public void resetAllHitCounts() throws WebloggerException {
Query q = strategy.getNamedUpdate("WeblogHitCount.updateDailyHitCountZero");
q.executeUpdate();
}
@@ -1597,7 +1598,7 @@
/**
* @inheritDoc
*/
- public void resetHitCount(Weblog weblog) throws RollerException {
+ public void resetHitCount(Weblog weblog) throws WebloggerException {
Query q = strategy.getNamedQuery("WeblogHitCount.getByWeblog");
q.setParameter(1, weblog);
WeblogHitCount hitCount = null;
@@ -1614,7 +1615,7 @@
/**
* @inheritDoc
*/
- public long getCommentCount() throws RollerException {
+ public long getCommentCount() throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogEntryComment.getCountAllDistinctByStatus");
q.setParameter(1, WeblogEntryComment.APPROVED);
@@ -1625,7 +1626,7 @@
/**
* @inheritDoc
*/
- public long getCommentCount(Weblog website) throws RollerException {
+ public long getCommentCount(Weblog website) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogEntryComment.getCountDistinctByWebsite&Status");
q.setParameter(1, website);
@@ -1637,7 +1638,7 @@
/**
* @inheritDoc
*/
- public long getEntryCount() throws RollerException {
+ public long getEntryCount() throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogEntry.getCountDistinctByStatus");
q.setParameter(1, "PUBLISHED");
@@ -1648,7 +1649,7 @@
/**
* @inheritDoc
*/
- public long getEntryCount(Weblog website) throws RollerException {
+ public long getEntryCount(Weblog website) throws WebloggerException {
Query q = strategy.getNamedQuery(
"WeblogEntry.getCountDistinctByStatus&Website");
q.setParameter(1, "PUBLISHED");
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/AutoPingManager.java Sun Jun 3 13:18:24 2007
@@ -20,7 +20,7 @@
import java.util.Collection;
import java.util.List;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.pojos.AutoPing;
import org.apache.roller.weblogger.pojos.PingTarget;
import org.apache.roller.weblogger.pojos.WeblogEntry;
@@ -37,18 +37,18 @@
* Store an auto ping configuration.
*
* @param autoPing the auto ping configuration
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void saveAutoPing(AutoPing autoPing) throws RollerException;
+ public void saveAutoPing(AutoPing autoPing) throws WebloggerException;
/**
* Remove the auto ping configuration with given id.
*
* @param autoPing the auto ping configuration to remove
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void removeAutoPing(AutoPing autoPing) throws RollerException;
+ public void removeAutoPing(AutoPing autoPing) throws WebloggerException;
/**
@@ -57,26 +57,26 @@
*
* @param pingTarget the ping target
* @param website the website
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void removeAutoPing(PingTarget pingTarget, Weblog website) throws RollerException;
+ public void removeAutoPing(PingTarget pingTarget, Weblog website) throws WebloggerException;
/**
* Remove a collection of auto ping configurations.
*
* @param autopings a <code>Collection</code> of <code>AAutoPing/code> objects
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void removeAutoPings(Collection autopings) throws RollerException;
+ public void removeAutoPings(Collection autopings) throws WebloggerException;
/**
* Remove all auto ping configurations for all websites.
*
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void removeAllAutoPings() throws RollerException;
+ public void removeAllAutoPings() throws WebloggerException;
/**
@@ -84,9 +84,9 @@
*
* @param id the id of the auto ping configuration to retrieve.
* @return the auto ping configuration with specified id or null if not found
- * @throws RollerException
+ * @throws WebloggerException
*/
- public AutoPing getAutoPing(String id) throws RollerException;
+ public AutoPing getAutoPing(String id) throws WebloggerException;
/**
@@ -95,7 +95,7 @@
* @param website
* @return a list of auto ping configurations for the given website as <code>AuAutoPingcode> objects.
*/
- public List getAutoPingsByWebsite(Weblog website) throws RollerException;
+ public List getAutoPingsByWebsite(Weblog website) throws WebloggerException;
/**
@@ -104,7 +104,7 @@
* @param pingTarget
* @return a list of auto ping configurations for the given target as <code>AuAutoPingcode> objects.
*/
- public List getAutoPingsByTarget(PingTarget pingTarget) throws RollerException;
+ public List getAutoPingsByTarget(PingTarget pingTarget) throws WebloggerException;
/**
@@ -113,7 +113,7 @@
* @param changedWeblogEntry the entry that has been created or changed
* @return a list of the ping configurations that should be applied due to this change
*/
- public List getApplicableAutoPings(WeblogEntry changedWeblogEntry) throws RollerException;
+ public List getApplicableAutoPings(WeblogEntry changedWeblogEntry) throws WebloggerException;
/**
@@ -123,7 +123,7 @@
*
* @param changedWeblogEntry the entry that has been created or changed
*/
- public void queueApplicableAutoPings(WeblogEntry changedWeblogEntry) throws RollerException;
+ public void queueApplicableAutoPings(WeblogEntry changedWeblogEntry) throws WebloggerException;
/**
@@ -134,7 +134,7 @@
* will be empty if there are no restrictions (meaning that the auto ping configuration applies to changes
* in any category of the website).
*/
- public List getCategoryRestrictions(AutoPing autoPing) throws RollerException;
+ public List getCategoryRestrictions(AutoPing autoPing) throws WebloggerException;
/**
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueManager.java Sun Jun 3 13:18:24 2007
@@ -19,7 +19,7 @@
package org.apache.roller.weblogger.business.pings;
import java.util.List;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.pojos.AutoPing;
import org.apache.roller.weblogger.pojos.PingQueueEntry;
@@ -38,25 +38,25 @@
*
* @param autoPing auto ping configuration for the ping request to be queued.
*/
- public void addQueueEntry(AutoPing autoPing) throws RollerException;
+ public void addQueueEntry(AutoPing autoPing) throws WebloggerException;
/**
* Store the given queue entry.
*
* @param pingQueueEntry update the given queue entry
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void saveQueueEntry(PingQueueEntry pingQueueEntry) throws RollerException;
+ public void saveQueueEntry(PingQueueEntry pingQueueEntry) throws WebloggerException;
/**
* Remove a queue entry.
*
* @param pingQueueEntry the entry to be removed.
- * @throws RollerException
+ * @throws WebloggerException
*/
- public void removeQueueEntry(PingQueueEntry pingQueueEntry) throws RollerException;
+ public void removeQueueEntry(PingQueueEntry pingQueueEntry) throws WebloggerException;
/**
@@ -64,18 +64,18 @@
*
* @param id the unique id of the entry.
* @return the queue entry with the specified id.
- * @throws RollerException
+ * @throws WebloggerException
*/
- public PingQueueEntry getQueueEntry(String id) throws RollerException;
+ public PingQueueEntry getQueueEntry(String id) throws WebloggerException;
/**
* Get all of the queue entries.
*
* @return the queue as a <code>List</code> of {@link PPingQueueEntry objects.
- * @throws RollerException
+ * @throws WebloggerException
*/
- public List getAllQueueEntries() throws RollerException;
+ public List getAllQueueEntries() throws WebloggerException;
/**
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueProcessor.java Sun Jun 3 13:18:24 2007
@@ -22,7 +22,7 @@
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.RollerFactory;
import org.apache.roller.weblogger.config.PingConfig;
import org.apache.roller.weblogger.config.RollerRuntimeConfig;
@@ -50,7 +50,7 @@
}
- private PingQueueProcessor() throws RollerException {
+ private PingQueueProcessor() throws WebloggerException {
pingQueueMgr = RollerFactory.getRoller().getPingQueueManager();
}
@@ -58,9 +58,9 @@
/**
* Initialize the singleton. This is called during <code>RollerContext</code> initialization.
*
- * @throws RollerException
+ * @throws WebloggerException
*/
- public static synchronized void init() throws RollerException {
+ public static synchronized void init() throws WebloggerException {
if (theInstance != null) {
logger.warn("Ignoring duplicate initialization of PingQueueProcessor!");
return;
@@ -113,10 +113,10 @@
* Process an individual ping queue entry.
*
* @param pingQueueEntry the ping queue entry
- * @throws RollerException only if there are problems processing the queue. Exceptions from sending pings are
+ * @throws WebloggerException only if there are problems processing the queue. Exceptions from sending pings are
* handled, not thrown.
*/
- private void processQueueEntry(PingQueueEntry pingQueueEntry) throws RollerException {
+ private void processQueueEntry(PingQueueEntry pingQueueEntry) throws WebloggerException {
if (logger.isDebugEnabled()) logger.debug("Processing ping queue entry: " + pingQueueEntry);
PingTarget pingTarget = pingQueueEntry.getPingTarget();
@@ -152,10 +152,10 @@
*
* @param pingQueueEntry the ping queue entry
* @param ex the exception that occurred on the ping attempt
- * @throws RollerException
+ * @throws WebloggerException
*/
private void handlePingError(PingQueueEntry pingQueueEntry, Exception ex)
- throws RollerException {
+ throws WebloggerException {
if ((pingQueueEntry.incrementAttempts() < PingConfig.getMaxPingAttempts()) && WeblogUpdatePinger.shouldRetry(ex)) {
// We have attempts remaining, and it looks like we should retry,
Modified: roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueTask.java
URL: http://svn.apache.org/viewvc/roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueTask.java?view=diff&rev=543978&r1=543977&r2=543978
==============================================================================
--- roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueTask.java (original)
+++ roller/branches/roller_guice/apps/weblogger/src/java/org/apache/roller/weblogger/business/pings/PingQueueTask.java Sun Jun 3 13:18:24 2007
@@ -23,7 +23,7 @@
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.runnable.RollerTaskWithLeasing;
import org.apache.roller.weblogger.config.PingConfig;
import org.apache.roller.weblogger.business.Roller;
@@ -76,7 +76,7 @@
}
- public void init() throws RollerException {
+ public void init() throws WebloggerException {
// get relevant props
Properties props = this.getTaskProperties();
@@ -131,7 +131,7 @@
log.debug("task completed");
- } catch (RollerException e) {
+ } catch (WebloggerException e) {
log.error("Error while processing ping queue", e);
} catch (Exception ee) {
log.error("unexpected exception", ee);
@@ -152,7 +152,7 @@
task.init();
task.run();
System.exit(0);
- } catch (RollerException ex) {
+ } catch (WebloggerException ex) {
ex.printStackTrace();
System.exit(-1);
}