jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r927074 [3/3] - in /jackrabbit/trunk/jackrabbit-jcr-rmi: ./ src/main/java/org/apache/jackrabbit/rmi/client/ src/main/java/org/apache/jackrabbit/rmi/remote/ src/main/java/org/apache/jackrabbit/rmi/server/
Date Wed, 24 Mar 2010 14:36:14 GMT
Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientAdapterFactory.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientAdapterFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientAdapterFactory.java
Wed Mar 24 14:36:14 2010
@@ -26,6 +26,7 @@ import javax.jcr.Repository;
 import javax.jcr.Session;
 import javax.jcr.Workspace;
 import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeIterator;
 import javax.jcr.nodetype.NodeTypeManager;
@@ -51,6 +52,7 @@ import org.apache.jackrabbit.rmi.remote.
 import org.apache.jackrabbit.rmi.remote.RemoteItemDefinition;
 import org.apache.jackrabbit.rmi.remote.RemoteIterator;
 import org.apache.jackrabbit.rmi.remote.RemoteLock;
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
 import org.apache.jackrabbit.rmi.remote.RemoteNamespaceRegistry;
 import org.apache.jackrabbit.rmi.remote.RemoteNode;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeDefinition;
@@ -235,7 +237,7 @@ public class ClientAdapterFactory implem
      *
      * {@inheritDoc}
      */
-    public Lock getLock(Session session, Node node, RemoteLock remote) {
+    public Lock getLock(Session session, RemoteLock remote) {
         return new ClientLock(session, remote, this);
     }
 
@@ -320,4 +322,9 @@ public class ClientAdapterFactory implem
         return new ClientRowIterator(remote, this);
     }
 
+    public LockManager getLockManager(
+            Session session, RemoteLockManager remote) {
+        return new ClientLockManager(session, remote, this);
+    }
+
 }

