jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r900373 - in /jackrabbit/commons/jcr-rmi/trunk: ./ src/main/java/org/apache/jackrabbit/rmi/client/ src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ src/main/java/org/apache/jackrabbit/rmi/remote/ src/main/java/org/apache/jackrabbit/rmi/s...
Date Mon, 18 Jan 2010 12:45:58 GMT
Author: jukka
Date: Mon Jan 18 12:45:57 2010
New Revision: 900373

URL: http://svn.apache.org/viewvc?rev=900373&view=rev
Log:
JCRRMI-26: JSR-283 support

Drop the JackrabbitNodeTypeManager and JackrabbitWorkspace extensions in favor of equivalent
JCR 2.0 implementations (node type registration is still missing).

Removed:
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ClientJackrabbitNodeTypeManager.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ClientJackrabbitWorkspace.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitNodeTypeManager.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitWorkspace.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitNodeTypeManager.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitWorkspace.java
Modified:
    jackrabbit/commons/jcr-rmi/trunk/pom.xml
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientNodeTypeManager.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteNodeTypeManager.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerNodeTypeManager.java
    jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
    jackrabbit/commons/jcr-rmi/trunk/src/test/java/org/apache/jackrabbit/rmi/RepositoryStubImpl.java

Modified: jackrabbit/commons/jcr-rmi/trunk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/pom.xml?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/pom.xml (original)
+++ jackrabbit/commons/jcr-rmi/trunk/pom.xml Mon Jan 18 12:45:57 2010
@@ -31,7 +31,7 @@
   <!-- =================================================================== -->
   <!-- P R O J E C T  D E S C R I P T I O N                                -->
   <!-- =================================================================== -->
-  <artifactId>jcr-rmi</artifactId>
+  <artifactId>jackrabbit-jcr-rmi</artifactId>
   <version>2.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
@@ -1055,12 +1055,12 @@
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-api</artifactId>
-      <version>2.0-beta4</version>
+      <version>2.0-beta5</version>
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-jcr-commons</artifactId>
-      <version>2.0-beta4</version>
+      <version>2.0-beta5</version>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientNodeTypeManager.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientNodeTypeManager.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientNodeTypeManager.java
Mon Jan 18 12:45:57 2010
@@ -115,7 +115,11 @@
     }
 
     public boolean hasNodeType(String name) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        try {
+            return remote.hasNodeType(name);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
     }
 
     public NodeType registerNodeType(
@@ -131,11 +135,15 @@
     }
 
     public void unregisterNodeType(String name) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        unregisterNodeTypes(new String[] { name });
     }
 
     public void unregisterNodeTypes(String[] names) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        try {
+            remote.unregisterNodeTypes(names);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
     }
 
 }

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
Mon Jan 18 12:45:57 2010
@@ -240,16 +240,28 @@
     }
 
     public void createWorkspace(String name) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        try {
+            remote.createWorkspace(name, null);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
     }
 
     public void createWorkspace(String name, String srcWorkspace)
             throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        try {
+            remote.createWorkspace(name, srcWorkspace);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
     }
 
     public void deleteWorkspace(String name) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        try {
+            remote.deleteWorkspace(name);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
     }
 
     public LockManager getLockManager() throws RepositoryException {

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
Mon Jan 18 12:45:57 2010
@@ -16,58 +16,10 @@
  */
 package org.apache.jackrabbit.rmi.jackrabbit;
 
-import javax.jcr.Session;
-import javax.jcr.Workspace;
-import javax.jcr.nodetype.NodeTypeManager;
-
-import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
-import org.apache.jackrabbit.api.JackrabbitWorkspace;
 import org.apache.jackrabbit.rmi.client.ClientAdapterFactory;
-import org.apache.jackrabbit.rmi.client.LocalAdapterFactory;
-import org.apache.jackrabbit.rmi.remote.RemoteNodeTypeManager;
-import org.apache.jackrabbit.rmi.remote.RemoteWorkspace;
 
 /**
- * Jackrabbit-specific {@link LocalAdapterFactory}. This factory extends
- * the default {@link ClientAdapterFactory} implementation with adapter
- * classes that implement the Jackrabbit API extension interfaces. The
- * implementation degrades gracefully when used with other repositories.
+ * @deprecated Use the normal {@link ClientAdapterFactory} instead
  */
 public class JackrabbitClientAdapterFactory extends ClientAdapterFactory {
-
-    /**
-     * Returns a {@link JackrabbitNodeTypeManager} adapter if given a
-     * {@link RemoteJackrabbitNodeTypeManager} reference. Alternatively falls
-     * back to the default adapter from the parent class.
-     *
-     * @param remote remote node type manager
-     * @return adapted node type manager
-     */
-    public NodeTypeManager getNodeTypeManager(RemoteNodeTypeManager remote) {
-        if (remote instanceof RemoteJackrabbitNodeTypeManager) {
-            return new ClientJackrabbitNodeTypeManager(
-                    (RemoteJackrabbitNodeTypeManager) remote, this);
-        } else {
-            return super.getNodeTypeManager(remote);
-        }
-    }
-
-    /**
-     * Returns a {@link JackrabbitWorkspace} adapter if given a
-     * {@link RemoteJackrabbitWorkspace} reference. Alternatively falls back
-     * to the default adapter from the parent class.
-     *
-     * @param remote remote workspace
-     * @return adapted workspace
-     */
-    public Workspace getWorkspace(Session session, RemoteWorkspace remote) {
-        if (remote instanceof RemoteJackrabbitWorkspace) {
-            return new ClientJackrabbitWorkspace(
-                    session, (RemoteJackrabbitWorkspace) remote, this);
-        } else {
-            return super.getWorkspace(session, remote);
-        }
-    }
-
-
 }

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteNodeTypeManager.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteNodeTypeManager.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteNodeTypeManager.java
Mon Jan 18 12:45:57 2010
@@ -95,4 +95,10 @@
     RemoteIterator getMixinNodeTypes()
             throws RepositoryException, RemoteException;
 
+    boolean hasNodeType(String name)
+            throws RepositoryException, RemoteException;
+
+    void unregisterNodeTypes(String[] names)
+            throws RepositoryException, RemoteException;
+
 }

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
Mon Jan 18 12:45:57 2010
@@ -183,4 +183,10 @@
     void importXML(String path, byte[] xml, int uuidBehaviour)
             throws IOException, RepositoryException, RemoteException;
 
