KI-66 intermediate changes

git-svn-id: https://svn.apache.org/repos/asf/incubator/jsecurity/trunk@752385 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/core/src/org/apache/ki/JSecurityException.java b/core/src/org/apache/ki/KiException.java
similarity index 87%
rename from core/src/org/apache/ki/JSecurityException.java
rename to core/src/org/apache/ki/KiException.java
index 2e45a13..b5e3ac8 100644
--- a/core/src/org/apache/ki/JSecurityException.java
+++ b/core/src/org/apache/ki/KiException.java
@@ -29,12 +29,12 @@
  * @author Les Hazlewood
  * @since 0.1
  */
-public class JSecurityException extends RuntimeException implements Serializable {
+public class KiException extends RuntimeException implements Serializable {
 
     /**
      * Creates a new JSecurityException.
      */
-    public JSecurityException() {
+    public KiException() {
         super();
     }
 
@@ -43,7 +43,7 @@
      *
      * @param message the reason for the exception
      */
-    public JSecurityException(String message) {
+    public KiException(String message) {
         super(message);
     }
 
@@ -52,7 +52,7 @@
      *
      * @param cause the underlying Throwable that caused this exception to be thrown.
      */
-    public JSecurityException(Throwable cause) {
+    public KiException(Throwable cause) {
         super(cause);
     }
 
@@ -62,7 +62,7 @@
      * @param message the reason for the exception
      * @param cause   the underlying Throwable that caused this exception to be thrown.
      */
-    public JSecurityException(String message, Throwable cause) {
+    public KiException(String message, Throwable cause) {
         super(message, cause);
     }
 
diff --git a/core/src/org/apache/ki/authc/AuthenticationException.java b/core/src/org/apache/ki/authc/AuthenticationException.java
index c430a21..a739cba 100644
--- a/core/src/org/apache/ki/authc/AuthenticationException.java
+++ b/core/src/org/apache/ki/authc/AuthenticationException.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.authc;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 
 /**
@@ -27,7 +27,7 @@
  * @author Les Hazlewood
  * @since 0.1
  */
-public class AuthenticationException extends JSecurityException {
+public class AuthenticationException extends KiException {
 
     /**
      * Creates a new AuthenticationException.
diff --git a/core/src/org/apache/ki/authz/AuthorizationException.java b/core/src/org/apache/ki/authz/AuthorizationException.java
index 3f3e94c..47615fd 100644
--- a/core/src/org/apache/ki/authz/AuthorizationException.java
+++ b/core/src/org/apache/ki/authz/AuthorizationException.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.authz;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 
 /**
@@ -27,7 +27,7 @@
  * @author Les Hazlewood
  * @since 0.1
  */
-public class AuthorizationException extends JSecurityException {
+public class AuthorizationException extends KiException {
 
     /**
      * Creates a new AuthorizationException.
diff --git a/core/src/org/apache/ki/authz/permission/InvalidPermissionStringException.java b/core/src/org/apache/ki/authz/permission/InvalidPermissionStringException.java
index 79604eb..25e28ae 100644
--- a/core/src/org/apache/ki/authz/permission/InvalidPermissionStringException.java
+++ b/core/src/org/apache/ki/authz/permission/InvalidPermissionStringException.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.authz.permission;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 
 /**
@@ -28,7 +28,7 @@
  * @author Jeremy Haile
  * @since 0.9
  */
-public class InvalidPermissionStringException extends JSecurityException {
+public class InvalidPermissionStringException extends KiException {
 
     private String permissionString;
 
diff --git a/core/src/org/apache/ki/cache/CacheException.java b/core/src/org/apache/ki/cache/CacheException.java
index bd57456..7f2b8dc 100644
--- a/core/src/org/apache/ki/cache/CacheException.java
+++ b/core/src/org/apache/ki/cache/CacheException.java
@@ -18,7 +18,7 @@
  */

 package org.apache.ki.cache;

 

-import org.apache.ki.JSecurityException;

+import org.apache.ki.KiException;

 

 

 /**

@@ -28,7 +28,7 @@
  * @author Les Hazlewood

  * @since 0.2

  */

-public class CacheException extends JSecurityException {

+public class CacheException extends KiException {

 

     /**

      * Creates a new <code>CacheException</code>.

diff --git a/core/src/org/apache/ki/codec/CodecException.java b/core/src/org/apache/ki/codec/CodecException.java
index ff27cff..ea6cb93 100644
--- a/core/src/org/apache/ki/codec/CodecException.java
+++ b/core/src/org/apache/ki/codec/CodecException.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.codec;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 /**
  * Root exception related to issues during encoding or decoding.
@@ -26,7 +26,7 @@
  * @author Les Hazlewood
  * @since 0.9
  */
-public class CodecException extends JSecurityException {
+public class CodecException extends KiException {
 
     /**
      * Creates a new <code>CodecException</code>.
diff --git a/core/src/org/apache/ki/config/ConfigurationException.java b/core/src/org/apache/ki/config/ConfigurationException.java
index 22f0736..926693f 100644
--- a/core/src/org/apache/ki/config/ConfigurationException.java
+++ b/core/src/org/apache/ki/config/ConfigurationException.java
@@ -18,7 +18,7 @@
  */

 package org.apache.ki.config;

 

-import org.apache.ki.JSecurityException;

+import org.apache.ki.KiException;

 

 /**

  * Root exception indicating there was a problem parsing or processing the JSecurity configuration.

@@ -26,7 +26,7 @@
  * @author Les Hazlewood

  * @since 0.9

  */

-public class ConfigurationException extends JSecurityException {

+public class ConfigurationException extends KiException {

 

     /**

      * Creates a new ConfigurationException.

diff --git a/core/src/org/apache/ki/config/IniConfiguration.java b/core/src/org/apache/ki/config/IniConfiguration.java
index 502016e..93ec6dd 100644
--- a/core/src/org/apache/ki/config/IniConfiguration.java
+++ b/core/src/org/apache/ki/config/IniConfiguration.java
@@ -30,7 +30,7 @@
 import org.apache.commons.logging.Log;

 import org.apache.commons.logging.LogFactory;

 

-import org.apache.ki.JSecurityException;

+import org.apache.ki.KiException;

 import org.apache.ki.io.IniResource;

 import org.apache.ki.io.ResourceUtils;

 import org.apache.ki.mgt.DefaultSecurityManager;

@@ -88,7 +88,7 @@
         this.configUrl = configUrl;

     }

 

-    public void init() throws JSecurityException {

+    public void init() throws KiException {

 

         if (configUrl != null) {

             if (ResourceUtils.resourceExists(configUrl)) {

diff --git a/core/src/org/apache/ki/config/TextConfiguration.java b/core/src/org/apache/ki/config/TextConfiguration.java
index 44a5373..e9638a2 100644
--- a/core/src/org/apache/ki/config/TextConfiguration.java
+++ b/core/src/org/apache/ki/config/TextConfiguration.java
@@ -25,7 +25,7 @@
 import org.apache.commons.logging.Log;

 import org.apache.commons.logging.LogFactory;

 

-import org.apache.ki.JSecurityException;

+import org.apache.ki.KiException;

 import org.apache.ki.io.ResourceException;

 import org.apache.ki.mgt.SecurityManager;

 import org.apache.ki.util.Initializable;

@@ -73,7 +73,7 @@
         }

     }

 

-    public void init() throws JSecurityException {

+    public void init() throws KiException {

         SecurityManager securityManager = getSecurityManager();

         if (securityManager == null) {

             String config = getConfig();

diff --git a/core/src/org/apache/ki/io/ResourceException.java b/core/src/org/apache/ki/io/ResourceException.java
index 0c988df..9f41483 100644
--- a/core/src/org/apache/ki/io/ResourceException.java
+++ b/core/src/org/apache/ki/io/ResourceException.java
@@ -18,7 +18,8 @@
  */

 package org.apache.ki.io;

 

-import org.apache.ki.JSecurityException;

+import org.apache.ki.KiException;

+

 

 /**

  * Root exception when a problem occurs acquiring or processing a resource.

@@ -26,7 +27,7 @@
  * @author Les Hazlewood

  * @since 0.9

  */

-public class ResourceException extends JSecurityException {

+public class ResourceException extends KiException {

 

     /**

      * Creates a new ResourceException.

diff --git a/core/src/org/apache/ki/io/SerializationException.java b/core/src/org/apache/ki/io/SerializationException.java
index 0369405..71ee3f1 100644
--- a/core/src/org/apache/ki/io/SerializationException.java
+++ b/core/src/org/apache/ki/io/SerializationException.java
@@ -18,7 +18,8 @@
  */
 package org.apache.ki.io;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
+
 
 /**
  * Root exception for problems either serializing or de-serializing data.
@@ -26,7 +27,7 @@
  * @author Les Hazlewood
  * @since Apr 23, 2008 8:58:22 AM
  */
-public class SerializationException extends JSecurityException {
+public class SerializationException extends KiException {
 
     /**
      * Creates a new SerializationException.
diff --git a/core/src/org/apache/ki/package-info.java b/core/src/org/apache/ki/package-info.java
index 550997e..77567c3 100644
--- a/core/src/org/apache/ki/package-info.java
+++ b/core/src/org/apache/ki/package-info.java
@@ -19,6 +19,6 @@
 /**

  * This package primarily exists as a root classpath distinction, but it does contain two core classes widely used

  * by applications, {@link org.apache.ki.SecurityUtils SecurityUtils} and

- * {@link org.apache.ki.JSecurityException JSecurityException}.

+ * {@link org.apache.ki.KiException JSecurityException}.

  */

 package org.ki;
\ No newline at end of file
diff --git a/core/src/org/apache/ki/realm/text/PropertiesRealm.java b/core/src/org/apache/ki/realm/text/PropertiesRealm.java
index faaa210..e326cf6 100644
--- a/core/src/org/apache/ki/realm/text/PropertiesRealm.java
+++ b/core/src/org/apache/ki/realm/text/PropertiesRealm.java
@@ -31,7 +31,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 import org.apache.ki.cache.CacheManager;
 import org.apache.ki.io.ResourceUtils;
 import org.apache.ki.util.Destroyable;
@@ -261,7 +261,7 @@
             }
 
         } catch (IOException e) {
-            throw new JSecurityException("Error reading properties path [" + resourcePath + "].  " +
+            throw new KiException("Error reading properties path [" + resourcePath + "].  " +
                     "Initializing of the realm from this file failed.", e);
         } finally {
             ResourceUtils.close(is);
diff --git a/core/src/org/apache/ki/session/SessionException.java b/core/src/org/apache/ki/session/SessionException.java
index 444284e..fc1dcf5 100644
--- a/core/src/org/apache/ki/session/SessionException.java
+++ b/core/src/org/apache/ki/session/SessionException.java
@@ -20,7 +20,8 @@
 
 import java.io.Serializable;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
+
 
 /**
  * General security exception attributed to problems during interaction with the system during
@@ -29,7 +30,7 @@
  * @author Les Hazlewood
  * @since 0.1
  */
-public class SessionException extends JSecurityException {
+public class SessionException extends KiException {
 
     private Serializable sessionId;
 
diff --git a/core/src/org/apache/ki/subject/SubjectException.java b/core/src/org/apache/ki/subject/SubjectException.java
index d82e22e..6ad39b5 100644
--- a/core/src/org/apache/ki/subject/SubjectException.java
+++ b/core/src/org/apache/ki/subject/SubjectException.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.subject;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 
 /**
@@ -27,7 +27,7 @@
  * @author Jeremy Haile
  * @since 0.1
  */
-public class SubjectException extends JSecurityException {
+public class SubjectException extends KiException {
 
     /**
      * Creates a new SubjectException.
diff --git a/core/src/org/apache/ki/util/Initializable.java b/core/src/org/apache/ki/util/Initializable.java
index 7f33590..810c860 100644
--- a/core/src/org/apache/ki/util/Initializable.java
+++ b/core/src/org/apache/ki/util/Initializable.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.util;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 /**
  * JSecurity container-agnostic interface that indicates that this object requires initialization.
@@ -33,8 +33,8 @@
     /**
      * Initializes this object.
      *
-     * @throws JSecurityException if an exception occurs during initialization.
+     * @throws org.apache.ki.KiException if an exception occurs during initialization.
      */
-    void init() throws JSecurityException;
+    void init() throws KiException;
 
 }
diff --git a/core/src/org/apache/ki/util/InstantiationException.java b/core/src/org/apache/ki/util/InstantiationException.java
index 711c2cd..81d0e7a 100644
--- a/core/src/org/apache/ki/util/InstantiationException.java
+++ b/core/src/org/apache/ki/util/InstantiationException.java
@@ -18,7 +18,8 @@
  */
 package org.apache.ki.util;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
+
 
 /**
  * Runtime exception thrown by the framework when unable to instantiate a Class via reflection.
@@ -26,7 +27,7 @@
  * @author Les Hazlewood
  * @since 0.2
  */
-public class InstantiationException extends JSecurityException {
+public class InstantiationException extends KiException {
 
     /**
      * Creates a new InstantiationException.
diff --git a/core/src/org/apache/ki/util/LifecycleUtils.java b/core/src/org/apache/ki/util/LifecycleUtils.java
index 6821f82..286391f 100644
--- a/core/src/org/apache/ki/util/LifecycleUtils.java
+++ b/core/src/org/apache/ki/util/LifecycleUtils.java
@@ -23,7 +23,7 @@
 import org.apache.commons.logging.Log;

 import org.apache.commons.logging.LogFactory;

 

-import org.apache.ki.JSecurityException;

+import org.apache.ki.KiException;

 

 

 /**

@@ -35,22 +35,22 @@
 

     private static final Log log = LogFactory.getLog(LifecycleUtils.class);

 

-    public static void init(Object o) throws JSecurityException {

+    public static void init(Object o) throws KiException {

         if (o instanceof Initializable) {

             init((Initializable) o);

         }

     }

 

-    public static void init(Initializable initializable) throws JSecurityException {

+    public static void init(Initializable initializable) throws KiException {

         initializable.init();

     }

 

     /**

      * @param c

-     * @throws JSecurityException

+     * @throws org.apache.ki.KiException

      * @since 0.9

      */

-    public static void init(Collection c) throws JSecurityException {

+    public static void init(Collection c) throws KiException {

         if (c == null || c.isEmpty()) {

             return;

         }

diff --git a/core/src/org/apache/ki/util/UnavailableConstructorException.java b/core/src/org/apache/ki/util/UnavailableConstructorException.java
index c11b78e..f5a52f8 100644
--- a/core/src/org/apache/ki/util/UnavailableConstructorException.java
+++ b/core/src/org/apache/ki/util/UnavailableConstructorException.java
@@ -18,7 +18,8 @@
  */
 package org.apache.ki.util;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
+
 
 /**
  * Exception thrown when attempting to instantiate a Class via reflection, but a suitable constructor (depending
@@ -27,7 +28,7 @@
  * @author Les Hazlewood
  * @since 0.2
  */
-public class UnavailableConstructorException extends JSecurityException {
+public class UnavailableConstructorException extends KiException {
 
     /**
      * Creates a new UnavailableConstructorException.
diff --git a/core/src/org/apache/ki/util/UnknownClassException.java b/core/src/org/apache/ki/util/UnknownClassException.java
index 9c34d8b..781a90f 100644
--- a/core/src/org/apache/ki/util/UnknownClassException.java
+++ b/core/src/org/apache/ki/util/UnknownClassException.java
@@ -18,7 +18,7 @@
  */
 package org.apache.ki.util;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 
 /**
@@ -28,7 +28,7 @@
  * @author Les Hazlewood
  * @since 0.1
  */
-public class UnknownClassException extends JSecurityException {
+public class UnknownClassException extends KiException {
 
     /**
      * Creates a new UnknownClassException.
diff --git a/support/spring/src/org/ki/spring/SpringIniWebConfiguration.java b/support/spring/src/org/ki/spring/SpringIniWebConfiguration.java
index 410eaa9..ca4846b 100644
--- a/support/spring/src/org/ki/spring/SpringIniWebConfiguration.java
+++ b/support/spring/src/org/ki/spring/SpringIniWebConfiguration.java
@@ -22,7 +22,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.ki.realm.Realm;
 
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 
 import org.apache.ki.mgt.SecurityManager;
 
@@ -91,7 +91,7 @@
     }
 
     @Override
-    public void init() throws JSecurityException {
+    public void init() throws KiException {
         String beanName = getFilterConfig().getInitParameter(SECURITY_MANAGER_BEAN_NAME_PARAM_NAME);
         if (beanName != null) {
             setSecurityManagerBeanName(beanName);
diff --git a/web/src/org/ki/web/attr/AbstractWebAttribute.java b/web/src/org/ki/web/attr/AbstractWebAttribute.java
index b476ae7..a532ab3 100644
--- a/web/src/org/ki/web/attr/AbstractWebAttribute.java
+++ b/web/src/org/ki/web/attr/AbstractWebAttribute.java
@@ -20,7 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ki.JSecurityException;
+import org.apache.ki.KiException;
 import org.apache.ki.util.ClassUtils;
 
 import javax.servlet.ServletRequest;
@@ -147,7 +147,7 @@
                 return (T) stringValue;
             } catch (Exception e) {
                 String msg = "If the type is not String, you must specify the 'editorClass' property.";
-                throw new JSecurityException(msg, e);
+                throw new KiException(msg, e);
             }
         } else {
             PropertyEditor editor = (PropertyEditor) ClassUtils.newInstance(getEditorClass());
@@ -157,7 +157,7 @@
                 return (T) value;
             } catch (ClassCastException e) {
                 String msg = "Returned value from PropertyEditor does not match the specified type.";
-                throw new JSecurityException(msg, e);
+                throw new KiException(msg, e);
             }
         }
     }