jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvit...@apache.org
Subject svn commit: r1687020 - in /jspwiki/trunk: ./ jspwiki-war/ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/java/org/apache/wiki/api/engine/ jspwiki-war/src/main/java/org/apache/wiki/api/filters/ jspwiki-war/src/main/java/org/apache/wiki/...
Date Tue, 23 Jun 2015 10:52:19 GMT
Author: dvittor
Date: Tue Jun 23 10:52:18 2015
New Revision: 1687020

URL: http://svn.apache.org/r1687020
Log:
[2.10.2-svn-18] Introducing the PicoContainer for Dependency Injection into the WikiEngine.

Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/pom.xml
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ReferenceManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/engine/AdminBeanManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/BasicPageFilter.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/PageFilter.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthenticationManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/i18n/InternationalizationManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/InternalModule.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/ModuleManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/plugin/DefaultPluginManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSGenerator.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/EditorManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/TemplateManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/admin/DefaultAdminBeanManager.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
    jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java
    jspwiki/trunk/pom.xml

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Tue Jun 23 10:52:18 2015
@@ -1,3 +1,9 @@
+2015-05-23  David Vittor (dvittor@apache.org)
+
+       * 2.10.2-svn-18
+
+       * Introducing the PicoContainer for Dependency Injection into the WikiEngine
+
 2015-06-22  Dirk Frederickx (brushed AT apache DOT org)
 
        * 2.10.2-svn-17

Modified: jspwiki/trunk/jspwiki-war/pom.xml
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/pom.xml?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/pom.xml (original)
+++ jspwiki/trunk/jspwiki-war/pom.xml Tue Jun 23 10:52:18 2015
@@ -45,6 +45,11 @@
       <groupId>org.apache.lucene</groupId>
       <artifactId>lucene-highlighter</artifactId>
     </dependency>
+    
+	<dependency>
+		<groupId>org.picocontainer</groupId>
+		<artifactId>picocontainer</artifactId>
+	</dependency>
 
     <dependency>
       <groupId>org.apache.lucene</groupId>

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java Tue Jun 23 10:52:18 2015
@@ -165,8 +165,13 @@ public class PageManager extends ModuleM
      * @param props  Properties to use for initialization
      * @throws WikiException If anything goes wrong, you get this.
      */
-    public PageManager(WikiEngine engine, Properties props) throws WikiException {
-        super(engine);
+    public PageManager() {
+    	
+    }
+    
+    @Override
+    public void initialize(WikiEngine engine, Properties props) throws WikiException {
+        super.initialize(engine, props);
         String classname;
         m_engine = engine;
         boolean useCache = "true".equals(props.getProperty(PROP_USECACHE));

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ReferenceManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ReferenceManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ReferenceManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ReferenceManager.java Tue Jun 23 10:52:18 2015
@@ -585,7 +585,7 @@ public class ReferenceManager
         WikiPage page = context.getPage();
 
         updateReferences( page.getName(),
-                          context.getEngine().scanWikiLinks( page, content ) );
+                          getEngine().scanWikiLinks( page, content ) );
 
         serializeAttrsToDisk( page );
     }
@@ -1178,4 +1178,12 @@ public class ReferenceManager
             }
         }
     }
+
+	public WikiEngine getEngine() {
+		return m_engine;
+	}
+
+	public void setEngine(WikiEngine engine) {
+		this.m_engine = engine;
+	}
 }

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Tue Jun 23 10:52:18 2015
@@ -72,7 +72,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "17";
+    public static final String     BUILD         = "18";
 
     /**
      *  This is the generic version string you should use when printing out the version.  It is of 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/VariableManager.java Tue Jun 23 10:52:18 2015
@@ -43,7 +43,7 @@ import org.apache.wiki.preferences.Prefe
  *
  *  @since 1.9.20.
  */