+    void createWorkspace(String name, String source)
+            throws RepositoryException, RemoteException;
+
+    void deleteWorkspace(String name)
+            throws RepositoryException, RemoteException;
+
 }

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerNodeTypeManager.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerNodeTypeManager.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerNodeTypeManager.java
Mon Jan 18 12:45:57 2010
@@ -99,4 +99,22 @@
         }
     }
 
+    public boolean hasNodeType(String name)
+            throws RepositoryException, RemoteException {
+        try {
+            return manager.hasNodeType(name);
+        } catch (RepositoryException ex) {
+            throw getRepositoryException(ex);
+        }
+    }
+
+    public void unregisterNodeTypes(String[] names)
+            throws RepositoryException, RemoteException {
+        try {
+            manager.unregisterNodeTypes(names);
+        } catch (RepositoryException ex) {
+            throw getRepositoryException(ex);
+        }
+    }
+
 }

Modified: jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
Mon Jan 18 12:45:57 2010
@@ -186,4 +186,18 @@
         }
     }
 
+    public void createWorkspace(String name, String source)
+            throws RepositoryException, RemoteException {
+        if (source != null) {
+            workspace.createWorkspace(name, source);
+        } else {
+            workspace.createWorkspace(name);
+        }
+    }
+
+    public void deleteWorkspace(String name)
+            throws RepositoryException, RemoteException {
+        workspace.deleteWorkspace(name);
+    }
+
 }

Modified: jackrabbit/commons/jcr-rmi/trunk/src/test/java/org/apache/jackrabbit/rmi/RepositoryStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/jcr-rmi/trunk/src/test/java/org/apache/jackrabbit/rmi/RepositoryStubImpl.java?rev=900373&r1=900372&r2=900373&view=diff
==============================================================================
--- jackrabbit/commons/jcr-rmi/trunk/src/test/java/org/apache/jackrabbit/rmi/RepositoryStubImpl.java
(original)
+++ jackrabbit/commons/jcr-rmi/trunk/src/test/java/org/apache/jackrabbit/rmi/RepositoryStubImpl.java
Mon Jan 18 12:45:57 2010
@@ -26,11 +26,11 @@
 import javax.jcr.Repository;
 
 import org.apache.jackrabbit.core.JackrabbitRepositoryStub;
+import org.apache.jackrabbit.rmi.client.ClientAdapterFactory;
 import org.apache.jackrabbit.rmi.client.LocalAdapterFactory;
-import org.apache.jackrabbit.rmi.jackrabbit.JackrabbitClientAdapterFactory;
-import org.apache.jackrabbit.rmi.jackrabbit.JackrabbitServerAdapterFactory;
 import org.apache.jackrabbit.rmi.remote.RemoteRepository;
 import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
+import org.apache.jackrabbit.rmi.server.ServerAdapterFactory;
 import org.apache.jackrabbit.test.RepositoryStubException;
 
 public class RepositoryStubImpl extends JackrabbitRepositoryStub {
@@ -48,7 +48,7 @@
             throws RepositoryStubException {
         if (repository == null) {
             try {
-                RemoteAdapterFactory raf = new JackrabbitServerAdapterFactory();
+                RemoteAdapterFactory raf = new ServerAdapterFactory();
                 remote = raf.getRemoteRepository(super.getRepository());
 
                 // Make sure that the remote reference survives serialization
@@ -59,7 +59,7 @@
 
                 ObjectInputStream ois = new ObjectInputStream(
                         new ByteArrayInputStream(buffer.toByteArray()));
-                LocalAdapterFactory laf = new JackrabbitClientAdapterFactory();
+                LocalAdapterFactory laf = new ClientAdapterFactory();
                 repository =
                     laf.getRepository((RemoteRepository) ois.readObject());
             } catch (Exception e) {



Mime
View raw message