jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvit...@apache.org
Subject svn commit: r1688324 - in /jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src: main/java/org/apache/wiki/ main/java/org/apache/wiki/attachment/ main/java/org/apache/wiki/auth/ main/java/org/apache/wiki/auth/authorize/ main/java/org/apache/wiki/a...
Date Mon, 29 Jun 2015 22:52:01 GMT
Author: dvittor
Date: Mon Jun 29 22:52:01 2015
New Revision: 1688324

URL: http://svn.apache.org/r1688324
Log:
WikiProvider accessed from ClassUtil

Modified:
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/AbstractUserDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/UserDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ContextualDiffProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DiffProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ExternalDiffProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/TraditionalDiffProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/BasicAttachmentProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingAttachmentProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/BasicSearchProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/LuceneSearchProvider.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java
    jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/providers/FileSystemProviderTest.java

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/PageManager.java Mon Jun 29 22:52:01 2015
@@ -18,7 +18,6 @@
  */
 package org.apache.wiki;
 
-import java.io.IOException;
 import java.security.Permission;
 import java.security.Principal;
 import java.util.ArrayList;
@@ -32,7 +31,6 @@ import java.util.Properties;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.wiki.api.engine.FilterManager;
-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.auth.WikiPrincipal;
@@ -178,37 +176,40 @@ public class PageManager extends ModuleM
         //
         //  If user wants to use a cache, then we'll use the CachingProvider.
         //
-        String classname;
+        String providerClassName;
         if (useCache) {
-            classname = "org.apache.wiki.providers.CachingProvider";
+            providerClassName = "org.apache.wiki.providers.CachingProvider";
         } else {
-            classname = TextUtil.getRequiredProperty(props, PROP_PAGEPROVIDER);
+            providerClassName = TextUtil.getRequiredProperty(props, PROP_PAGEPROVIDER);
         }
 