-public class VariableManager
+public class VariableManager implements InternalModule
 {
     private static Logger log = Logger.getLogger( VariableManager.class );
    
@@ -64,7 +64,7 @@ public class VariableManager
      *  Creates a VariableManager object using the property list given.
      *  @param props The properties.
      */
-    public VariableManager( Properties props )
+    public void initialize( WikiEngine engine, Properties props )
     {
     }
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java Tue Jun 23 10:52:18 2015
@@ -174,6 +174,8 @@ public class WikiEngine
 
     /** If this property is set to false, all filters are disabled when translating. */
     public static final String PROP_RUNFILTERS   = "jspwiki.runFilters";
+    
+    private static Properties staticProps = new Properties();
 
     /** Compares pages by name */
     private PageSorter     m_pageSorter = null;
@@ -390,10 +392,11 @@ public class WikiEngine
      *  @param properties A set of properties to use to initialize this WikiEngine.
      *  @throws WikiException If the initialization fails.
      */
-    public WikiEngine( Properties properties )
+    public WikiEngine( )
         throws WikiException
     {
-        initialize( properties );
+    	m_properties = staticProps;
+//        initialize( properties );
     }
 
     /**
@@ -444,11 +447,12 @@ public class WikiEngine
     /**
      *  Does all the real initialization.
      */
-    private void initialize( Properties props )
+    public void initialize( Properties props )
         throws WikiException
     {
         m_startTime  = new Date();
         m_properties = props;
+        WikiEngine.staticProps = props;
 
         //
         //  Initialize log4j.  However, make sure that we don't initialize it multiple times.
@@ -564,36 +568,30 @@ public class WikiEngine
             m_pluginManager     = (PluginManager)ClassUtil.getMappedObject(PluginManager.class.getName(), this, props );
             m_differenceManager = (DifferenceManager)ClassUtil.getMappedObject(DifferenceManager.class.getName(), this, props );
             m_attachmentManager = (AttachmentManager)ClassUtil.getMappedObject(AttachmentManager.class.getName(), this, props );
-            m_variableManager   = (VariableManager)ClassUtil.getMappedObject(VariableManager.class.getName(), props );
-            // m_filterManager     = (FilterManager)ClassUtil.getMappedObject(FilterManager.class.getName(), this, props );
-            m_renderingManager  = (RenderingManager) ClassUtil.getMappedObject(RenderingManager.class.getName());
+            m_variableManager   = (VariableManager)ClassUtil.getMappedObject(VariableManager.class.getName(), this, props );
+            m_filterManager     = (FilterManager)ClassUtil.getMappedObject(FilterManager.class.getName(), this, props );
+            m_renderingManager  = (RenderingManager) ClassUtil.getMappedObject(RenderingManager.class.getName(), this, props );
 
             m_searchManager     = (SearchManager)ClassUtil.getMappedObject(SearchManager.class.getName(), this, props );
 
-            m_authenticationManager = (AuthenticationManager) ClassUtil.getMappedObject(AuthenticationManager.class.getName());
-            m_authorizationManager  = (AuthorizationManager) ClassUtil.getMappedObject( AuthorizationManager.class.getName());
-            m_userManager           = (UserManager) ClassUtil.getMappedObject(UserManager.class.getName());
-            m_groupManager          = (GroupManager) ClassUtil.getMappedObject(GroupManager.class.getName());
+            m_authenticationManager = (AuthenticationManager) ClassUtil.getMappedObject(AuthenticationManager.class.getName(), this, props );
+            m_authorizationManager  = (AuthorizationManager) ClassUtil.getMappedObject( AuthorizationManager.class.getName(), this, props );
+            m_userManager           = (UserManager) ClassUtil.getMappedObject(UserManager.class.getName(), this, props );
+            m_groupManager          = (GroupManager) ClassUtil.getMappedObject(GroupManager.class.getName(), this, props );
 
-            m_editorManager     = (EditorManager)ClassUtil.getMappedObject(EditorManager.class.getName(), this );
-            m_editorManager.initialize( props );
+            m_editorManager     = (EditorManager)ClassUtil.getMappedObject(EditorManager.class.getName(), this , props );
 
             m_progressManager   = new ProgressManager();
 
             // Initialize the authentication, authorization, user and acl managers
 
-            m_authenticationManager.initialize( this, props );
-            m_authorizationManager.initialize( this, props );
-            m_userManager.initialize( this, props );
-            m_groupManager.initialize( this, props );
             m_aclManager = getAclManager();
 
             // Start the Workflow manager
-            m_workflowMgr = (WorkflowManager)ClassUtil.getMappedObject(WorkflowManager.class.getName());
-            m_workflowMgr.initialize(this, props);
+            m_workflowMgr = (WorkflowManager)ClassUtil.getMappedObject(WorkflowManager.class.getName(), this, props);
 
             m_internationalizationManager = (InternationalizationManager)
-                ClassUtil.getMappedObject(InternationalizationManager.class.getName(),this);
+                ClassUtil.getMappedObject(InternationalizationManager.class.getName(), this, props);
 
             m_templateManager   = (TemplateManager)
                 ClassUtil.getMappedObject(TemplateManager.class.getName(), this, props );
@@ -604,13 +602,13 @@ public class WikiEngine
             // Since we want to use a page filters initilize() method
             // as a engine startup listener where we can initialize global event listeners,
             // it must be called lastly, so that all object references in the engine
-            // are availabe to the initialize() method
-            m_filterManager     = (FilterManager)
-                ClassUtil.getMappedObject(FilterManager.class.getName(), this, props );
+            // are available to the initialize() method
+//            m_filterManager     = (FilterManager)
+//                ClassUtil.getMappedObject(FilterManager.class.getName(), this, props );
 
             // RenderingManager depends on FilterManager events.
 
-            m_renderingManager.initialize( this, props );
+//            m_renderingManager.initialize( this, props );
 
             //
             //  ReferenceManager has the side effect of loading all
@@ -726,6 +724,7 @@ public class WikiEngine
             {
                 m_referenceManager =
                     (ReferenceManager) ClassUtil.getMappedObject(ReferenceManager.class.getName(), this );
+                m_referenceManager.setEngine(this);
                 m_referenceManager.initialize( pages );
             }
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/engine/AdminBeanManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/engine/AdminBeanManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/engine/AdminBeanManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/engine/AdminBeanManager.java Tue Jun 23 10:52:18 2015
@@ -22,9 +22,10 @@ package org.apache.wiki.api.engine;
 import java.util.List;
 
 import org.apache.wiki.event.WikiEvent;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.ui.admin.AdminBean;
 
-public interface AdminBeanManager {
+public interface AdminBeanManager extends InternalModule {
 
 	void initialize();
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/BasicPageFilter.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/BasicPageFilter.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/BasicPageFilter.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/BasicPageFilter.java Tue Jun 23 10:52:18 2015
@@ -23,6 +23,7 @@ import java.util.Properties;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.exceptions.FilterException;
+import org.apache.wiki.api.exceptions.WikiException;
 
 /**
  *  Provides a base implementation of a PageFilter.  None of the callbacks
@@ -41,7 +42,7 @@ public class BasicPageFilter
      *  {@inheritDoc}
      */
     public void initialize( WikiEngine engine, Properties properties )
-        throws FilterException
+        throws FilterException, WikiException
     {
         m_engine = engine;
     }

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/PageFilter.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/PageFilter.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/PageFilter.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/api/filters/PageFilter.java Tue Jun 23 10:52:18 2015
@@ -23,6 +23,7 @@ import java.util.Properties;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.exceptions.FilterException;
+import org.apache.wiki.api.exceptions.WikiException;
 
 /**
  *  Provides a definition for a page filter.  A page filter is a class
@@ -54,7 +55,7 @@ public interface PageFilter
      *                          the filter is not added to the internal queues.
      */
     void initialize( WikiEngine engine, Properties properties )
-        throws FilterException;
+        throws FilterException, WikiException;
 
     /**
      *  This method is called whenever a page has been loaded from the provider,

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java Tue Jun 23 10:52:18 2015
@@ -42,6 +42,7 @@ import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.api.exceptions.ProviderException;
 import org.apache.wiki.api.exceptions.WikiException;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.parser.MarkupParser;
 import org.apache.wiki.providers.WikiAttachmentProvider;
 import org.apache.wiki.util.ClassUtil;
@@ -56,7 +57,7 @@ import org.apache.wiki.util.ClassUtil;
  *
  *  @since 1.9.28
  */
-public class AttachmentManager
+public class AttachmentManager implements InternalModule
 {
     /**
      *  The property name for defining the attachment provider class name.
@@ -104,13 +105,12 @@ public class AttachmentManager
      */
 
     // FIXME: Perhaps this should fail somehow.
-    public AttachmentManager( WikiEngine engine, Properties props )
+    public void initialize( WikiEngine engine, Properties props )
     {
         String classname;
 
         m_engine = engine;
 
-
         //
         //  If user wants to use a cache, then we'll use the CachingProvider.
         //

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthenticationManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthenticationManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthenticationManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthenticationManager.java Tue Jun 23 10:52:18 2015
@@ -59,6 +59,7 @@ import org.apache.wiki.auth.login.WikiCa
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.event.WikiEventManager;
 import org.apache.wiki.event.WikiSecurityEvent;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.util.TextUtil;
 import org.apache.wiki.util.TimedCounterList;
 
@@ -75,7 +76,7 @@ import org.apache.wiki.util.TimedCounter
  * 
  * @since 2.3
  */
-public class AuthenticationManager {
+public class AuthenticationManager implements InternalModule {
 
     /** How many milliseconds the logins are stored before they're cleaned away. */
     private static final long LASTLOGINS_CLEANUP_TIME = 10*60*1000L; // Ten minutes

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/AuthorizationManager.java Tue Jun 23 10:52:18 2015
@@ -58,6 +58,7 @@ import org.apache.wiki.event.WikiEventLi
 import org.apache.wiki.event.WikiEventManager;
 import org.apache.wiki.event.WikiSecurityEvent;
 import org.apache.wiki.i18n.InternationalizationManager;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.preferences.Preferences;
 import org.apache.wiki.tags.WikiTagBase;
 import org.apache.wiki.util.ClassUtil;
@@ -96,7 +97,7 @@ import org.freshcookies.security.policy.
  * @since 2.3
  * @see AuthenticationManager
  */
-public class AuthorizationManager {
+public class AuthorizationManager implements InternalModule {
 
     private static final Logger log = Logger.getLogger( AuthorizationManager.class );
     /**

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java Tue Jun 23 10:52:18 2015
@@ -58,6 +58,7 @@ import org.apache.wiki.event.WikiEventMa
 import org.apache.wiki.event.WikiSecurityEvent;
 import org.apache.wiki.filters.SpamFilter;
 import org.apache.wiki.i18n.InternationalizationManager;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.preferences.Preferences;
 import org.apache.wiki.ui.InputValidator;
 import org.apache.wiki.util.ClassUtil;
@@ -76,7 +77,7 @@ import org.apache.wiki.workflow.Workflow
  * Provides a facade for obtaining user information.
  * @since 2.3
  */
-public class UserManager {
+public class UserManager implements InternalModule {
 
     private static final String USERDATABASE_PACKAGE = "org.apache.wiki.auth.user";
     private static final String SESSION_MESSAGES = "profile";

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupManager.java Tue Jun 23 10:52:18 2015
@@ -46,6 +46,7 @@ import org.apache.wiki.event.WikiEvent;
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.event.WikiEventManager;
 import org.apache.wiki.event.WikiSecurityEvent;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.ui.InputValidator;
 import org.apache.wiki.util.ClassUtil;
 
@@ -65,7 +66,7 @@ import org.apache.wiki.util.ClassUtil;
  * </p>
  * @since 2.4.19
  */
-public class GroupManager implements Authorizer, WikiEventListener {
+public class GroupManager implements Authorizer, WikiEventListener, InternalModule {
 
     /** Key used for adding UI messages to a user's WikiSession. */
     public static final String  MESSAGES_KEY       = "group";

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java Tue Jun 23 10:52:18 2015
@@ -26,13 +26,14 @@ import org.apache.log4j.Logger;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.util.ClassUtil;
 
 
 /**
  * Load, initialize and delegate to the DiffProvider that will actually do the work.
  */
-public class DifferenceManager {
+public class DifferenceManager implements InternalModule {
     private static final Logger log = Logger.getLogger(DifferenceManager.class);
 
     /**
@@ -48,7 +49,7 @@ public class DifferenceManager {
      * @param engine The WikiEngine.
      * @param props  A set of properties.
      */
-    public DifferenceManager(WikiEngine engine, Properties props) {
+    public void initialize(WikiEngine engine, Properties props) {
         loadProvider(props);
 
         initializeProvider(engine, props);

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/filters/DefaultFilterManager.java Tue Jun 23 10:52:18 2015
@@ -108,11 +108,10 @@ public class DefaultFilterManager extend
      *  @param props Properties to initialize the FilterManager with
      *  @throws WikiException If something goes wrong.
      */
-    public DefaultFilterManager( WikiEngine engine, Properties props )
-        throws WikiException
+    public void initialize( WikiEngine engine, Properties props ) throws WikiException
     {
-        super( engine );
-        initialize( props );
+        super.initialize(engine, props);
+        initialize(props);
     }
 
     /**
@@ -138,7 +137,7 @@ public class DefaultFilterManager extend
         m_pageFilters.add( f, priority );
     }
 
-    private void initPageFilter( String className, Properties props )
+    private void initPageFilter( String className, Properties props ) throws WikiException
     {
         try
         {
@@ -243,7 +242,7 @@ public class DefaultFilterManager extend
      *  
      * @param xmlStream stream to parse
      */
-    private void parseConfigFile( InputStream xmlStream ) {
+    private void parseConfigFile( InputStream xmlStream ) throws WikiException {
     	List< Element > pageFilters = XmlUtil.parse( xmlStream, "/pagefilters/filter" );
         for( Iterator< Element > i = pageFilters.iterator(); i.hasNext(); ) {
             Element f = i.next();

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/i18n/InternationalizationManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/i18n/InternationalizationManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/i18n/InternationalizationManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/i18n/InternationalizationManager.java Tue Jun 23 10:52:18 2015
@@ -21,9 +21,11 @@ package org.apache.wiki.i18n;
 import java.text.MessageFormat;
 import java.util.Locale;
 import java.util.MissingResourceException;
+import java.util.Properties;
 import java.util.ResourceBundle;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.modules.InternalModule;
 
 
 /**
@@ -31,7 +33,7 @@ import org.apache.wiki.WikiEngine;
  *
  *  @since 2.6
  */
-public class InternationalizationManager {
+public class InternationalizationManager implements InternalModule {
 
     /** The name of the ResourceBundle which contains any and all JSPWiki core
      *  resource strings.  It's value is {@value}.
@@ -50,7 +52,7 @@ public class InternationalizationManager
      *
      *  @param engine To which engine this belongs to
      */
-    public InternationalizationManager( WikiEngine engine )
+    public void initialize( WikiEngine engine, Properties props )
     {
     }
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/InternalModule.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/InternalModule.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/InternalModule.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/InternalModule.java Tue Jun 23 10:52:18 2015
@@ -19,6 +19,11 @@
 
 package org.apache.wiki.modules;
 
+import java.util.Properties;
+
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.api.exceptions.WikiException;
+
 /**
  *  This is a simple interface which is implemented by a number of JSPWiki
  *  components to signal that they should not be included in things like
@@ -33,4 +38,5 @@ package org.apache.wiki.modules;
  */
 public interface InternalModule
 {
+	public void initialize(WikiEngine engine, Properties props) throws WikiException;
 }

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/ModuleManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/ModuleManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/ModuleManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/modules/ModuleManager.java Tue Jun 23 10:52:18 2015
@@ -19,14 +19,16 @@
 package org.apache.wiki.modules;
 
 import java.util.Collection;
+import java.util.Properties;
 
 import org.apache.wiki.Release;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.api.exceptions.WikiException;
 
 /**
  *  Superclass for all JSPWiki managers for modules (plugins, etc).
  */
-public abstract class ModuleManager
+public abstract class ModuleManager implements InternalModule
 {
 
     /**
@@ -37,6 +39,8 @@ public abstract class ModuleManager
         
     protected WikiEngine m_engine;
     
+    protected Properties m_properties;
+    
     private boolean m_loadIncompatibleModules = false;
     
     /**
@@ -44,9 +48,13 @@ public abstract class ModuleManager
      *  
      *  @param engine The WikiEngine which owns this manager.
      */
-    public ModuleManager( WikiEngine engine )
-    {
-        m_engine = engine;
+    public ModuleManager(  ) {
+        
+    }
+    
+    public void initialize( WikiEngine engine, Properties props ) throws WikiException {
+    	m_engine = engine;
+    	m_properties = props;
     }
     
     /**

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/plugin/DefaultPluginManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/plugin/DefaultPluginManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/plugin/DefaultPluginManager.java Tue Jun 23 10:52:18 2015
@@ -36,6 +36,7 @@ import org.apache.wiki.ajax.WikiAjaxDisp
 import org.apache.wiki.ajax.WikiAjaxServlet;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.api.plugin.InitializablePlugin;
 import org.apache.wiki.api.plugin.WikiPlugin;
 import org.apache.wiki.modules.ModuleManager;
@@ -188,8 +189,8 @@ public class DefaultPluginManager extend
      *  @param engine WikiEngine which owns this manager.
      *  @param props Contents of a "jspwiki.properties" file.
      */
-    public DefaultPluginManager( WikiEngine engine, Properties props ) {
-        super( engine );
+    public void initialize( WikiEngine engine, Properties props ) throws WikiException {
+        super.initialize( engine, props );
         String packageNames = props.getProperty( PROP_SEARCHPATH );
 
         if ( packageNames != null ) {

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSGenerator.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSGenerator.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSGenerator.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/rss/RSSGenerator.java Tue Jun 23 10:52:18 2015
@@ -32,8 +32,10 @@ import org.apache.wiki.WikiProvider;
 import org.apache.wiki.WikiSession;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.api.exceptions.ProviderException;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.attachment.Attachment;
 import org.apache.wiki.auth.permissions.PagePermission;
+import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.util.TextUtil;
 import org.apache.wiki.util.comparators.PageTimeComparator;
 
@@ -54,7 +56,7 @@ import org.apache.wiki.util.comparators.
  */
 // FIXME: Limit diff and page content size.
 // FIXME3.0: This class would need a bit of refactoring.  Method names, e.g. are confusing.
-public class RSSGenerator
+public class RSSGenerator implements InternalModule
 {
     static Logger              log = Logger.getLogger( RSSGenerator.class );
     private WikiEngine         m_engine;
@@ -162,8 +164,7 @@ public class RSSGenerator
      *  @param properties The properties.
      *  @throws NoRequiredPropertyException If something is missing from the given property set.
      */
-    public RSSGenerator( WikiEngine engine, Properties properties )
-        throws NoRequiredPropertyException
+    public void initialize( WikiEngine engine, Properties properties ) throws WikiException
     {
         m_engine = engine;
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java Tue Jun 23 10:52:18 2015
@@ -88,16 +88,10 @@ public class SearchManager extends Basic
      *  @param properties The list of Properties.
      *  @throws FilterException If it cannot be instantiated.
      */
-    public SearchManager( WikiEngine engine, Properties properties )
+    public SearchManager(  )
         throws FilterException
     {
-        initialize( engine, properties );
 
-        WikiEventUtils.addWikiEventListener(m_engine.getPageManager(),
-                                            WikiPageEvent.PAGE_DELETE_REQUEST, this);
-
-        //TODO: Replace with custom annotations. See JSPWIKI-566
-        WikiAjaxDispatcherServlet.registerServlet( JSON_SEARCH, new JSONSearch() );
     }
 
     /**
@@ -282,6 +276,13 @@ public class SearchManager extends Basic
         {
             log.error( e.getMessage(), e );
         }
+        
+        WikiEventUtils.addWikiEventListener(m_engine.getPageManager(),
+                WikiPageEvent.PAGE_DELETE_REQUEST, this);
+
+		//TODO: Replace with custom annotations. See JSPWIKI-566
+		WikiAjaxDispatcherServlet.registerServlet( JSON_SEARCH, new JSONSearch() );
+
     }
 
     private void loadSearchProvider(Properties properties)

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/EditorManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/EditorManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/EditorManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/EditorManager.java Tue Jun 23 10:52:18 2015
@@ -33,6 +33,7 @@ import org.apache.log4j.Logger;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.exceptions.NoSuchVariableException;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.modules.ModuleManager;
 import org.apache.wiki.modules.WikiModuleInfo;
 import org.apache.wiki.preferences.Preferences;
@@ -81,22 +82,18 @@ public class EditorManager extends Modul
     /** Known attribute name for storing the user edited text inside a session or a page context */
     public static final String       ATTR_EDITEDTEXT = REQ_EDITEDTEXT;
 
-    private             Map<String, WikiEditorInfo>  m_editors;
+    private             Map<String, WikiEditorInfo>  m_editors = new HashMap<String, WikiEditorInfo>();
 
     private static      Logger       log             = Logger.getLogger( EditorManager.class );
 
-    public EditorManager( WikiEngine engine )
-    {
-        super(engine);
-    }
-
     /**
      *  Initializes the EditorManager.  It also registers any editors it can find.
      *
      *  @param props  Properties for setup.
      */
-    public void initialize( Properties props )
+    public void initialize( WikiEngine engine, Properties props ) throws WikiException
     {
+    	super.initialize(engine, props);
         registerEditors();
     }
 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/TemplateManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/TemplateManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/TemplateManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/TemplateManager.java Tue Jun 23 10:52:18 2015
@@ -48,6 +48,7 @@ import org.apache.log4j.Logger;
 import org.apache.wiki.InternalWikiException;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.i18n.InternationalizationManager;
 import org.apache.wiki.modules.ModuleManager;
 import org.apache.wiki.modules.WikiModuleInfo;
@@ -143,9 +144,9 @@ public class TemplateManager extends Mod
      *  @param engine The owning engine.
      *  @param properties The property list used to initialize this.
      */
-    public TemplateManager( WikiEngine engine, Properties properties )
+    public void initialize( WikiEngine engine, Properties props ) throws WikiException
     {
-        super(engine);
+        super.initialize(engine,props);
 
         //
         //  Uses the unlimited cache.

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/admin/DefaultAdminBeanManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/admin/DefaultAdminBeanManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/admin/DefaultAdminBeanManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/ui/admin/DefaultAdminBeanManager.java Tue Jun 23 10:52:18 2015
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Properties;
 
 import javax.management.DynamicMBean;
 import javax.management.InstanceAlreadyExistsException;
@@ -38,14 +39,17 @@ import org.apache.wiki.Release;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.engine.AdminBeanManager;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.event.WikiEngineEvent;
 import org.apache.wiki.event.WikiEvent;
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.modules.WikiModuleInfo;
+import org.apache.wiki.ui.EditorManager;
 import org.apache.wiki.ui.admin.beans.CoreBean;
 import org.apache.wiki.ui.admin.beans.PluginBean;
 import org.apache.wiki.ui.admin.beans.SearchManagerBean;
 import org.apache.wiki.ui.admin.beans.UserBean;
+import org.apache.wiki.util.ClassUtil;
 
 
 /**
@@ -63,7 +67,7 @@ public class DefaultAdminBeanManager imp
 
     private static Logger log = Logger.getLogger(DefaultAdminBeanManager.class);
 
-    public DefaultAdminBeanManager( WikiEngine engine ) {
+    public void initialize( WikiEngine engine, Properties props ) {
         log.info("Using JDK 1.5 Platform MBeanServer");
         m_mbeanServer = MBeanServerFactory15.getServer();
 
@@ -180,9 +184,14 @@ public class DefaultAdminBeanManager imp
         } catch( NotCompliantMBeanException e ) {
             log.error( e.getMessage(), e );
         }
-        registerBeans( m_engine.getEditorManager().modules() );
-        PluginManager pm = m_engine.getPluginManager();
-        registerBeans( pm.modules() );
+        try {
+	        EditorManager em = (EditorManager)ClassUtil.getMappedObject(EditorManager.class.getName() );
+	        registerBeans( em.modules() );
+	        PluginManager pm = (PluginManager)ClassUtil.getMappedObject(PluginManager.class.getName() );
+	        registerBeans( pm.modules() );
+        } catch (WikiException e) {
+        	e.printStackTrace();
+        }
     }
 
     /* (non-Javadoc)

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java Tue Jun 23 10:52:18 2015
@@ -20,8 +20,6 @@ package org.apache.wiki.util;
 
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.net.JarURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -32,15 +30,42 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
+import org.apache.wiki.PageManager;
+import org.apache.wiki.ReferenceManager;
+import org.apache.wiki.VariableManager;
+import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.WikiException;
+import org.apache.wiki.attachment.AttachmentManager;
+import org.apache.wiki.auth.AuthenticationManager;
+import org.apache.wiki.auth.AuthorizationManager;
+import org.apache.wiki.auth.UserManager;
+import org.apache.wiki.auth.acl.DefaultAclManager;
+import org.apache.wiki.auth.authorize.GroupManager;
+import org.apache.wiki.content.PageRenamer;
+import org.apache.wiki.diff.DifferenceManager;
+import org.apache.wiki.filters.DefaultFilterManager;
+import org.apache.wiki.i18n.InternationalizationManager;
+import org.apache.wiki.modules.InternalModule;
+import org.apache.wiki.plugin.DefaultPluginManager;
+import org.apache.wiki.render.RenderingManager;
+import org.apache.wiki.rss.RSSGenerator;
+import org.apache.wiki.search.SearchManager;
+import org.apache.wiki.ui.EditorManager;
+import org.apache.wiki.ui.TemplateManager;
+import org.apache.wiki.ui.admin.DefaultAdminBeanManager;
+import org.apache.wiki.workflow.WorkflowManager;
 import org.jdom2.Element;
+import org.picocontainer.DefaultPicoContainer;
+import org.picocontainer.MutablePicoContainer;
+import org.picocontainer.PicoContainer;
 
 /**
  *  Contains useful utilities for class file manipulation.  This is a static class,
@@ -58,8 +83,10 @@ public final class ClassUtil {
     public  static final String MAPPINGS = "ini/classmappings.xml";
     
     private static Map<String, String> c_classMappings = new Hashtable<String, String>();
+    
+    private static MutablePicoContainer picoContainer = new DefaultPicoContainer();
 
-    private static boolean classLoaderSetup = false;
+	private static boolean classLoaderSetup = false;
     private static ClassLoader loader = null;
 
 
@@ -69,6 +96,32 @@ public final class ClassUtil {
     static {
     	List< Element > nodes = XmlUtil.parse( MAPPINGS, "/classmappings/mapping" );
 
+        picoContainer.addComponent(PageManager.class);
+        picoContainer.addComponent(ReferenceManager.class);
+        picoContainer.addComponent(VariableManager.class);
+        picoContainer.addComponent(DefaultFilterManager.class);
+        picoContainer.addComponent(DefaultPluginManager.class);
+        picoContainer.addComponent(DefaultAdminBeanManager.class);
+        picoContainer.addComponent(AttachmentManager.class);
+        picoContainer.addComponent(AuthenticationManager.class);
+        picoContainer.addComponent(AuthorizationManager.class);
+        picoContainer.addComponent(UserManager.class);
+        picoContainer.addComponent(DefaultAclManager.class);
+        picoContainer.addComponent(GroupManager.class);
+        picoContainer.addComponent(DifferenceManager.class);
+        picoContainer.addComponent(RenderingManager.class);
+        picoContainer.addComponent(SearchManager.class);
+        picoContainer.addComponent(EditorManager.class);
+        picoContainer.addComponent(TemplateManager.class);
+        picoContainer.addComponent(WorkflowManager.class);
+        picoContainer.addComponent(InternationalizationManager.class);
+        picoContainer.addComponent(PageRenamer.class);
+        picoContainer.addComponent(RSSGenerator.class);
+        picoContainer.addComponent(WikiEngine.class);
+//        picoContainer.addComponent(DummyUserDatabase.class);
+//        picoContainer.addComponent(JDBCUserDatabase.class);
+//        picoContainer.addComponent(XMLUserDatabase.class);
+
         if( nodes.size() > 0 ) {
             for( Iterator< Element > i = nodes.iterator(); i.hasNext(); ) {
                 Element f = i.next();
@@ -333,67 +386,86 @@ public final class ClassUtil {
     public static Object getMappedObject( String requestedClass, Object... initargs )
         throws WikiException
     {
-        try
-        {
-            Class<?> cl = getMappedClass( requestedClass );
-         
-            Constructor<?>[] ctors = cl.getConstructors();
-            
-            //
-            //  Try to find the proper constructor by comparing the
-            //  initargs array classes and the constructor types.
-            //
-            for( int c = 0; c < ctors.length; c++ )
-            {
-                Class<?>[] params = ctors[c].getParameterTypes();
-                
-                if( params.length == initargs.length )
-                {
-                    for( int arg = 0; arg < initargs.length; arg++ )
-                    {
-                        if( params[arg].isAssignableFrom(initargs[arg].getClass()))
-                        {
-                            //
-                            //  Ha, found it!  Instantiating and returning...
-                            //
-                            return ctors[c].newInstance(initargs);
-                        }
-                    }
-                }
-            }
-            
-            //
-            //  No arguments, so we can just call a default constructor and
-            //  ignore the arguments.
-            //
-            Object o = cl.newInstance();
-            
-            return o;
-        }
-        catch( InstantiationException e )
-        {
-            log.info( "Cannot instantiate requested class "+requestedClass, e );
-            
-            throw new WikiException("Failed to instantiate class "+requestedClass, e );
-        }
-        catch (IllegalAccessException e)
-        {
-            log.info( "Cannot access requested class "+requestedClass, e );
-            
-            throw new WikiException("Failed to instantiate class "+requestedClass, e );
-        }
-        catch (IllegalArgumentException e)
-        {
-            log.info( "Illegal arguments when constructing new object", e );
-            
-            throw new WikiException("Failed to instantiate class "+requestedClass, e );
-        }
-        catch (InvocationTargetException e)
-        {
-            log.info( "You tried to instantiate an abstract class "+requestedClass, e );
-            
-            throw new WikiException("Failed to instantiate class "+requestedClass, e );
-        }
+    	try {
+    		Object o = ClassUtil.getPicoContainer().getComponent(Class.forName(requestedClass));
+        	WikiEngine engine = null;
+        	Properties props = new Properties();
+			for (int i = 0; i < initargs.length; i++) {
+				if (initargs[i] instanceof WikiEngine) {
+					engine = (WikiEngine)initargs[i];
+				}
+				if (initargs[i] instanceof Properties) {
+					props = (Properties)initargs[i];
+				}
+			}
+			if (engine != null && o instanceof InternalModule) {
+				((InternalModule)o).initialize(engine, props);
+            }
+    		return o;
+    	} catch (ClassNotFoundException e) {
+    		throw new WikiException(e.getMessage());
+    	}
+//        try
+//        {
+//            Class<?> cl = getMappedClass( requestedClass );
+//         
+//            Constructor<?>[] ctors = cl.getConstructors();
+//            
+//            //
+//            //  Try to find the proper constructor by comparing the
+//            //  initargs array classes and the constructor types.
+//            //
+//            for( int c = 0; c < ctors.length; c++ )
+//            {
+//                Class<?>[] params = ctors[c].getParameterTypes();
+//                
+//                if( params.length == initargs.length )
+//                {
+//                    for( int arg = 0; arg < initargs.length; arg++ )
+//                    {
+//                        if( params[arg].isAssignableFrom(initargs[arg].getClass()))
+//                        {
+//                            //
+//                            //  Ha, found it!  Instantiating and returning...
+//                            //
+//                            return ctors[c].newInstance(initargs);
+//                        }
+//                    }
+//                }
+//            }
+//            
+//            //
+//            //  No arguments, so we can just call a default constructor and
+//            //  ignore the arguments.
+//            //
+//            Object o = cl.newInstance();
+//            
+//            return o;
+//        }
+//        catch( InstantiationException e )
+//        {
+//            log.info( "Cannot instantiate requested class "+requestedClass, e );
+//            
+//            throw new WikiException("Failed to instantiate class "+requestedClass, e );
+//        }
+//        catch (IllegalAccessException e)
+//        {
+//            log.info( "Cannot access requested class "+requestedClass, e );
+//            
+//            throw new WikiException("Failed to instantiate class "+requestedClass, e );
+//        }
+//        catch (IllegalArgumentException e)
+//        {
+//            log.info( "Illegal arguments when constructing new object", e );
+//            
+//            throw new WikiException("Failed to instantiate class "+requestedClass, e );
+//        }
+//        catch (InvocationTargetException e)
+//        {
+//            log.info( "You tried to instantiate an abstract class "+requestedClass, e );
+//            
+//            throw new WikiException("Failed to instantiate class "+requestedClass, e );
+//        }
     }
 
     /**
@@ -427,4 +499,8 @@ public final class ClassUtil {
             throw new WikiException("Failed to instantiate class "+requestedClass, e );
         }
     }
+    
+    public static PicoContainer getPicoContainer() {
+		return picoContainer;
+	}
 }

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/workflow/WorkflowManager.java Tue Jun 23 10:52:18 2015
@@ -36,6 +36,7 @@ import org.apache.wiki.auth.acl.Unresolv
 import org.apache.wiki.event.WikiEvent;
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.event.WorkflowEvent;
+import org.apache.wiki.modules.InternalModule;
 
 
 /**
@@ -45,7 +46,7 @@ import org.apache.wiki.event.WorkflowEve
  * Workflows.
  * </p>
  */
-public class WorkflowManager implements WikiEventListener {
+public class WorkflowManager implements WikiEventListener, InternalModule {
 
     private final DecisionQueue m_queue = new DecisionQueue();
 

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PageManagerTest.java Tue Jun 23 10:52:18 2015
@@ -26,7 +26,10 @@ import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 import org.apache.log4j.PropertyConfigurator;
+import org.apache.wiki.api.engine.FilterManager;
+import org.apache.wiki.filters.DefaultFilterManager;
 import org.apache.wiki.providers.CachingProvider;
+import org.apache.wiki.util.ClassUtil;
 
 public class PageManagerTest extends TestCase
 {
@@ -54,7 +57,7 @@ public class PageManagerTest extends Tes
         throws Exception
     {
         props.setProperty( "jspwiki.usePageCache", "true" );
-        PageManager m = new PageManager( engine, props );
+        PageManager m = (PageManager)ClassUtil.getMappedObject(PageManager.class.getName(), engine, props);
 
         assertTrue( m.getProvider() instanceof CachingProvider );
     }
@@ -63,7 +66,7 @@ public class PageManagerTest extends Tes
         throws Exception
     {
         props.setProperty( "jspwiki.usePageCache", "false" );
-        PageManager m = new PageManager( engine, props );
+        PageManager m = (PageManager)ClassUtil.getMappedObject(PageManager.class.getName(), engine, props);
 
         assertTrue( !(m.getProvider() instanceof CachingProvider) );
     }

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/PropertyReaderTest.java Tue Jun 23 10:52:18 2015
@@ -20,6 +20,7 @@ package org.apache.wiki;
 
 import java.util.Properties;
 
+import org.apache.wiki.providers.AbstractFileProvider;
 import org.apache.wiki.util.PropertyReader;
 
 import junit.framework.Test;
@@ -34,16 +35,16 @@ public class PropertyReaderTest extends
         
         p.put("var.basedir", "/p/mywiki");
 
-        p.put("jspwiki.fileSystemProvider.pageDir", "$basedir/www/");
+        p.put(AbstractFileProvider.PROP_PAGEDIR, "$basedir/www/");
         p.put("jspwiki.basicAttachmentProvider.storageDir", "$basedir/www/");
         p.put("jspwiki.workDir", "$basedir/wrk/");
         p.put("jspwiki.xyz", "test basedir"); //don't touch this
 
         PropertyReader.expandVars(p);
         
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/") );
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/") );
         assertTrue( p.getProperty("jspwiki.basicAttachmentProvider.storageDir").equals("/p/mywiki/www/") );
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/") );
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/") );
         assertTrue( p.getProperty("jspwiki.workDir").endsWith("/p/mywiki/wrk/") );
         assertTrue( p.getProperty("jspwiki.xyz").endsWith("test basedir") ); //don't touch this
         
@@ -59,7 +60,7 @@ public class PropertyReaderTest extends
         //this time, declare the var at the end... (should overwrite this one);
         p.put("var.basedir", "xxx");
         
-        p.put("jspwiki.fileSystemProvider.pageDir", "$basedir/www/");
+        p.put(AbstractFileProvider.PROP_PAGEDIR, "$basedir/www/");
         p.put("jspwiki.basicAttachmentProvider.storageDir", "$basedir/www/");
         p.put("jspwiki.workDir", "$basedir/wrk/");
         p.put("jspwiki.xyz", "test basedir"); //don't touch this
@@ -70,9 +71,9 @@ public class PropertyReaderTest extends
         
         PropertyReader.expandVars(p);
         
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/") );
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/") );
         assertTrue( p.getProperty("jspwiki.basicAttachmentProvider.storageDir").equals("/p/mywiki/www/") );
-        assertTrue( p.getProperty("jspwiki.fileSystemProvider.pageDir").equals("/p/mywiki/www/") );
+        assertTrue( p.getProperty(AbstractFileProvider.PROP_PAGEDIR).equals("/p/mywiki/www/") );
         assertTrue( p.getProperty("jspwiki.workDir").endsWith("/p/mywiki/wrk/") );
         assertTrue( p.getProperty("jspwiki.xyz").endsWith("test basedir") ); //don't touch this
         

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/TestEngine.java Tue Jun 23 10:52:18 2015
@@ -130,7 +130,7 @@ public class TestEngine extends WikiEngi
         ServletContext servletContext = this.getServletContext();
         servletContext.setAttribute("org.apache.wiki.WikiEngine", this);
     }
-
+    
     /**
      * Creates a correctly-instantiated mock HttpServletRequest with an associated
      * HttpSession.
@@ -410,11 +410,13 @@ public class TestEngine extends WikiEngi
      */
     private static Properties cleanTestProps( Properties props )
     {
-        String pageDir = props.getProperty( "jspwiki.fileSystemProvider.pageDir" );
+        String pageDir = props.getProperty( AbstractFileProvider.PROP_PAGEDIR );
         props.put( AuthenticationManager.PROP_LOGIN_THROTTLING, "false" );
-        props.setProperty( "jspwiki.fileSystemProvider.pageDir",
-                           pageDir.replaceAll( "\\d", StringUtils.EMPTY )
-                           + System.currentTimeMillis() );
+        if (pageDir != null) {
+	        props.setProperty( AbstractFileProvider.PROP_PAGEDIR,
+	                           pageDir // TODO: Is this really required? .replaceAll( "\\d", StringUtils.EMPTY )
+	                           + System.currentTimeMillis() );
+        }
         return props;
     }
 

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/VariableManagerTest.java Tue Jun 23 10:52:18 2015
@@ -45,7 +45,7 @@ public class VariableManagerTest extends
         Properties props = TestEngine.getTestProperties();
         PropertyConfigurator.configure(props);
 
-        m_variableManager = new VariableManager( props );
+        m_variableManager = new VariableManager( );
         TestEngine testEngine = new TestEngine( props );
         m_context = new WikiContext( testEngine,
                                      new WikiPage( testEngine, PAGE_NAME ) );

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/filters/DefaultFilterManagerTest.java Tue Jun 23 10:52:18 2015
@@ -47,8 +47,9 @@ public class DefaultFilterManagerTest ex
     }
 
     public void testInitFilters() throws Exception {
-        FilterManager m = new DefaultFilterManager( engine, props );
-
+        DefaultFilterManager m = new DefaultFilterManager( );
+        m.initialize(engine, props);
+        
         List l = m.getFilterList();
 
         assertEquals("Wrong number of filters", 2, l.size());
@@ -64,7 +65,8 @@ public class DefaultFilterManagerTest ex
     }
 
     public void testInitParams() throws Exception {
-        FilterManager m = new DefaultFilterManager( engine, props );
+        DefaultFilterManager m = new DefaultFilterManager( );
+        m.initialize(engine, props);
 
         List l = m.getFilterList();
 

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/i18n/InternationalizationManagerTest.java Tue Jun 23 10:52:18 2015
@@ -24,7 +24,7 @@ import junit.framework.TestCase;
 
 public class InternationalizationManagerTest extends TestCase
 {
-    InternationalizationManager i18n = new InternationalizationManager( null );
+    InternationalizationManager i18n = new InternationalizationManager( );
     
     protected void setUp() throws Exception
     {

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/DefaultPluginManagerTest.java Tue Jun 23 10:52:18 2015
@@ -53,7 +53,8 @@ public class DefaultPluginManagerTest ex
     {
         engine = new TestEngine(props);
         context = new WikiContext( engine, new WikiPage(engine, "Testpage") );
-        manager = new DefaultPluginManager( engine, props );
+        manager = new DefaultPluginManager();
+        manager.initialize(engine, props);
     }
 
     public void tearDown() throws ProviderException
@@ -86,7 +87,8 @@ public class DefaultPluginManagerTest ex
         throws Exception
     {
         props.setProperty( DefaultPluginManager.PROP_SEARCHPATH, "com.foo" );
-        DefaultPluginManager m = new DefaultPluginManager( engine, props );
+        DefaultPluginManager m = new DefaultPluginManager( );
+        m.initialize(engine, props);
         String res = m.execute( context,
                                 "{INSERT SamplePlugin2 WHERE text=foobar}");
 
@@ -98,7 +100,8 @@ public class DefaultPluginManagerTest ex
         throws Exception
     {
         props.setProperty( DefaultPluginManager.PROP_SEARCHPATH, "com.foo" );
-        DefaultPluginManager m = new DefaultPluginManager( engine, props );
+        DefaultPluginManager m = new DefaultPluginManager( );
+        m.initialize(engine, props);
         String res = m.execute( context,
                                 "{INSERT SamplePlugin3 WHERE text=foobar}");
 
@@ -111,7 +114,8 @@ public class DefaultPluginManagerTest ex
         throws Exception
     {
         props.setProperty( DefaultPluginManager.PROP_SEARCHPATH, "com.foo,blat.blaa" );
-        DefaultPluginManager m = new DefaultPluginManager( engine, props );
+        DefaultPluginManager m = new DefaultPluginManager(  );
+        m.initialize(engine, props);
         String res = m.execute( context,
                                 "{INSERT SamplePlugin WHERE text=foobar}");
 

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/PageViewPluginTest.java Tue Jun 23 10:52:18 2015
@@ -29,6 +29,7 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.util.ClassUtil;
 
 public class PageViewPluginTest extends TestCase
 
@@ -55,7 +56,7 @@ public class PageViewPluginTest extends
         testEngine.saveText( "TestPage01", "this is test page 01 [{PageViewPlugin}]" );
         testEngine.saveText( "TestPage02", "this is test page 02 [{PageViewPlugin}]" );
 
-        manager = new DefaultPluginManager( testEngine, props );
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(), testEngine, props);
     }
 
     public void tearDown()

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/RecentChangesPluginTest.java Tue Jun 23 10:52:18 2015
@@ -30,6 +30,7 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.util.ClassUtil;
 
 public class RecentChangesPluginTest extends TestCase {
     Properties props = TestEngine.getTestProperties();
@@ -49,7 +50,7 @@ public class RecentChangesPluginTest ext
         testEngine.saveText("TestPage03", "Some Text for testing 03");
         testEngine.saveText("TestPage04", "Some Text for testing 04");
 
-        manager = new DefaultPluginManager(testEngine, props);
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(), testEngine, props);
     }
 
     public void tearDown() {

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringPagesPluginTest.java Tue Jun 23 10:52:18 2015
@@ -31,6 +31,7 @@ import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.util.ClassUtil;
 
 public class ReferringPagesPluginTest extends TestCase
 {
@@ -60,7 +61,7 @@ public class ReferringPagesPluginTest ex
         engine.saveText( "Foobar7", "Reference to [TestPage]." );
 
         context = new WikiContext( engine, engine.newHttpRequest(), new WikiPage(engine,"TestPage") );
-        manager = new DefaultPluginManager( engine, props );
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(), engine, props);
     }
 
     public void tearDown()

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/ReferringUndefinedPagesPluginTest.java Tue Jun 23 10:52:18 2015
@@ -30,6 +30,7 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.util.ClassUtil;
 
 public class ReferringUndefinedPagesPluginTest extends TestCase {
     Properties props = TestEngine.getTestProperties();
@@ -49,7 +50,8 @@ public class ReferringUndefinedPagesPlug
 		testEngine.saveText("TestPage03", "Some Text for testing 03 which refers [NonExistingPageC] ");
 
         context = new WikiContext( testEngine, testEngine.newHttpRequest(), new WikiPage(testEngine,"TestPage") );
-        manager = new DefaultPluginManager( testEngine, props );	}
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(), testEngine, props);
+	}
 
 	public void tearDown() {
 		testEngine.deleteTestPage("TestPage01");

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/plugin/UndefinedPagesPluginTest.java Tue Jun 23 10:52:18 2015
@@ -31,6 +31,7 @@ import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.engine.PluginManager;
 import org.apache.wiki.api.exceptions.PluginException;
+import org.apache.wiki.util.ClassUtil;
 
 public class UndefinedPagesPluginTest extends TestCase
 {
@@ -54,7 +55,7 @@ public class UndefinedPagesPluginTest ex
         testEngine.saveText( "Foobar", "Reference to [Foobar 2], [Foobars]" );
 
         context = new WikiContext( testEngine, new WikiPage(testEngine, "TestPage") );
-        manager = new DefaultPluginManager( testEngine, props );
+        manager = (PluginManager)ClassUtil.getMappedObject(DefaultPluginManager.class.getName(), testEngine, props);
     }
 
     public void tearDown()

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java Tue Jun 23 10:52:18 2015
@@ -30,6 +30,7 @@ import net.sourceforge.stripes.mock.Mock
 
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiContext;
+import org.apache.wiki.providers.AbstractFileProvider;
 
 public class SearchManagerTest extends TestCase {
 	
@@ -42,12 +43,12 @@ public class SearchManagerTest extends T
     protected void setUp() throws Exception {
         Properties props = TestEngine.getTestProperties();
         String workDir = props.getProperty( "jspwiki.workDir" );
-        String workRepo = props.getProperty( "jspwiki.fileSystemProvider.pageDir" );
+        String workRepo = props.getProperty( AbstractFileProvider.PROP_PAGEDIR );
         
         props.setProperty( SearchManager.PROP_SEARCHPROVIDER, "LuceneSearchProvider" );
         props.setProperty( "jspwiki.lucene.initialdelay", "1" );
         props.setProperty( "jspwiki.workDir", workDir + System.currentTimeMillis() );
-        props.setProperty( "jspwiki.fileSystemProvider.pageDir", workRepo + System.currentTimeMillis() );
+        props.setProperty( AbstractFileProvider.PROP_PAGEDIR, workRepo + System.currentTimeMillis() );
 
         CacheManager.getInstance().removeAllCaches();
         m_engine = new TestEngine( props );

Modified: jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java (original)
+++ jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/util/TextUtilTest.java Tue Jun 23 10:52:18 2015
@@ -26,6 +26,7 @@ import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
+import org.apache.wiki.providers.AbstractFileProvider;
 
 public class TextUtilTest extends TestCase
 {
@@ -414,9 +415,9 @@ public class TextUtilTest extends TestCa
 
     public void testGetCanonicalFilePathProperty()
     {
-        String[] values = { "jspwiki.fileSystemProvider.pageDir", " ." + File.separator + "data" + File.separator + "private " };
+        String[] values = { AbstractFileProvider.PROP_PAGEDIR, " ." + File.separator + "data" + File.separator + "private " };
         Properties props = TextUtil.createProperties(values);
-        String path = TextUtil.getCanonicalFilePathProperty(props, "jspwiki.fileSystemProvider.pageDir", "NA");
+        String path = TextUtil.getCanonicalFilePathProperty(props, AbstractFileProvider.PROP_PAGEDIR, "NA");
         assertTrue( path.endsWith( File.separator + "data" + File.separator + "private" ) );
         assertFalse( path.endsWith( "." + File.separator + "data" + File.separator + "private" ) );
     }
@@ -426,7 +427,7 @@ public class TextUtilTest extends TestCa
         String defaultValue = System.getProperty( "user.home" ) + File.separator + "jspwiki-files";
         String[] values = {};
         Properties props = TextUtil.createProperties(values);
-        String path = TextUtil.getCanonicalFilePathProperty(props, "jspwiki.fileSystemProvider.pageDir", defaultValue);
+        String path = TextUtil.getCanonicalFilePathProperty(props, AbstractFileProvider.PROP_PAGEDIR, defaultValue);
         assertTrue(path.endsWith("jspwiki-files"));
     }
 

Modified: jspwiki/trunk/pom.xml
URL: http://svn.apache.org/viewvc/jspwiki/trunk/pom.xml?rev=1687020&r1=1687019&r2=1687020&view=diff
==============================================================================
--- jspwiki/trunk/pom.xml (original)
+++ jspwiki/trunk/pom.xml Tue Jun 23 10:52:18 2015
@@ -90,6 +90,13 @@
         <artifactId>commons-io</artifactId>
         <version>2.4</version>
       </dependency>
+      
+		<dependency>
+			<groupId>org.picocontainer</groupId>
+			<artifactId>picocontainer</artifactId>
+			<version>2.15</version>
+		</dependency>
+
 
       <dependency>
         <groupId>commons-lang</groupId>



Mime
View raw message