jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r529494 - /jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java
Date Tue, 17 Apr 2007 06:01:40 GMT
Author: jukka
Date: Mon Apr 16 23:01:39 2007
New Revision: 529494

URL: http://svn.apache.org/viewvc?view=rev&rev=529494
Log:
JCR-622: Restored the throws clauses in ClientRepositoryFactory.getRepository()

Modified:
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java?view=diff&rev=529494&r1=529493&r2=529494
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientRepositoryFactory.java
Mon Apr 16 23:01:39 2007
@@ -70,11 +70,23 @@
      * Returns a client wrapper for a remote content repository. The remote
      * repository is looked up from the RMI registry using the given URL by
      * the returned {@link SafeClientRepository} instance.
+     * <p>
+     * The current implementation of this method will not throw any of the
+     * declared exceptions (because of the {@link SafeClientRepository} being
+     * used), but the throws clauses are kept for backwards compatibility and
+     * potential future use. Clients should be prepared to handle exceptions
+     * from this method.
      *
      * @param url the RMI URL of the remote repository
      * @return repository client
+     * @throws MalformedURLException if the given URL is malfored
+     * @throws NotBoundException if the given URL points to nothing
+     * @throws ClassCastException if the given URL points to something unknown
+     * @throws RemoteException if the remote repository can not be accessed
      */
-    public Repository getRepository(final String url) {
+    public Repository getRepository(final String url)
+            throws MalformedURLException, NotBoundException,
+            ClassCastException, RemoteException {
         return new SafeClientRepository(factory) {
 
             protected RemoteRepository getRemoteRepository()
@@ -110,7 +122,11 @@
             Reference reference = (Reference) object;
             RefAddr url = reference.get(URL_PARAMETER);
             if (url != null && url.getContent() != null) {
-                return getRepository(url.getContent().toString());
+                try {
+                    return getRepository(url.getContent().toString());
+                } catch (Exception e) {
+                    return null;
+                }
             }
         }
         return null;



Mime
View raw message