Author: jukka Date: Tue Aug 10 11:51:43 2010 New Revision: 983943 URL: http://svn.apache.org/viewvc?rev=983943&view=rev Log: JCR-890: concurrent read-only access to a session Add toString() method to SessionItemOperation Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java?rev=983943&r1=983942&r2=983943&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java (original) +++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java Tue Aug 10 11:51:43 2010 @@ -33,12 +33,19 @@ import org.apache.jackrabbit.spi.commons */ public abstract class SessionItemOperation implements SessionOperation { + private final String method; + private final String path; - private SessionItemOperation(String path) { + private SessionItemOperation(String method, String path) { + this.method = method; this.path = path; } + public String toString() { + return method + "(" + path + ")"; + } + public T perform(SessionContext context) throws RepositoryException { try { Path normalized = @@ -59,7 +66,7 @@ public abstract class SessionItemOperati throws RepositoryException; public static SessionItemOperation itemExists(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("itemExists", path) { @Override @SuppressWarnings("deprecation") protected Boolean perform(ItemManager manager, Path path) { return manager.itemExists(path); @@ -68,7 +75,7 @@ public abstract class SessionItemOperati } public static SessionItemOperation propertyExists(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("propertyExists", path) { @Override protected Boolean perform(ItemManager manager, Path path) { return manager.propertyExists(path); @@ -77,7 +84,7 @@ public abstract class SessionItemOperati } public static SessionItemOperation nodeExists(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("nodeExists", path) { @Override protected Boolean perform(ItemManager manager, Path path) { return manager.nodeExists(path); @@ -86,7 +93,7 @@ public abstract class SessionItemOperati } public static SessionItemOperation getItem(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("getItem", path) { @Override @SuppressWarnings("deprecation") protected ItemImpl perform(ItemManager manager, Path path) throws RepositoryException { @@ -96,7 +103,7 @@ public abstract class SessionItemOperati } public static SessionItemOperation getProperty(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("getProperty", path) { @Override protected PropertyImpl perform(ItemManager manager, Path path) throws RepositoryException { @@ -106,7 +113,7 @@ public abstract class SessionItemOperati } public static SessionItemOperation getNode(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("getNode", path) { @Override protected NodeImpl perform(ItemManager manager, Path path) throws RepositoryException { @@ -116,7 +123,7 @@ public abstract class SessionItemOperati } public static SessionItemOperation remove(String path) { - return new SessionItemOperation(path) { + return new SessionItemOperation("remove", path) { @Override @SuppressWarnings("deprecation") protected Object perform(ItemManager manager, Path path) throws RepositoryException {