jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r544294 - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src: main/java/org/apache/jackrabbit/ocm/lock/Lock.java test/java/org/apache/jackrabbit/ocm/testmodel/Lockable.java
Date Mon, 04 Jun 2007 21:54:30 GMT
Author: clombart
Date: Mon Jun  4 14:54:29 2007
New Revision: 544294

URL: http://svn.apache.org/viewvc?view=rev&rev=544294
Log:
work on JCR-922 : 
Review method lock in the PersistenceManager. Now it returns a Lock object.
Add unit test. See the data value object 'Lockable' in the pck testmodel. 

Added:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/lock/Lock.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Lockable.java

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/lock/Lock.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/lock/Lock.java?view=auto&rev=544294
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/lock/Lock.java
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/lock/Lock.java
Mon Jun  4 14:54:29 2007
@@ -0,0 +1,83 @@
+/*
+ * 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.ocm.lock;
+
+import javax.jcr.Node;
+
+import org.apache.jackrabbit.ocm.exception.RepositoryException;
+
+/**
+ * Wrapper class for a JCR Lock object
+ * 
+ * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
+ * 
+ */
+public class Lock
+{
+
+	private javax.jcr.lock.Lock lock;
+
+	public Lock(javax.jcr.lock.Lock lock)
+	{
+		this.lock = lock;
+	}
+
+	public String getLockOwner() {
+		return lock.getLockOwner();
+	}
+
+	public String getLockToken() {
+		return lock.getLockToken();
+	}
+
+	public Node getNode() {
+		return lock.getNode();
+	}
+
+	public boolean isDeep() {
+		return lock.isDeep();
+	}
+
+	public boolean isLive()  {
+		try 
+		{
+		   return lock.isLive();
+		}
+		catch (javax.jcr.RepositoryException e)
+		{
+			throw new RepositoryException(e);
+		}
+	}
+
+	public boolean isSessionScoped() {
+		return lock.isSessionScoped();
+	}
+
+	public void refresh() {
+		try 
+		{
+		   lock.refresh();
+		}
+		catch (javax.jcr.RepositoryException e)
+		{
+			throw new RepositoryException(e);
+		}
+		
+	}
+
+	
+}

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Lockable.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Lockable.java?view=auto&rev=544294
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Lockable.java
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Lockable.java
Mon Jun  4 14:54:29 2007
@@ -0,0 +1,79 @@
+/*
+ * 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.ocm.testmodel;
+
+
+/**
+ *
+ * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
+ * 
+ */
+public class Lockable
+{
+	private String path; 
+    private String a1;
+    private String a2;
+    private String lockOwner;
+    
+    
+    public String getPath() {
+		return path;
+	}
+	public void setPath(String path) {
+		this.path = path;
+	}
+	/**
+     * @return Returns the a1.
+     */
+    public String getA1()
+    {
+        return a1;
+    }
+    /**
+     * @param a1 The a1 to set.
+     */
+    public void setA1(String a1)
+    {
+        this.a1 = a1;
+    }
+    /**
+     * @return Returns the a2.
+     */
+    public String getA2()
+    {
+        return a2;
+    }
+    /**
+     * @param a2 The a2 to set.
+     */
+    public void setA2(String a2)
+    {
+        this.a2 = a2;
+    }
+    
+	public String getLockOwner() 
+	{
+		return lockOwner;
+	}
+	
+	public void setLockOwner(String lockOwner) 
+	{
+		this.lockOwner = lockOwner;
+	}
+    
+    
+}



Mime
View raw message