+        m_provider = ClassUtil.getWikiProvider(WikiPageProvider.class, engine, props, "org.apache.wiki.providers", providerClassName, null, true);
+        
+        /*
         try {
-            log.debug("Page provider class: '" + classname + "'");
-            Class<?> providerclass = ClassUtil.findClass("org.apache.wiki.providers", classname);
+            log.debug("Page provider class: '" + providerClassName + "'");
+            Class<?> providerclass = ClassUtil.findClass("org.apache.wiki.providers", providerClassName);
             m_provider = (WikiPageProvider) providerclass.newInstance();
 
             log.debug("Initializing page provider class " + m_provider);
             m_provider.initialize(m_engine, props);
         } catch (ClassNotFoundException e) {
-            log.error("Unable to locate provider class '" + classname + "' (" + e.getMessage() + ")", e);
+            log.error("Unable to locate provider class '" + providerClassName + "' (" + e.getMessage() + ")", e);
             throw new WikiException("No provider class. (" + e.getMessage() + ")", e);
         } catch (InstantiationException e) {
-            log.error("Unable to create provider class '" + classname + "' (" + e.getMessage() + ")", e);
+            log.error("Unable to create provider class '" + providerClassName + "' (" + e.getMessage() + ")", e);
             throw new WikiException("Faulty provider class. (" + e.getMessage() + ")", e);
         } catch (IllegalAccessException e) {
-            log.error("Illegal access to provider class '" + classname + "' (" + e.getMessage() + ")", e);
+            log.error("Illegal access to provider class '" + providerClassName + "' (" + e.getMessage() + ")", e);
             throw new WikiException("Illegal provider class. (" + e.getMessage() + ")", e);
         } catch (NoRequiredPropertyException e) {
             log.error("Provider did not found a property it was looking for: " + e.getMessage(), e);
             throw e;  // Same exception works.
         } catch (IOException e) {
-            log.error("An I/O exception occurred while trying to create a new page provider: " + classname, e);
+            log.error("An I/O exception occurred while trying to create a new page provider: " + providerClassName, e);
             throw new WikiException("Unable to start page provider: " + e.getMessage(), e);
         }
-
+		*/
     }
 
     /**

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiEngine.java Mon Jun 29 22:52:01 2015
@@ -81,6 +81,7 @@ import org.apache.wiki.ui.CommandResolve
 import org.apache.wiki.ui.EditorManager;
 import org.apache.wiki.ui.TemplateManager;
 import org.apache.wiki.ui.progress.ProgressManager;
+import org.apache.wiki.url.DefaultURLConstructor;
 import org.apache.wiki.url.URLConstructor;
 import org.apache.wiki.util.ClassUtil;
 import org.apache.wiki.util.PropertyReader;
@@ -539,27 +540,24 @@ public class WikiEngine
         try
         {
             Class< ? > urlclass = ClassUtil.findClass( "org.apache.wiki.url",
-                    TextUtil.getStringProperty( props, PROP_URLCONSTRUCTOR, "DefaultURLConstructor" ) );
+                    TextUtil.getStringProperty( props, PROP_URLCONSTRUCTOR, DefaultURLConstructor.class.getName() ) );
             m_urlConstructor = (URLConstructor) urlclass.newInstance();
             m_urlConstructor.initialize( this, props );
             
-            m_pageSorter        = ClassUtil.getInternalModule(PageSorter.class, this, props );
-            m_pageManager       = ClassUtil.getInternalModule(PageManager.class, this, props );
-            m_pluginManager     = ClassUtil.getInternalModule(PluginManager.class, this, props );
-            m_differenceManager = ClassUtil.getInternalModule(DifferenceManager.class, this, props );
-            m_attachmentManager = ClassUtil.getInternalModule(AttachmentManager.class, this, props );
-            m_variableManager   = ClassUtil.getInternalModule(VariableManager.class, this, props );
-            m_filterManager     = ClassUtil.getInternalModule(FilterManager.class, this, props );
-            m_renderingManager  = ClassUtil.getInternalModule(RenderingManager.class, this, props );
-
-            m_searchManager     = ClassUtil.getInternalModule(SearchManager.class, this, props );
-
+            m_pageSorter            = ClassUtil.getInternalModule(PageSorter.class, this, props );
+            m_pageManager           = ClassUtil.getInternalModule(PageManager.class, this, props );
+            m_pluginManager         = ClassUtil.getInternalModule(PluginManager.class, this, props );
+            m_differenceManager     = ClassUtil.getInternalModule(DifferenceManager.class, this, props );
+            m_attachmentManager     = ClassUtil.getInternalModule(AttachmentManager.class, this, props );
+            m_variableManager       = ClassUtil.getInternalModule(VariableManager.class, this, props );
+            m_filterManager         = ClassUtil.getInternalModule(FilterManager.class, this, props );
+            m_renderingManager      = ClassUtil.getInternalModule(RenderingManager.class, this, props );
+            m_searchManager         = ClassUtil.getInternalModule(SearchManager.class, this, props );
             m_authenticationManager = ClassUtil.getInternalModule(AuthenticationManager.class, this, props );
             m_authorizationManager  = ClassUtil.getInternalModule(AuthorizationManager.class, this, props );
             m_userManager           = ClassUtil.getInternalModule(UserManager.class, this, props );
             m_groupManager          = ClassUtil.getInternalModule(GroupManager.class, this, props );
-
-            m_editorManager     = ClassUtil.getInternalModule(EditorManager.class, this , props );
+            m_editorManager         = ClassUtil.getInternalModule(EditorManager.class, this , props );
 
             m_progressManager   = new ProgressManager();
 
@@ -568,13 +566,13 @@ public class WikiEngine
             m_aclManager = getAclManager();
 
             // Start the Workflow manager
-            m_workflowMgr = ClassUtil.getInternalModule(WorkflowManager.class, this, props);
+            m_workflowMgr           = ClassUtil.getInternalModule(WorkflowManager.class, this, props);
 
             m_internationalizationManager = ClassUtil.getInternalModule(InternationalizationManager.class, this, props);
 
-            m_templateManager   = ClassUtil.getInternalModule(TemplateManager.class, this, props );
+            m_templateManager       = ClassUtil.getInternalModule(TemplateManager.class, this, props );
 
-            m_adminBeanManager = ClassUtil.getInternalModule(AdminBeanManager.class,this, props);
+            m_adminBeanManager      = ClassUtil.getInternalModule(AdminBeanManager.class,this, props);
 
             // Since we want to use a page filters initilize() method
             // as a engine startup listener where we can initialize global event listeners,
@@ -625,13 +623,13 @@ public class WikiEngine
             log.fatal( "JSPWiki could not start, URLConstructor cannot be accessed: " + e.getMessage(), e );
             throw new WikiException(e.getMessage(), e );
         }
-//        catch( Exception e )
-//        {
-//            // Final catch-all for everything
-//            log.fatal( "JSPWiki could not start, due to an unknown exception when starting.",e );
-//            throw new WikiException( "Failed to start. Caused by: " + e.getMessage() + 
-//                                     "; please check log files for better information.", e );
-//        }
+        catch( Exception e )
+        {
+            // Final catch-all for everything
+            log.fatal( "JSPWiki could not start, due to an unknown exception when starting.",e );
+            throw new WikiException( "Failed to start. Caused by: " + e.getMessage() + 
+                                     "; please check log files for better information.", e );
+        }
         
         //
         //  Initialize the good-to-have-but-not-fatal modules.
@@ -2317,14 +2315,19 @@ public class WikiEngine
         {
             try
             {
-                String s = m_properties.getProperty( PROP_ACL_MANAGER_IMPL,
-                                                     DefaultAclManager.class.getName() );
-                m_aclManager = (AclManager)ClassUtil.getMappedObject(s); // TODO: I am not sure whether this is the right call
-                m_aclManager.initialize( this, m_properties );
+                String providerClassName = TextUtil.getStringProperty( m_properties, PROP_ACL_MANAGER_IMPL, DefaultAclManager.class.getName() );
+                Class<AclManager> aclclass = (Class<AclManager>) ClassUtil.findClass("org.apache.wiki.auth.acl", providerClassName);
+                m_aclManager = ClassUtil.getInternalModule(aclclass, this, m_properties);
+//                m_aclManager = (AclManager)ClassUtil.getMappedObject(classname, this, m_properties); // TODO: I am not sure whether this is the right call
+            }
+            catch ( ClassNotFoundException e )
+            {
+                log.fatal( "unable to find class for AclManager: " + e.getMessage() );
+                throw new InternalWikiException("Cannot find AclManager, please check logs.");
             }
-            catch ( WikiException we )
+            catch ( WikiException e )
             {
-                log.fatal( "unable to instantiate class for AclManager: " + we.getMessage() );
+                log.fatal( "unable to instantiate class for AclManager: " + e.getMessage() );
                 throw new InternalWikiException("Cannot instantiate AclManager, please check logs.");
             }
         }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/WikiProvider.java Mon Jun 29 22:52:01 2015
@@ -22,6 +22,7 @@ import java.util.Properties;
 import java.io.IOException;
 
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
+import org.apache.wiki.api.exceptions.WikiException;
 
 /**
  *  A generic Wiki provider for all sorts of things that the Wiki can
@@ -46,7 +47,7 @@ public interface WikiProvider
      */
     void initialize( WikiEngine engine, Properties properties )
         throws NoRequiredPropertyException,
