You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2010/02/07 17:47:50 UTC
svn commit: r907447 - in /incubator/jspwiki/trunk: ChangeLog
src/java/org/apache/wiki/Release.java
src/java/org/apache/wiki/WikiEngine.java
src/java/org/apache/wiki/auth/SessionMonitor.java
src/java/org/apache/wiki/preferences/Preferences.java
Author: ajaquith
Date: Sun Feb 7 16:47:49 2010
New Revision: 907447
URL: http://svn.apache.org/viewvc?rev=907447&view=rev
Log:
Fixed some small bugs in SessionMonitor and Preferences.
Modified:
incubator/jspwiki/trunk/ChangeLog
incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SessionMonitor.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/preferences/Preferences.java
Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=907447&r1=907446&r2=907447&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Sun Feb 7 16:47:49 2010
@@ -1,7 +1,21 @@
-2010-02-04 Andrew Jaquith <ajaquith AT apache DOT org>
+2010-02-07 Andrew Jaquith <ajaquith AT apache DOT org>
* 3.0.0-svn-204
+ * Refactored WikiBackgroundThread to operate as listeners
+ for JMX timer events. Because they are no longer true threads
+ they don't keep chewing up heap if context shutdown for some
+ reason isn't normal.
+
+ * Fixed some small bugs in SessionMonitor and Preferences.
+
+ * Replaced the last few wiki:include tags with jsp:include,
+ and deprecated WikiIncludeTag.
+
+2010-02-04 Andrew Jaquith <ajaquith AT apache DOT org>
+
+ * 3.0.0-svn-203
+
* [JSPWIKI-578] Eliminated the remaining top-level JSPs
except for Error.jsp. Minor tweaks to the
templates/default directory; the layout JSP and
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=907447&r1=907446&r2=907447&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Sun Feb 7 16:47:49 2010
@@ -77,7 +77,7 @@
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "203";
+ public static final String BUILD = "204";
/**
* This is the generic version string you should use
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java?rev=907447&r1=907446&r2=907447&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/WikiEngine.java Sun Feb 7 16:47:49 2010
@@ -23,6 +23,7 @@
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.lang.management.ManagementFactory;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
@@ -30,6 +31,7 @@
import java.security.Principal;
import java.util.*;
+import javax.management.MBeanServer;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
@@ -546,6 +548,9 @@
// of a better way to do the startup-sequence.
try
{
+ // Initialize the JMX timer MBean
+ WikiBackgroundThread.registerTimer( this );
+
// Initialize the WikiContextFactory -- this MUST be done after setting the baseURL
m_contextFactory = new WikiContextFactory( this, props );
@@ -623,7 +628,6 @@
m_searchManager = (SearchManager)
ClassUtil.getMappedObject(SearchManager.class.getName() );
m_searchManager.initialize( this, props );
-
}
catch( RuntimeException e )
@@ -1585,9 +1589,10 @@
/**
* Protected method that signals that the WikiEngine will be
* shut down by the servlet container. It is called by
- * {@link WikiServlet#destroy()}. When this method is called,
- * it fires a "shutdown" WikiEngineEvent to all registered
- * listeners.
+ * {@link WikiServlet#destroy()} and
+ * {@link SessionMonitor#contextDestroyed(javax.servlet.ServletContextEvent).
+ * When this method is called, it fires a "shutdown"
+ * WikiEngineEvent to all registered listeners.
*/
public void shutdown()
{
@@ -1595,6 +1600,7 @@
if( m_filterManager != null ) m_filterManager.destroy();
LoggerFactory.unRegisterAllLoggerMBeans();
if( m_contentManager != null ) m_contentManager.shutdown();
+ WikiBackgroundThread.unregisterTimer( this );
}
/**
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SessionMonitor.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SessionMonitor.java?rev=907447&r1=907446&r2=907447&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SessionMonitor.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/SessionMonitor.java Sun Feb 7 16:47:49 2010
@@ -300,6 +300,10 @@
// and it has no knowledge of getInstance(WikiEngine).
ServletContext servletContext = session.getServletContext();
WikiEngine engine = WikiEngine.getInstance( servletContext, null );
+ if ( m_engine == null )
+ {
+ m_engine = engine;
+ }
// Stash 'templates' attribute for scripting
session.setAttribute( "templates", engine.getTemplateManager().getTemplateResources() );
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/preferences/Preferences.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/preferences/Preferences.java?rev=907447&r1=907446&r2=907447&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/preferences/Preferences.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/preferences/Preferences.java Sun Feb 7 16:47:49 2010
@@ -39,8 +39,6 @@
import org.apache.wiki.log.LoggerFactory;
import org.apache.wiki.ui.TemplateManager;
import org.apache.wiki.ui.stripes.LocaleConverter;
-import org.apache.wiki.util.PropertyReader;
-
/**
* <p>
@@ -400,7 +398,7 @@
// Ok, set up the preferences now
WikiEngine engine = WikiEngine.getInstance( session.getServletContext(), null );
Preferences prefs = new Preferences();
- Properties props = PropertyReader.loadWebAppProps( session.getServletContext() );
+ Properties props = engine.getWikiProperties();
Locale locale = request.getLocale();
// FIXME: "editor" property does not get registered, may be related with