jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r487897 - /jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/
Date Sat, 16 Dec 2006 21:37:08 GMT
Author: jukka
Date: Sat Dec 16 13:37:07 2006
New Revision: 487897

URL: http://svn.apache.org/viewvc?view=rev&rev=487897
Log:
JCR-585: Added some javadocs.

Modified:
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.java
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitNodeTypeManager.java
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitWorkspace.java
    jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitNodeTypeManager.java

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java?view=diff&rev=487897&r1=487896&r2=487897
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitClientAdapterFactory.java
Sat Dec 16 13:37:07 2006
@@ -20,12 +20,29 @@
 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.
+ */
 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(
@@ -35,6 +52,14 @@
         }
     }
 
+    /**
+     * 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(

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.java?view=diff&rev=487897&r1=487896&r2=487897
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/JackrabbitServerAdapterFactory.java
Sat Dec 16 13:37:07 2006
@@ -25,10 +25,27 @@
 import org.apache.jackrabbit.api.JackrabbitWorkspace;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeTypeManager;
 import org.apache.jackrabbit.rmi.remote.RemoteWorkspace;
+import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
 import org.apache.jackrabbit.rmi.server.ServerAdapterFactory;
 
+/**
+ * Jackrabbit-specific {@link RemoteAdapterFactory}. This factory extends
+ * the default {@link ServerAdapterFactory} implementation with adapter
+ * classes that implement remote versions of the Jackrabbit API extension
+ * interfaces. The implementation degrades gracefully when used with other
+ * repositories.
+ */
 public class JackrabbitServerAdapterFactory extends ServerAdapterFactory {
 
+    /**
+     * Returns a {@link RemoteJackrabbitNodeTypeManager} adapter if given a
+     * {@link JackrabbitNodeTypeManager} reference. Alternatively falls
+     * back to the default adapter from the parent class.
+     *
+     * @param manager local node type manager
+     * @return remote node type manager
+     * @throws RemoteException if the remote adapter could not be created
+     */
     public RemoteNodeTypeManager getRemoteNodeTypeManager(
             NodeTypeManager manager) throws RemoteException {
         if (manager instanceof JackrabbitNodeTypeManager) {
@@ -39,6 +56,15 @@
         }
     }
 
+    /**
+     * Returns a {@link RemoteJackrabbitWorkspace} adapter if given a
+     * {@link JackrabbitWorkspace} reference. Alternatively falls
+     * back to the default adapter from the parent class.
+     *
+     * @param workspace local workspace
+     * @return remote node type manager
+     * @throws RemoteException if the remote adapter could not be created
+     */
     public RemoteWorkspace getRemoteWorkspace(Workspace workspace)
             throws RemoteException {
         if (workspace instanceof JackrabbitWorkspace) {

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitNodeTypeManager.java?view=diff&rev=487897&r1=487896&r2=487897
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitNodeTypeManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitNodeTypeManager.java
Sat Dec 16 13:37:07 2006
@@ -16,20 +16,41 @@
  */
 package org.apache.jackrabbit.rmi.jackrabbit;
 
-import java.io.IOException;
 import java.rmi.RemoteException;
 
 import javax.jcr.RepositoryException;
 
+import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeType;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeTypeManager;
 
+/**
+ * Remote version of the {@link JackrabbitNodeTypeManager} extension interface.
+ */
 public interface RemoteJackrabbitNodeTypeManager extends RemoteNodeTypeManager {
 
+    /**
+     * Checks if the named node type exists.
+     *
+     * @param name node type name
+     * @return <code>true</code> if the named node type exists,
+     *         <code>false</code> otherwise
+     * @throws RepositoryException if a repository error occurs
+     * @throws RemoteException if a remote error occurs.
+     */
     boolean hasNodeType(String name)
         throws RepositoryException, RemoteException;
 
+    /**
+     * Registers node types defined in the given node type definitions.
+     *
+     * @param content node type definitions
+     * @param contentType type of the node type definitions
+     * @return registered node types
+     * @throws RepositoryException if a repository error occurs
+     * @throws RemoteException if a remote error occurs.
+     */
     RemoteNodeType[] registerNodeTypes(byte[] content, String contentType)
-        throws IOException, RepositoryException, RemoteException;
+        throws RepositoryException, RemoteException;
 
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitWorkspace.java?view=diff&rev=487897&r1=487896&r2=487897
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitWorkspace.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/RemoteJackrabbitWorkspace.java
Sat Dec 16 13:37:07 2006
@@ -20,10 +20,22 @@
 
 import javax.jcr.RepositoryException;
 
+import org.apache.jackrabbit.api.JackrabbitWorkspace;
 import org.apache.jackrabbit.rmi.remote.RemoteWorkspace;
 
+/**
+ * Remote version of the {@link JackrabbitWorkspace} extension interface.
+ */
 public interface RemoteJackrabbitWorkspace extends RemoteWorkspace {
 
+    /**
+     * Creates a new workspace.
+     *
+     * @param name workspace name
+     * @param template workspace configuration template, or <code>null</code>
+     * @throws RepositoryException if a repository error occurs
+     * @throws RemoteException if a remote exception occurs
+     */
     void createWorkspace(String name, byte[] template)
         throws RepositoryException, RemoteException;
 

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitNodeTypeManager.java?view=diff&rev=487897&r1=487896&r2=487897
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitNodeTypeManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/jackrabbit/ServerJackrabbitNodeTypeManager.java
Sat Dec 16 13:37:07 2006
@@ -46,15 +46,18 @@
     }
 
     public RemoteNodeType[] registerNodeTypes(
-            byte[] content, String type)
-            throws IOException, RepositoryException {
-        InputStream stream = new ByteArrayInputStream(content);
-        NodeType[] types = manager.registerNodeTypes(stream, type);
-        RemoteNodeType[] remotes = new RemoteNodeType[types.length];
-        for (int i = 0; i < types.length; i++) {
-            remotes[i] = getFactory().getRemoteNodeType(types[i]);
+            byte[] content, String type) throws RepositoryException {
+        try {
+            InputStream stream = new ByteArrayInputStream(content);
+            NodeType[] types = manager.registerNodeTypes(stream, type);
+            RemoteNodeType[] remotes = new RemoteNodeType[types.length];
+            for (int i = 0; i < types.length; i++) {
+                remotes[i] = getFactory().getRemoteNodeType(types[i]);
+            }
+            return remotes;
+        } catch (IOException e) {
+            throw new RepositoryException(e);
         }
-        return remotes;
     }
 
 }



Mime
View raw message