jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r543996 - in /jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository: JNDIRemoteRepository.java RMIRemoteRepository.java URLRemoteRepository.java
Date Sun, 03 Jun 2007 21:41:24 GMT
Author: jukka
Date: Sun Jun  3 14:41:24 2007
New Revision: 543996

URL: http://svn.apache.org/viewvc?view=rev&rev=543996
Log:
JCR-956: Added utility constructors for remote repositories

Modified:
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/JNDIRemoteRepository.java
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/RMIRemoteRepository.java
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/URLRemoteRepository.java

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/JNDIRemoteRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/JNDIRemoteRepository.java?view=diff&rev=543996&r1=543995&r2=543996
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/JNDIRemoteRepository.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/JNDIRemoteRepository.java
Sun Jun  3 14:41:24 2007
@@ -17,9 +17,12 @@
 package org.apache.jackrabbit.rmi.repository;
 
 import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 
 import org.apache.jackrabbit.commons.repository.ProxyRepository;
 import org.apache.jackrabbit.rmi.client.LocalAdapterFactory;
+import org.apache.jackrabbit.rmi.jackrabbit.JackrabbitClientAdapterFactory;
 
 /**
  * Proxy for a remote repository bound in JNDI. The configured repository is
@@ -42,6 +45,30 @@
     public JNDIRemoteRepository(
             LocalAdapterFactory factory, Context context, String location) {
         super(new JNDIRemoteRepositoryFactory(factory, context, location));
+    }
+
+    /**
+     * Creates a proxy for the remote repository in JNDI.
+     * Uses {@link JackrabbitClientAdapterFactory} as the default
+     * local adapter factory.
+     *
+     * @param context JNDI context
+     * @param location JNDI location
+     */
+    public JNDIRemoteRepository(Context context, String location) {
+        this(new JackrabbitClientAdapterFactory(), context, location);
+    }
+
+    /**
+     * Creates a proxy for the remote repository in JNDI.
+     * Uses {@link JackrabbitClientAdapterFactory} as the default
+     * local adapter factory.
+     *
+     * @param location JNDI location in default context
+     * @throws NamingException if the default JNDI context is not available 
+     */
+    public JNDIRemoteRepository(String location) throws NamingException {
+        this(new InitialContext(), location);
     }
 
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/RMIRemoteRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/RMIRemoteRepository.java?view=diff&rev=543996&r1=543995&r2=543996
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/RMIRemoteRepository.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/RMIRemoteRepository.java
Sun Jun  3 14:41:24 2007
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.commons.repository.ProxyRepository;
 import org.apache.jackrabbit.rmi.client.LocalAdapterFactory;
+import org.apache.jackrabbit.rmi.jackrabbit.JackrabbitClientAdapterFactory;
 
 /**
  * Proxy for a remote repository bound in RMI. The configured repository is
@@ -38,6 +39,17 @@
      */
     public RMIRemoteRepository(LocalAdapterFactory factory, String url) {
         super(new RMIRemoteRepositoryFactory(factory, url));
+    }
+
+    /**
+     * Creates a proxy for the remote repository in the given RMI URL.
+     * Uses {@link JackrabbitClientAdapterFactory} as the default
+     * local adapter factory.
+     *
+     * @param url URL of the remote repository
+     */
+    public RMIRemoteRepository(String url) {
+        this(new JackrabbitClientAdapterFactory(), url);
     }
 
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/URLRemoteRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/URLRemoteRepository.java?view=diff&rev=543996&r1=543995&r2=543996
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/URLRemoteRepository.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/repository/URLRemoteRepository.java
Sun Jun  3 14:41:24 2007
@@ -16,10 +16,12 @@
  */
 package org.apache.jackrabbit.rmi.repository;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 
 import org.apache.jackrabbit.commons.repository.ProxyRepository;
 import org.apache.jackrabbit.rmi.client.LocalAdapterFactory;
+import org.apache.jackrabbit.rmi.jackrabbit.JackrabbitClientAdapterFactory;
 
 /**
  * Proxy for a remote repository accessed via a URL. The configured URL is
@@ -40,6 +42,29 @@
      */
     public URLRemoteRepository(LocalAdapterFactory factory, URL url) {
         super(new URLRemoteRepositoryFactory(factory, url));
+    }
+
+    /**
+     * Creates a proxy for the remote repository at the given URL.
+     * Uses {@link JackrabbitClientAdapterFactory} as the default
+     * local adapter factory.
+     *
+     * @param url URL of the remote repository
+     */
+    public URLRemoteRepository(URL url) {
+        this(new JackrabbitClientAdapterFactory(), url);
+    }
+
+    /**
+     * Creates a proxy for the remote repository at the given URL.
+     * Uses {@link JackrabbitClientAdapterFactory} as the default
+     * local adapter factory.
+     *
+     * @param url URL of the remote repository
+     * @throws MalformedURLException if the given URL is malformed
+     */
+    public URLRemoteRepository(String url) throws MalformedURLException {
+        this(new URL(url));
     }
 
 }



Mime
View raw message