jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r733080 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Date Fri, 09 Jan 2009 16:50:09 GMT
Author: jukka
Date: Fri Jan  9 08:50:09 2009
New Revision: 733080

URL: http://svn.apache.org/viewvc?rev=733080&view=rev
Log:
JCR-1823: Repository.login throws IllegalStateException

Make sanityCheck() throw a RepositoryException.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=733080&r1=733079&r2=733080&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Fri Jan  9 08:50:09 2009
@@ -621,14 +621,14 @@
     /**
      * Performs a sanity check on this repository instance.
      *
-     * @throws IllegalStateException if this repository has been rendered
-     *                               invalid for some reason (e.g. if it has
-     *                               been shut down)
+     * @throws RepositoryException if this repository has been rendered
+     *             invalid for some reason (e.g. if it has been shut down)
      */
-    protected void sanityCheck() throws IllegalStateException {
+    protected void sanityCheck() throws RepositoryException {
         // check repository status
         if (disposed) {
-            throw new IllegalStateException("repository instance has been shut down");
+            throw new RepositoryException(
+                    "This repository instance has been shut down.");
         }
     }
 
@@ -713,30 +713,18 @@
     }
 
     protected NamespaceRegistryImpl getNamespaceRegistry() {
-        // check sanity of this instance
-        sanityCheck();
-
         return nsReg;
     }
 
     protected NodeTypeRegistry getNodeTypeRegistry() {
-        // check sanity of this instance
-        sanityCheck();
-
         return ntReg;
     }
 
     protected VersionManager getVersionManager() {
-        // check sanity of this instance
-        sanityCheck();
-
         return vMgr;
     }
 
     protected NodeId getRootNodeId() {
-        // check sanity of this instance
-        sanityCheck();
-
         return rootNodeId;
     }
 
@@ -759,12 +747,11 @@
      *                      is to be returned. This must not be <code>null</code>.
      * @return The {@link WorkspaceInfo} for the named workspace. This will
      *         never be <code>null</code>.
-     * @throws IllegalStateException    If this repository has already been
-     *                                  shut down.
      * @throws NoSuchWorkspaceException If the named workspace does not exist.
+     * @throws RepositoryException If this repository has been shut down.
      */
     protected WorkspaceInfo getWorkspaceInfo(String workspaceName)
-            throws IllegalStateException, NoSuchWorkspaceException {
+            throws NoSuchWorkspaceException, RepositoryException {
         // check sanity of this instance
         sanityCheck();
 
@@ -907,7 +894,7 @@
     }
 
     ObservationDispatcher getObservationDispatcher(String workspaceName)
-            throws NoSuchWorkspaceException {
+            throws NoSuchWorkspaceException, RepositoryException {
         // check sanity of this instance
         sanityCheck();
 



Mime
View raw message