Added: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientLockManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientLockManager.java?rev=927074&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientLockManager.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientLockManager.java
Wed Mar 24 14:36:14 2010
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.rmi.client;
+
+import java.rmi.RemoteException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockManager;
+
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
+
+public class ClientLockManager extends ClientObject implements LockManager {
+
+    /** The current session. */
+    private Session session;
+
+    private RemoteLockManager remote;
+
+    public ClientLockManager(
+            Session session, RemoteLockManager remote,
+            LocalAdapterFactory factory) {
+        super(factory);
+        this.session = session;
+        this.remote = remote;
+    }
+
+    public String[] getLockTokens() throws RepositoryException {
+        try {
+            return remote.getLockTokens();
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public void addLockToken(String lockToken) throws RepositoryException {
+        try {
+            remote.addLockToken(lockToken);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public void removeLockToken(String lockToken) throws RepositoryException {
+        try {
+            remote.removeLockToken(lockToken);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public Lock getLock(String absPath) throws RepositoryException {
+        try {
+            return getFactory().getLock(session, remote.getLock(absPath));
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public boolean holdsLock(String absPath) throws RepositoryException {
+        try {
+            return remote.holdsLock(absPath);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public boolean isLocked(String absPath) throws RepositoryException {
+        try {
+            return remote.isLocked(absPath);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public Lock lock(
+            String absPath, boolean isDeep, boolean isSessionScoped,
+            long timeoutHint, String ownerInfo) throws RepositoryException {
+        try {
+            return getFactory().getLock(session, remote.lock(
+                    absPath, isDeep, isSessionScoped, timeoutHint, ownerInfo));
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+    public void unlock(String absPath) throws RepositoryException {
+        try {
+            remote.unlock(absPath);
+        } catch (RemoteException ex) {
+            throw new RemoteRepositoryException(ex);
+        }
+    }
+
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientLockManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientNode.java
Wed Mar 24 14:36:14 2010
@@ -678,7 +678,7 @@ public class ClientNode extends ClientIt
             throws RepositoryException {
         try {
             RemoteLock lock = remote.lock(isDeep, isSessionScoped);
-            return getFactory().getLock(getSession(), this, lock);
+            return getFactory().getLock(getSession(), lock);
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }
@@ -687,7 +687,7 @@ public class ClientNode extends ClientIt
     /** {@inheritDoc} */
     public Lock getLock() throws RepositoryException {
         try {
-            return getFactory().getLock(getSession(), this, remote.getLock());
+            return getFactory().getLock(getSession(), remote.getLock());
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/ClientWorkspace.java
Wed Mar 24 14:36:14 2010
@@ -66,6 +66,8 @@ public class ClientWorkspace extends Cli
      */
     private ObservationManager observationManager;
 
+    private LockManager lockManager;
+
     /**
      * Creates a client adapter for the given remote workspace.
      *
@@ -262,8 +264,18 @@ public class ClientWorkspace extends Cli
         }
     }
 
+    /** {@inheritDoc} */
     public LockManager getLockManager() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("TODO: JCRRMI-26");
+        if (lockManager == null) {
+            try {
+                lockManager = getFactory().getLockManager(
+                        session, remote.getLockManager());
+            } catch (RemoteException ex) {
+                throw new RemoteRepositoryException(ex);
+            }
+        }
+
+        return lockManager;
     }
 
     public VersionManager getVersionManager() throws RepositoryException {

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/LocalAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/LocalAdapterFactory.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/LocalAdapterFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/client/LocalAdapterFactory.java
Wed Mar 24 14:36:14 2010
@@ -26,6 +26,7 @@ import javax.jcr.Repository;
 import javax.jcr.Session;
 import javax.jcr.Workspace;
 import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.ItemDefinition;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
@@ -46,6 +47,7 @@ import org.apache.jackrabbit.rmi.remote.
 import org.apache.jackrabbit.rmi.remote.RemoteItemDefinition;
 import org.apache.jackrabbit.rmi.remote.RemoteIterator;
 import org.apache.jackrabbit.rmi.remote.RemoteLock;
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
 import org.apache.jackrabbit.rmi.remote.RemoteNamespaceRegistry;
 import org.apache.jackrabbit.rmi.remote.RemoteNode;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeDefinition;
@@ -233,11 +235,10 @@ public interface LocalAdapterFactory {
      * Factory method for creating a local adapter for a remote lock.
      *
      * @param session current session
-     * @param node current node
      * @param remote remote lock
      * @return local lock adapter
      */
-    Lock getLock(Session session, Node node, RemoteLock remote);
+    Lock getLock(Session session, RemoteLock remote);
 
     /**
      * Factory method for creating a local adapter for a remote query manager.
@@ -318,4 +319,6 @@ public interface LocalAdapterFactory {
      */
     RowIterator getRowIterator(RemoteIterator remote);
 
+    LockManager getLockManager(Session session, RemoteLockManager lockManager);
+
 }

Added: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteLockManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteLockManager.java?rev=927074&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteLockManager.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteLockManager.java
Wed Mar 24 14:36:14 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.rmi.remote;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.jcr.RepositoryException;
+
+public interface RemoteLockManager extends Remote {
+
+    String[] getLockTokens() throws RepositoryException, RemoteException;
+
+    void addLockToken(String lockToken)
+        throws RepositoryException, RemoteException;
+
+    void removeLockToken(String lockToken)
+        throws RepositoryException, RemoteException;
+
+    RemoteLock getLock(String absPath)
+        throws RepositoryException, RemoteException;
+
+    boolean holdsLock(String absPath)
+        throws RepositoryException, RemoteException;
+
+    boolean isLocked(String absPath)
+        throws RepositoryException, RemoteException;
+
+    RemoteLock lock(
+        String absPath, boolean isDeep, boolean isSessionScoped,
+        long timeoutHint, String ownerInfo)
+        throws RepositoryException, RemoteException;
+
+    void unlock(String absPath) throws RepositoryException, RemoteException;
+
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteLockManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/remote/RemoteWorkspace.java
Wed Mar 24 14:36:14 2010
@@ -189,4 +189,7 @@ public interface RemoteWorkspace extends
     void deleteWorkspace(String name)
             throws RepositoryException, RemoteException;
 
+    RemoteLockManager getLockManager()
+        throws RepositoryException, RemoteException;
+
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/RemoteAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/RemoteAdapterFactory.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/RemoteAdapterFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/RemoteAdapterFactory.java
Wed Mar 24 14:36:14 2010
@@ -28,6 +28,7 @@ import javax.jcr.Repository;
 import javax.jcr.Session;
 import javax.jcr.Workspace;
 import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.ItemDefinition;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
@@ -50,6 +51,7 @@ import org.apache.jackrabbit.rmi.remote.
 import org.apache.jackrabbit.rmi.remote.RemoteItemDefinition;
 import org.apache.jackrabbit.rmi.remote.RemoteIterator;
 import org.apache.jackrabbit.rmi.remote.RemoteLock;
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
 import org.apache.jackrabbit.rmi.remote.RemoteNamespaceRegistry;
 import org.apache.jackrabbit.rmi.remote.RemoteNode;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeDefinition;
@@ -361,4 +363,7 @@ public interface RemoteAdapterFactory {
     RemoteIterator getRemoteRowIterator(RowIterator iterator)
         throws RemoteException;
 
+    RemoteLockManager getRemoteLockManager(LockManager lockManager)
+        throws RemoteException;
+
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerAdapterFactory.java
Wed Mar 24 14:36:14 2010
@@ -31,6 +31,7 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Workspace;
 import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.ItemDefinition;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
@@ -57,6 +58,7 @@ import org.apache.jackrabbit.rmi.remote.
 import org.apache.jackrabbit.rmi.remote.RemoteItemDefinition;
 import org.apache.jackrabbit.rmi.remote.RemoteIterator;
 import org.apache.jackrabbit.rmi.remote.RemoteLock;
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
 import org.apache.jackrabbit.rmi.remote.RemoteNamespaceRegistry;
 import org.apache.jackrabbit.rmi.remote.RemoteNode;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeDefinition;
@@ -432,4 +434,9 @@ public class ServerAdapterFactory implem
                 new ServerRowIterator(iterator, this, bufferSize));
     }
 
+    public RemoteLockManager getRemoteLockManager(LockManager lockManager)
+            throws RemoteException {
+        return new ServerLockManager(lockManager, this);
+    }
+
 }

Added: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerLockManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerLockManager.java?rev=927074&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerLockManager.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerLockManager.java
Wed Mar 24 14:36:14 2010
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.rmi.server;
+
+import java.rmi.RemoteException;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.LockManager;
+
+import org.apache.jackrabbit.rmi.remote.RemoteLock;
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
+
+public class ServerLockManager extends ServerObject
+        implements RemoteLockManager {
+
+    /** The adapted local lock manager. */
+    private LockManager manager;
+
+    public ServerLockManager(LockManager manager, RemoteAdapterFactory factory)
+            throws RemoteException {
+        super(factory);
+        this.manager = manager;
+    }
+
+    public String[] getLockTokens() throws RepositoryException {
+        return manager.getLockTokens();
+    }
+
+    public void addLockToken(String lockToken) throws RepositoryException {
+        manager.addLockToken(lockToken);
+    }
+
+    public void removeLockToken(String lockToken) throws RepositoryException {
+        manager.removeLockToken(lockToken);
+    }
+
+    public boolean isLocked(String absPath) throws RepositoryException {
+        return manager.isLocked(absPath);
+    }
+
+    public boolean holdsLock(String absPath) throws RepositoryException {
+        return manager.holdsLock(absPath);
+    }
+
+    public RemoteLock getLock(String absPath)
+            throws RepositoryException, RemoteException {
+        return getFactory().getRemoteLock(manager.getLock(absPath));
+    }
+
+    public RemoteLock lock(
+            String absPath, boolean isDeep, boolean isSessionScoped,
+            long timeoutHint, String ownerInfo)
+            throws RepositoryException, RemoteException {
+        return getFactory().getRemoteLock(manager.lock(
+                absPath, isDeep, isSessionScoped, timeoutHint, ownerInfo));
+    }
+
+    public void unlock(String absPath) throws RepositoryException {
+        manager.unlock(absPath);
+    }
+
+}

Propchange: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerLockManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java?rev=927074&r1=927073&r2=927074&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/ServerWorkspace.java
Wed Mar 24 14:36:14 2010
@@ -23,10 +23,12 @@ import java.rmi.RemoteException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
 import javax.jcr.Workspace;
+import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.observation.ObservationManager;
 import javax.jcr.query.QueryManager;
 
+import org.apache.jackrabbit.rmi.remote.RemoteLockManager;
 import org.apache.jackrabbit.rmi.remote.RemoteNamespaceRegistry;
 import org.apache.jackrabbit.rmi.remote.RemoteNodeTypeManager;
 import org.apache.jackrabbit.rmi.remote.RemoteObservationManager;
@@ -56,6 +58,8 @@ public class ServerWorkspace extends Ser
      */
     private RemoteObservationManager remoteObservationManager;
 
+    private RemoteLockManager remoteLockManager;
+
     /**
      * Creates a remote adapter for the given local workspace.
      *
@@ -200,4 +204,19 @@ public class ServerWorkspace extends Ser
         workspace.deleteWorkspace(name);
     }
 
+    /** {@inheritDoc} */
+    public RemoteLockManager getLockManager()
+            throws RepositoryException, RemoteException {
+        try {
+            if (remoteLockManager == null) {
+                LockManager lockManager = workspace.getLockManager();
+                remoteLockManager =
+                    getFactory().getRemoteLockManager(lockManager);
+            }
+            return remoteLockManager;
+        } catch (RepositoryException ex) {
+            throw getRepositoryException(ex);
+        }
+    }
+
 }



Mime
View raw message