-               IOException;
+               WikiException;
 
     /**
      *  Return a valid HTML string for information.  May

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentManager.java Mon Jun 29 22:52:01 2015
@@ -42,7 +42,6 @@ import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiInternalModule;
 import org.apache.wiki.WikiPage;
 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.parser.MarkupParser;
@@ -91,8 +90,6 @@ public class AttachmentManager extends W
     private PageSorter             m_pageSorter;
     private CacheManager m_cacheManager = CacheManager.getInstance();
     
-    private boolean initialized = false;
-
     private Cache m_dynamicAttachments;
     /** Name of the page cache. */
     public static final String CACHE_NAME = "jspwiki.dynamicAttachmentCache";
@@ -133,20 +130,17 @@ public class AttachmentManager extends W
         //  If user wants to use a cache, then we'll use the CachingProvider.
         //
         boolean useCache = "true".equals(props.getProperty( PageManager.PROP_USECACHE ));
-        String classname;
-        if( useCache )
-        {
-            classname = CachingAttachmentProvider.class.getName();
-        }
-        else
-        {
-            classname = props.getProperty( PROP_PROVIDER );
+        String providerClassName;
+        if( useCache ) {
+            providerClassName = CachingAttachmentProvider.class.getName();
+        } else {
+            providerClassName = props.getProperty( PROP_PROVIDER );
         }
 
         //
         //  If no class defined, then will just simply fail.
         //
-        if( classname == null )
+        if( providerClassName == null )
         {
             log.info( "No attachment provider defined - disabling attachment support." );
             return;
@@ -156,22 +150,23 @@ public class AttachmentManager extends W
         //  Create and initialize the provider.
         //
         String cacheName = engine.getApplicationName() + "." + CACHE_NAME;
+        if (m_cacheManager.cacheExists(cacheName)) {
+            m_dynamicAttachments = m_cacheManager.getCache(cacheName);
+        } else {
+            log.info("cache with name " + cacheName + " not found in ehcache.xml, creating it with defaults.");
+            m_dynamicAttachments = new Cache(cacheName, DEFAULT_CACHECAPACITY, false, false, 0, 0);
+            m_cacheManager.addCache(m_dynamicAttachments);
+        }
+        
+        m_provider = ClassUtil.getWikiProvider(WikiAttachmentProvider.class, engine, props, "org.apache.wiki.providers", providerClassName, null, true);
+        /*
         try {
-            if (m_cacheManager.cacheExists(cacheName)) {
-                m_dynamicAttachments = m_cacheManager.getCache(cacheName);
-            } else {
-                log.info("cache with name " + cacheName + " not found in ehcache.xml, creating it with defaults.");
-                m_dynamicAttachments = new Cache(cacheName, DEFAULT_CACHECAPACITY, false, false, 0, 0);
-                m_cacheManager.addCache(m_dynamicAttachments);
-            }
-
-            Class<?> providerclass = ClassUtil.findClass("org.apache.wiki.providers", classname);
-
+            Class<?> providerclass = ClassUtil.findClass("org.apache.wiki.providers", providerClassName);
+            
             m_provider = (WikiAttachmentProvider) providerclass.newInstance();
 
             m_provider.initialize(engine, props);
             
-            initialized = true;
         } catch( ClassNotFoundException e )
         {
             log.error( "Attachment provider class not found",e);
@@ -194,13 +189,9 @@ public class AttachmentManager extends W
             log.error( "Attachment provider reports IO error", e );
             m_provider = null;
         }
+        */
     }
     
-    @Override
-    public boolean isInitialized() {
-    	return initialized;
-    }
-
     /**
      *  Returns true, if attachments are enabled and running.
      *

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/UserManager.java Mon Jun 29 22:52:01 2015
@@ -724,6 +724,11 @@ public class UserManager extends WikiInt
         {
         }
 
+		@Override
+		public String getProviderInfo() {
+			return getClass().getName();
+		}
+
     }
 
     // workflow task inner classes....................................................

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/GroupDatabase.java Mon Jun 29 22:52:01 2015
@@ -22,6 +22,7 @@ import java.security.Principal;
 import java.util.Properties;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.auth.WikiSecurityException;
 
@@ -29,7 +30,7 @@ import org.apache.wiki.auth.WikiSecurity
  * Defines an interface for loading, persisting and storing wiki groups.
  * @since 2.4.22
  */
-public interface GroupDatabase
+public interface GroupDatabase extends WikiProvider
 {
     /**
      * No-op method that in previous versions of JSPWiki was intended to 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/JDBCGroupDatabase.java Mon Jun 29 22:52:01 2015
@@ -694,4 +694,9 @@ public class JDBCGroupDatabase implement
 		}
 	}
 
+	@Override
+	public String getProviderInfo() {
+		return getClass().getName();
+	}
+
 }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java Mon Jun 29 22:52:01 2015
@@ -39,16 +39,16 @@ import javax.xml.parsers.ParserConfigura
 
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.log4j.Logger;
-import org.apache.wiki.util.TextUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.auth.NoSuchPrincipalException;
 import org.apache.wiki.auth.WikiPrincipal;
 import org.apache.wiki.auth.WikiSecurityException;
+import org.apache.wiki.util.TextUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
 
 /**
  * <p>
@@ -470,4 +470,9 @@ public class XMLGroupDatabase implements
         }
     }
 
+	@Override
+	public String getProviderInfo() {
+		return getClass().getName();
+	}
+
 }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/AbstractUserDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/AbstractUserDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/AbstractUserDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/AbstractUserDatabase.java Mon Jun 29 22:52:01 2015
@@ -28,6 +28,7 @@ import java.util.UUID;
 
 import org.apache.log4j.Logger;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiInternalModule;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.auth.NoSuchPrincipalException;
 import org.apache.wiki.auth.WikiPrincipal;
@@ -40,7 +41,7 @@ import org.apache.wiki.util.CryptoUtil;
  * profiles, building Principal collections and hashing passwords.
  * @since 2.3
  */
-public abstract class AbstractUserDatabase implements UserDatabase
+public abstract class AbstractUserDatabase extends WikiInternalModule implements UserDatabase
 {
 
     protected static final Logger log = Logger.getLogger( AbstractUserDatabase.class );

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/JDBCUserDatabase.java Mon Jun 29 22:52:01 2015
@@ -565,6 +565,7 @@ public class JDBCUserDatabase extends Ab
             {
             }
         }
+        initialized = true;
         log.info( "JDBCUserDatabase initialized from JNDI DataSource: " + jndiName );
 
         // Determine if the datasource supports commits
@@ -933,4 +934,9 @@ public class JDBCUserDatabase extends Ab
 
     }
 
+	@Override
+	public String getProviderInfo() {
+		return getClass().getName();
+	}
+
 }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/UserDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/UserDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/UserDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/UserDatabase.java Mon Jun 29 22:52:01 2015
@@ -22,6 +22,7 @@ import java.security.Principal;
 import java.util.Properties;
 
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.auth.NoSuchPrincipalException;
 import org.apache.wiki.auth.WikiSecurityException;
@@ -30,7 +31,7 @@ import org.apache.wiki.auth.WikiSecurity
  * Defines an interface for loading, persisting and storing users.
  * @since 2.3
  */
-public interface UserDatabase
+public interface UserDatabase extends WikiProvider
 {
 
     /**

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java Mon Jun 29 22:52:01 2015
@@ -817,4 +817,9 @@ public class XMLUserDatabase extends Abs
             element.setAttribute( attribute, value );
         }
     }
+
+	@Override
+	public String getProviderInfo() {
+		return getClass().getName();
+	}
 }
\ No newline at end of file

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ContextualDiffProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ContextualDiffProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ContextualDiffProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ContextualDiffProvider.java Mon Jun 29 22:52:01 2015
@@ -19,7 +19,6 @@
 
 package org.apache.wiki.diff;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
@@ -29,6 +28,7 @@ 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.api.exceptions.WikiException;
 import org.apache.wiki.util.TextUtil;
 import org.suigeneris.jrcs.diff.Diff;
 import org.suigeneris.jrcs.diff.DifferentiationFailedException;
@@ -114,7 +114,7 @@ public class ContextualDiffProvider impl
      *      
      * {@inheritDoc}
      */
-    public void initialize(WikiEngine engine, Properties properties) throws NoRequiredPropertyException, IOException
+    public void initialize(WikiEngine engine, Properties properties) throws NoRequiredPropertyException, WikiException
     {
         String configuredLimit = properties.getProperty(PROP_UNCHANGED_CONTEXT_LIMIT, 
                                                         Integer.toString(LIMIT_MAX_VALUE));

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DiffProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DiffProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DiffProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DiffProvider.java Mon Jun 29 22:52:01 2015
@@ -18,13 +18,13 @@
  */
 package org.apache.wiki.diff;
 
-import java.io.IOException;
 import java.util.Properties;
 
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
+import org.apache.wiki.api.exceptions.WikiException;
 
 /**
  *  Provides an SPI for creating a diff between two page versions.
@@ -59,7 +59,7 @@ public interface DiffProvider extends Wi
          *  {@inheritDoc}
          */
         public void initialize(WikiEngine engine, Properties properties) 
-            throws NoRequiredPropertyException, IOException
+            throws NoRequiredPropertyException, WikiException
         {
         }
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/DifferenceManager.java Mon Jun 29 22:52:01 2015
@@ -19,16 +19,15 @@
 
 package org.apache.wiki.diff;
 
-import java.io.IOException;
 import java.util.Properties;
 
 import org.apache.log4j.Logger;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiInternalModule;
-import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.util.ClassUtil;
+import org.apache.wiki.util.TextUtil;
 
 
 /**
@@ -54,13 +53,18 @@ public class DifferenceManager extends W
     	
     	super.initialize(engine, props);
         
-    	loadProvider(props);
-
-        initializeProvider(engine, props);
+    	
+        String providerClassName = TextUtil.getStringProperty( props, PROP_DIFF_PROVIDER, TraditionalDiffProvider.class.getName());
+        m_provider = ClassUtil.getWikiProvider(DiffProvider.class, engine, props, "org.apache.wiki.diff", providerClassName, new DiffProvider.NullDiffProvider(), false);
+    	
+//    	loadProvider(props);
+//
+//        initializeProvider(engine, props);
 
         log.info("Using difference provider: " + m_provider.getProviderInfo());
     }
 
+    /*
     private void loadProvider(Properties props) {
         String providerClassName = props.getProperty(PROP_DIFF_PROVIDER,
                 TraditionalDiffProvider.class.getName());
@@ -93,6 +97,7 @@ public class DifferenceManager extends W
             m_provider = new DiffProvider.NullDiffProvider(); //doesn't need init'd
         }
     }
+    */
 
     /**
      * Returns valid XHTML string to be used in any way you please.

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ExternalDiffProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ExternalDiffProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ExternalDiffProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/ExternalDiffProvider.java Mon Jun 29 22:52:01 2015
@@ -29,6 +29,7 @@ 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.api.exceptions.WikiException;
 import org.apache.wiki.util.FileUtil;
 import org.apache.wiki.util.TextUtil;
 
@@ -84,7 +85,7 @@ public class ExternalDiffProvider implem
      * @see org.apache.wiki.WikiProvider#initialize(org.apache.wiki.WikiEngine, java.util.Properties)
      */
     public void initialize( WikiEngine engine, Properties properties )
-        throws NoRequiredPropertyException, IOException
+        throws NoRequiredPropertyException, WikiException
     {
         m_diffCommand = properties.getProperty( PROP_DIFFCOMMAND );
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/TraditionalDiffProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/TraditionalDiffProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/TraditionalDiffProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/diff/TraditionalDiffProvider.java Mon Jun 29 22:52:01 2015
@@ -19,7 +19,6 @@
 
 package org.apache.wiki.diff;
 
-import java.io.IOException;
 import java.text.ChoiceFormat;
 import java.text.Format;
 import java.text.MessageFormat;
@@ -31,6 +30,7 @@ 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.api.exceptions.WikiException;
 import org.apache.wiki.i18n.InternationalizationManager;
 import org.apache.wiki.preferences.Preferences;
 import org.apache.wiki.util.TextUtil;
@@ -81,7 +81,7 @@ public class TraditionalDiffProvider imp
      * @see org.apache.wiki.WikiProvider#initialize(org.apache.wiki.WikiEngine, java.util.Properties)
      */
     public void initialize(WikiEngine engine, Properties properties)
-        throws NoRequiredPropertyException, IOException
+        throws NoRequiredPropertyException, WikiException
     {
     }
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/AbstractFileProvider.java Mon Jun 29 22:52:01 2015
@@ -46,6 +46,7 @@ import org.apache.wiki.WikiPage;
 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.search.QueryItem;
 import org.apache.wiki.search.SearchMatcher;
 import org.apache.wiki.search.SearchResult;
@@ -122,8 +123,7 @@ public abstract class AbstractFileProvid
      *  @throws IOException In case the specified page directory is a file, not a directory.
      */
     public void initialize( WikiEngine engine, Properties properties )
-        throws NoRequiredPropertyException,
-               IOException, FileNotFoundException
+        throws NoRequiredPropertyException, WikiException
     {
         log.debug("Initing FileSystemProvider");
         m_pageDirectory = TextUtil.getCanonicalFilePathProperty(properties, PROP_PAGEDIR,
@@ -135,7 +135,7 @@ public abstract class AbstractFileProvid
         {
             if( !f.mkdirs() )
             {
-                throw new IOException( "Failed to create page directory " + f.getAbsolutePath() + " , please check property "
+                throw new WikiException( "Failed to create page directory " + f.getAbsolutePath() + " , please check property "
                                        + PROP_PAGEDIR );
             }
         }
@@ -143,11 +143,11 @@ public abstract class AbstractFileProvid
         {
             if( !f.isDirectory() )
             {
-                throw new IOException( "Page directory is not a directory: " + f.getAbsolutePath() );
+                throw new WikiException( "Page directory is not a directory: " + f.getAbsolutePath() );
             }
             if( !f.canWrite() )
             {
-                throw new IOException( "Page directory is not writable: " + f.getAbsolutePath() );
+                throw new WikiException( "Page directory is not writable: " + f.getAbsolutePath() );
             }
         }
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/BasicAttachmentProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/BasicAttachmentProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/BasicAttachmentProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/BasicAttachmentProvider.java Mon Jun 29 22:52:01 2015
@@ -43,6 +43,7 @@ import org.apache.wiki.WikiPage;
 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.attachment.Attachment;
 import org.apache.wiki.search.QueryItem;
 import org.apache.wiki.util.FileUtil;
@@ -112,8 +113,7 @@ public class BasicAttachmentProvider
      *  {@inheritDoc}
      */
     public void initialize( WikiEngine engine, Properties properties ) 
-        throws NoRequiredPropertyException,
-               IOException
+        throws NoRequiredPropertyException, WikiException
     {
         m_engine = engine;
         m_storageDir = TextUtil.getCanonicalFilePathProperty(properties, PROP_STORAGEDIR,
@@ -139,13 +139,13 @@ public class BasicAttachmentProvider
         // Some sanity checks
         //
         if( !f.exists() ) 
-            throw new IOException("Could not find or create attachment storage directory '"+m_storageDir+"'");
+            throw new WikiException("Could not find or create attachment storage directory '"+m_storageDir+"'");
 
         if( !f.canWrite() ) 
-            throw new IOException("Cannot write to the attachment storage directory '"+m_storageDir+"'");
+            throw new WikiException("Cannot write to the attachment storage directory '"+m_storageDir+"'");
         
         if( !f.isDirectory() )
-            throw new IOException("Your attachment storage points to a file, not a directory: '"+m_storageDir+"'");
+            throw new WikiException("Your attachment storage points to a file, not a directory: '"+m_storageDir+"'");
     }
 
     /**

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingAttachmentProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingAttachmentProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingAttachmentProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingAttachmentProvider.java Mon Jun 29 22:52:01 2015
@@ -20,16 +20,24 @@ package org.apache.wiki.providers;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
 
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
 
 import org.apache.log4j.Logger;
-import org.apache.wiki.*;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiPage;
+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.attachment.Attachment;
 import org.apache.wiki.attachment.AttachmentManager;
 import org.apache.wiki.search.QueryItem;
@@ -89,8 +97,7 @@ public class CachingAttachmentProvider
      * {@inheritDoc}
      */
     public void initialize( WikiEngine engine, Properties properties )
-        throws NoRequiredPropertyException,
-               IOException
+        throws NoRequiredPropertyException, WikiException
     {
         log.info("Initing CachingAttachmentProvider");
 
@@ -115,11 +122,17 @@ public class CachingAttachmentProvider
         //
         //  Find and initialize real provider.
         //
-        String classname = TextUtil.getRequiredProperty( properties, AttachmentManager.PROP_PROVIDER );
-        
+        String providerClassName = TextUtil.getRequiredProperty( properties, AttachmentManager.PROP_PROVIDER );
+        try {
+        	m_provider = ClassUtil.getWikiProvider(WikiAttachmentProvider.class, engine, properties, "org.apache.wiki.providers", providerClassName, null, true);
+        } catch (WikiException e) {
+            log.error(e,e);
+            throw new IllegalArgumentException("no provider class", e);
+        }
+        /*
         try
-        {            
-            Class<?> providerclass = ClassUtil.findClass( "org.apache.wiki.providers", classname);
+        {
+            Class<?> providerclass = ClassUtil.findClass( "org.apache.wiki.providers", providerClassName);
 
             m_provider = (WikiAttachmentProvider)providerclass.newInstance();
 
@@ -128,20 +141,20 @@ public class CachingAttachmentProvider
         }
         catch( ClassNotFoundException e )
         {
-            log.error("Unable to locate provider class "+classname,e);
+            log.error("Unable to locate provider class "+providerClassName,e);
             throw new IllegalArgumentException("no provider class", e);
         }
         catch( InstantiationException e )
         {
-            log.error("Unable to create provider class "+classname,e);
+            log.error("Unable to create provider class "+providerClassName,e);
             throw new IllegalArgumentException("faulty provider class", e);
         }
         catch( IllegalAccessException e )
         {
-            log.error("Illegal access to provider class "+classname,e);
+            log.error("Illegal access to provider class "+providerClassName,e);
             throw new IllegalArgumentException("illegal provider class", e);
         }
-
+		*/
     }
 
     /**

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/CachingProvider.java Mon Jun 29 22:52:01 2015
@@ -18,17 +18,25 @@
  */
 package org.apache.wiki.providers;
 
-import java.io.IOException;
-import java.util.*;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.TreeSet;
 
 import net.sf.ehcache.Cache;
-import net.sf.ehcache.Element;
 import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
 
 import org.apache.log4j.Logger;
-import org.apache.wiki.*;
+import org.apache.wiki.PageManager;
+import org.apache.wiki.WikiContext;
+import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiPage;
 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.parser.MarkupParser;
 import org.apache.wiki.render.RenderingManager;
 import org.apache.wiki.search.QueryItem;
@@ -94,7 +102,8 @@ public class CachingProvider implements
      *  {@inheritDoc}
      */
     public void initialize( WikiEngine engine, Properties properties )
-        throws NoRequiredPropertyException, IOException {
+        throws NoRequiredPropertyException, WikiException 
+    {
         log.debug("Initing CachingProvider");
 
         // engine is used for getting the search engine
@@ -133,12 +142,18 @@ public class CachingProvider implements
         //
         //  Find and initialize real provider.
         //
-        String classname = TextUtil.getRequiredProperty( properties, PageManager.PROP_PAGEPROVIDER );
-
+        String providerClassName = TextUtil.getRequiredProperty( properties, PageManager.PROP_PAGEPROVIDER );
+        try {
+        	m_provider = ClassUtil.getWikiProvider(WikiPageProvider.class, engine, properties, "org.apache.wiki.providers", providerClassName, null, true);
+        } catch (WikiException e) {
+            log.error(e,e);
+            throw new IllegalArgumentException("no provider class", e);
+        }
 
+        /*
         try
         {
-            Class< ? > providerclass = ClassUtil.findClass( "org.apache.wiki.providers", classname);
+            Class< ? > providerclass = ClassUtil.findClass( "org.apache.wiki.providers", providerClassName);
 
             m_provider = (WikiPageProvider)providerclass.newInstance();
 
@@ -147,19 +162,20 @@ public class CachingProvider implements
         }
         catch( ClassNotFoundException e )
         {
-            log.error("Unable to locate provider class "+classname,e);
+            log.error("Unable to locate provider class "+providerClassName,e);
             throw new IllegalArgumentException("no provider class", e);
         }
         catch( InstantiationException e )
         {
-            log.error("Unable to create provider class "+classname,e);
+            log.error("Unable to create provider class "+providerClassName,e);
             throw new IllegalArgumentException("faulty provider class", e);
         }
         catch( IllegalAccessException e )
         {
-            log.error("Illegal access to provider class "+classname,e);
+            log.error("Illegal access to provider class "+providerClassName,e);
             throw new IllegalArgumentException("illegal provider class", e);
         }
+        */
     }
 
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/providers/VersioningFileProvider.java Mon Jun 29 22:52:01 2015
@@ -41,6 +41,7 @@ import org.apache.wiki.WikiPage;
 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.util.FileUtil;
 
 /**
@@ -86,8 +87,7 @@ public class VersioningFileProvider
      *  {@inheritDoc}
      */
     public void initialize( WikiEngine engine, Properties properties )
-        throws NoRequiredPropertyException,
-               IOException
+        throws NoRequiredPropertyException, WikiException
     {
         super.initialize( engine, properties );
         // some additional sanity checks :
@@ -96,18 +96,18 @@ public class VersioningFileProvider
         {
             if (!oldpages.mkdirs())
             {
-                throw new IOException("Failed to create page version directory " + oldpages.getAbsolutePath());
+                throw new WikiException("Failed to create page version directory " + oldpages.getAbsolutePath());
             }
         }
         else
         {
             if (!oldpages.isDirectory())
             {
-                throw new IOException("Page version directory is not a directory: " + oldpages.getAbsolutePath());
+                throw new WikiException("Page version directory is not a directory: " + oldpages.getAbsolutePath());
             }
             if (!oldpages.canWrite())
             {
-                throw new IOException("Page version directory is not writable: " + oldpages.getAbsolutePath());
+                throw new WikiException("Page version directory is not writable: " + oldpages.getAbsolutePath());
             }
         }
         log.info("Using directory " + oldpages.getAbsolutePath() + " for storing old versions of pages");

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/BasicSearchProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/BasicSearchProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/BasicSearchProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/BasicSearchProvider.java Mon Jun 29 22:52:01 2015
@@ -31,6 +31,7 @@ import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiPage;
 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.AuthorizationManager;
 import org.apache.wiki.auth.permissions.PagePermission;
@@ -51,7 +52,7 @@ public class BasicSearchProvider impleme
      *  {@inheritDoc}
      */
     public void initialize(WikiEngine engine, Properties props)
-            throws NoRequiredPropertyException, IOException
+            throws NoRequiredPropertyException, WikiException
     {
         m_engine = engine;
     }

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/LuceneSearchProvider.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/LuceneSearchProvider.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/LuceneSearchProvider.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/LuceneSearchProvider.java Mon Jun 29 22:52:01 2015
@@ -73,6 +73,7 @@ import org.apache.wiki.WikiPage;
 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.attachment.Attachment;
 import org.apache.wiki.attachment.AttachmentManager;
 import org.apache.wiki.auth.AuthorizationManager;
@@ -133,7 +134,7 @@ public class LuceneSearchProvider implem
      *  {@inheritDoc}
      */
     public void initialize(WikiEngine engine, Properties props)
-            throws NoRequiredPropertyException, IOException
+            throws NoRequiredPropertyException, WikiException
     {
         m_engine = engine;
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/search/SearchManager.java Mon Jun 29 22:52:01 2015
@@ -34,7 +34,6 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.StopWatch;
-import org.apache.log4j.Logger;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiPage;
@@ -50,7 +49,6 @@ import org.apache.wiki.event.WikiEvent;
 import org.apache.wiki.event.WikiEventListener;
 import org.apache.wiki.event.WikiEventUtils;
 import org.apache.wiki.event.WikiPageEvent;
-import org.apache.wiki.modules.InternalModule;
 import org.apache.wiki.parser.MarkupParser;
 import org.apache.wiki.util.ClassUtil;
 import org.apache.wiki.util.TextUtil;
@@ -260,20 +258,7 @@ public class SearchManager extends Basic
     {
         super.initialize(engine, properties);
 
-        loadSearchProvider(properties);
-
-        try
-        {
-            m_searchProvider.initialize(engine, properties);
-        }
-        catch (NoRequiredPropertyException e)
-        {
-            log.error( e.getMessage(), e );
-        }
-        catch (IOException e)
-        {
-            log.error( e.getMessage(), e );
-        }
+        loadSearchProvider(engine, properties);
         
         WikiEventUtils.addWikiEventListener(m_engine.getPageManager(),
                 WikiPageEvent.PAGE_DELETE_REQUEST, this);
@@ -283,7 +268,7 @@ public class SearchManager extends Basic
 
     }
 
-    private void loadSearchProvider(Properties properties)
+    private void loadSearchProvider(WikiEngine engine, Properties properties)
     {
         //
         // See if we're using Lucene, and if so, ensure that its
@@ -304,13 +289,30 @@ public class SearchManager extends Basic
             {
                 m_searchProvider = new BasicSearchProvider();
             }
+            try
+            {
+                m_searchProvider.initialize(engine, properties);
+            }
+            catch (NoRequiredPropertyException e)
+            {
+                log.error( e.getMessage(), e );
+            }
+            catch (WikiException e)
+            {
+                log.error( e.getMessage(), e );
+            }
             log.debug("useLucene was set, loading search provider " + m_searchProvider);
             return;
         }
 
-        String providerClassName = properties.getProperty( PROP_SEARCHPROVIDER,
-                                                           DEFAULT_SEARCHPROVIDER );
-
+        String providerClassName = TextUtil.getStringProperty( properties, PROP_SEARCHPROVIDER, DEFAULT_SEARCHPROVIDER );
+        try {
+        	m_searchProvider = ClassUtil.getWikiProvider(SearchProvider.class, engine, properties, "org.apache.wiki.search", providerClassName, new BasicSearchProvider(), false);
+        } catch (WikiException e) {
+            log.error(e,e);
+            throw new IllegalArgumentException("no provider class", e);
+        }
+        /*
         try
         {
             Class providerClass = ClassUtil.findClass( "org.apache.wiki.search", providerClassName );
@@ -334,6 +336,7 @@ public class SearchManager extends Basic
             // FIXME: Make a static with the default search provider
             m_searchProvider = new BasicSearchProvider();
         }
+        */
         log.debug("Loaded search provider " + m_searchProvider);
     }
 

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/main/java/org/apache/wiki/util/ClassUtil.java Mon Jun 29 22:52:01 2015
@@ -26,10 +26,8 @@ import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Enumeration;
-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;
@@ -38,7 +36,9 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.wiki.WikiEngine;
+import org.apache.wiki.WikiProvider;
 import org.apache.wiki.api.engine.PluginManager;
+import org.apache.wiki.api.exceptions.NoRequiredPropertyException;
 import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.modules.InternalModule;
 import org.jdom2.Element;
@@ -61,8 +61,6 @@ 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;
@@ -75,33 +73,6 @@ 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();
@@ -114,7 +85,6 @@ public final class ClassUtil {
                 } catch (ClassNotFoundException e) {
                 	log.fatal(e,e);
                 }
-//                c_classMappings.put( key, className );
                 
                 log.debug("Mapped class '"+key+"' to class '"+className+"'");
             }
@@ -327,6 +297,52 @@ public final class ClassUtil {
         }
     }
     
+    public static <T extends InternalModule> T getInternalModule( Class<T> classType, WikiEngine engine, Properties props ) throws WikiException {
+    	InternalModule module = (InternalModule) getPicoContainer().getComponent(classType);
+    	module.initialize(engine, props);
+    	return classType.cast(module);
+    }
+    
+    public static <T extends WikiProvider> T getWikiProvider( Class<T> classType, WikiEngine engine, Properties props, String packageName, String providerClassName, WikiProvider defaultProvider, boolean throwException) throws WikiException {
+    	WikiProvider provider = defaultProvider;
+    	
+    	String defaultProviderClassName = defaultProvider != null ? defaultProvider.getClass().getName() : null;
+        String errorMessageLoad = "Failed loading WikiProvider "+providerClassName+", will use "+defaultProviderClassName+". ";
+        
+        try {
+            Class<?> providerClass = ClassUtil.findClass(packageName, providerClassName);
+            provider = (WikiProvider) providerClass.newInstance();
+        } catch (ClassNotFoundException e) {
+            log.warn("no class for WikiProvider "+providerClassName+" "+e.getMessage(), e);
+            if (throwException) { throw new WikiException(errorMessageLoad+e.getMessage()); }
+        } catch (InstantiationException e) {
+        	log.warn("Faulty class WikiProvider "+providerClassName+" "+e.getMessage(), e);
+            if (throwException) { throw new WikiException(errorMessageLoad+e.getMessage()); }
+        } catch (IllegalAccessException e) {
+        	log.warn("Illegal class WikiProvider "+providerClassName+" "+e.getMessage(), e);
+            if (throwException) { throw new WikiException(errorMessageLoad+e.getMessage()); }
+        }
+
+        if (null == provider) {
+        	provider = defaultProvider;
+        } else {
+	        String errorMessageInit = "Failed initializing WikiProvider "+providerClassName+", will use "+defaultProviderClassName+". ";
+	        try {
+	        	provider.initialize(engine, props);
+	        } catch (NoRequiredPropertyException e) {
+	            log.warn(errorMessageInit+e.getMessage(), e);
+	            if (throwException) { throw new WikiException(errorMessageInit+e.getMessage()); }
+	            provider = defaultProvider;
+	        } catch (WikiException e) {
+	            log.warn(errorMessageInit+e.getMessage(), e);
+	            if (throwException) { throw new WikiException(errorMessageInit+e.getMessage()); }
+	            provider = defaultProvider;
+	        }
+        }
+        
+        return classType.cast(provider);
+    }
+
     /**
      *  This method is used to locate and instantiate a mapped class.
      *  You may redefine anything in the resource file which is located in your classpath
@@ -349,12 +365,6 @@ public final class ClassUtil {
 //    	Properties props = engine.getWikiProperties();
         return getMappedObject(requestedClass, null, null );
     }
-
-    public static <T extends InternalModule> T getInternalModule( Class<T> type, WikiEngine engine, Properties props ) throws WikiException {
-    	InternalModule module = (InternalModule) getPicoContainer().getComponent(type);
-    	module.initialize(engine, props);
-    	return type.cast(module);
-    }
     
     /**
      *  This method is used to locate and instantiate a mapped class.
@@ -387,99 +397,6 @@ public final class ClassUtil {
     	} 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 );
-//        }
-    }
-
-    /**
-     *  Finds a mapped class from the c_classMappings list.  If there is no
-     *  mappped class, will use the requestedClass.
-     *  
-     *  @param requestedClass
-     *  @return A Class object which you can then instantiate.
-     *  @throws WikiException
-     */
-    private static Class< ? > getMappedClass( String requestedClass )
-        throws WikiException
-    {
-        String mappedClass = c_classMappings.get( requestedClass );
-        
-        if( mappedClass == null )
-        {
-            mappedClass = requestedClass;
-        }
-        
-        try
-        {
-            Class< ? > cl = Class.forName(mappedClass);
-            
-            return cl;
-        }
-        catch (ClassNotFoundException e)
-        {
-            log.info( "Cannot find requested class", e );
-            
-            throw new WikiException("Failed to instantiate class "+requestedClass, e );
-        }
     }
     
     public static PicoContainer getPicoContainer() {

Modified: jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/providers/FileSystemProviderTest.java
URL: http://svn.apache.org/viewvc/jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/providers/FileSystemProviderTest.java?rev=1688324&r1=1688323&r2=1688324&view=diff
==============================================================================
--- jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/providers/FileSystemProviderTest.java (original)
+++ jspwiki/branches/JSPWIKI_2_10_PICO_BRANCH/jspwiki-war/src/test/java/org/apache/wiki/providers/FileSystemProviderTest.java Mon Jun 29 22:52:01 2015
@@ -21,7 +21,6 @@ package org.apache.wiki.providers;
 
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.IOException;
 import java.util.Properties;
 
 import junit.framework.Test;
@@ -33,6 +32,7 @@ import org.apache.wiki.PageManager;
 import org.apache.wiki.TestEngine;
 import org.apache.wiki.WikiEngine;
 import org.apache.wiki.WikiPage;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.util.FileUtil;
 
 
@@ -226,7 +226,7 @@ public class FileSystemProviderTest exte
 
                 fail( "Wiki did not warn about wrong property." );
             }
-            catch( IOException e )
+            catch( WikiException e )
             {
                 // This is okay.
             }



Mime
View raw message