jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r161553 [3/4] - in incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org: ./ apache/ apache/jackrabbit/ apache/jackrabbit/base/ apache/jackrabbit/base/nodetype/ apache/jackrabbit/decorator/ apache/jackrabbit/iterator/ apache/jackrabbit/lite/ apache/jackrabbit/lite/nodetype/ apache/jackrabbit/name/ apache/jackrabbit/trace/ apache/jackrabbit/xml/
Date Sat, 16 Apr 2005 05:46:26 GMT
Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/LiteWorkspace.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/LiteWorkspace.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/LiteWorkspace.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/LiteWorkspace.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.Workspace;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.version.VersionException;
+
+import org.apache.jackrabbit.base.BaseWorkspace;
+import org.xml.sax.ContentHandler;
+
+/**
+ * Lightweight implementation of the JCR Workspace interface.
+ */
+public class LiteWorkspace extends BaseWorkspace {
+
+    /**
+     * Creates a temporary workspace/session pair for the identified
+     * workspace. The created temporary session can be used to bypass
+     * the transient state of the current session.
+     * <p>
+     * Subclasses need to implement this method to make the default behaviour
+     * of this base class functional. By default this method just throws
+     * an {@link UnsupportedRepositoryOperationException UnsupportedRepositoryOperationException}.
+     *
+     * @param name workspace name
+     * @return temporary workspace reference
+     * @throws RepositoryException on repository errors
+     */
+    protected Workspace getWorkspace(String name) throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException();
+    }
+
+    /**
+     * Recursively copies the given source node into a child node of
+     * the given destination parent node. The nodes need not be from
+     * the same session or workspace.
+     * <p>
+     * This utility method is invoked by the default implementation of
+     * the public {@link #copy(String, String, String) copy} method.
+     *
+     * @param srcNode source node
+     * @param destParent destination parent node
+     * @throws RepositoryException on repository errors
+     */
+    private void copy(Node srcNode, Node destParent)
+            throws RepositoryException {
+        Node destNode = destParent.addNode(srcNode.getName());
+
+        PropertyIterator properties = srcNode.getProperties();
+        while (properties.hasNext()) {
+            Property property = properties.nextProperty();
+            if (property.getDefinition().isMultiple()) {
+                destNode.setProperty(property.getName(), property.getValues());
+            } else {
+                destNode.setProperty(property.getName(), property.getValue());
+            }
+        }
+
+        NodeIterator children = srcNode.getNodes();
+        while (children.hasNext()) {
+            copy(children.nextNode(), destNode);
+        }
+    }
+
+    /**
+     * Copies the identified content subtree to the given location.
+     * Implemented by creating temporary sessions for both this and
+     * the source workspace and copying the content subtree recursively
+     * item by item.
+     * {@inheritDoc}
+     */
+    public void copy(String srcWorkspace, String srcAbsPath, String destAbsPath)
+            throws NoSuchWorkspaceException, ConstraintViolationException,
+            VersionException, AccessDeniedException, PathNotFoundException,
+            ItemExistsException, LockException, RepositoryException {
+        Session srcSession = null;
+        Session destSession = null;
+        try {
+            srcSession = getWorkspace(srcWorkspace).getSession();
+            Item srcNode = srcSession.getItem(srcAbsPath);
+            if (!srcNode.isNode()) {
+                throw new PathNotFoundException(
+                        "Invalid node path " + srcAbsPath);
+            }
+
+            destSession = getWorkspace(getName()).getSession();
+            Item destParent = destSession.getItem(destAbsPath);
+            if (!destParent.isNode()) {
+                throw new PathNotFoundException(
+                        "Invalid node path " + destAbsPath);
+            }
+
+            copy((Node) srcNode, (Node) destParent);
+            destSession.save();
+        } finally {
+            try { srcSession.logout(); } catch (Exception e) { }
+            try { destSession.logout(); } catch (Exception e) { }
+        }
+    }
+
+    public ContentHandler getImportContentHandler(String parentAbsPath,
+            int uuidBehavior) throws PathNotFoundException,
+            ConstraintViolationException, VersionException, LockException,
+            RepositoryException {
+        Session session = null;
+        try {
+            session = getWorkspace(getName()).getSession();
+            // TODO
+            session.save();
+            throw new UnsupportedRepositoryOperationException();
+        } finally {
+            try { session.logout(); } catch (Exception e) { }
+        }
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/LiteWorkspace.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteItemDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteItemDef.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteItemDef.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteItemDef.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite.nodetype;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.ItemDef;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.jackrabbit.name.Name;
+
+/**
+ * TODO
+ */
+public class LiteItemDef implements ItemDef {
+
+    private final Session session;
+
+    private final Name name;
+
+    private final NodeType declaringNodeType;
+
+    private int onParentVersion;
+
+    private boolean autoCreate;
+
+    private boolean mandatory;
+
+    private boolean isProtected;
+
+    protected LiteItemDef(
+            Session session, Name name, NodeType declaringNodeType,
+            int onParentVersion, boolean autoCreate,
+            boolean mandatory, boolean isProtected) {
+        this.session = session;
+        this.name = name;
+        this.declaringNodeType = declaringNodeType;
+        this.onParentVersion = onParentVersion;
+        this.autoCreate = autoCreate;
+        this.mandatory = mandatory;
+        this.isProtected = isProtected;
+    }
+
+    public NodeType getDeclaringNodeType() {
+        return declaringNodeType;
+    }
+
+    public String getName() {
+        try {
+            return name.toJCRName(session);
+        } catch (RepositoryException e) {
+            throw new IllegalStateException(
+                    "Unexpected namespace problem: " + e.getMessage());
+        }
+    }
+
+    public int getOnParentVersion() {
+        return onParentVersion;
+    }
+
+    public boolean isAutoCreate() {
+        return autoCreate;
+    }
+
+    public boolean isMandatory() {
+        return mandatory;
+    }
+
+    public boolean isProtected() {
+        return isProtected;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteItemDef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeDef.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeDef.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeDef.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite.nodetype;
+
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.jackrabbit.name.Name;
+
+/**
+ * TODO
+ */
+public class LiteNodeDef extends LiteItemDef implements NodeDef {
+
+    public LiteNodeDef(
+            Session session, Name name, NodeType declaringNodeType,
+            int onParentVersion, boolean autoCreate,
+            boolean mandatory, boolean isProtected) {
+        super(session, name, declaringNodeType,
+                onParentVersion, autoCreate, mandatory, isProtected);
+    }
+
+    /** {@inheritDoc} */
+    public NodeType[] getRequiredPrimaryTypes() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    public NodeType getDefaultPrimaryType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    public boolean allowSameNameSibs() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeDef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeType.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeType.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeType.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite.nodetype;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.PropertyDef;
+
+import org.apache.jackrabbit.base.nodetype.BaseNodeType;
+import org.apache.jackrabbit.name.Name;
+
+/**
+ * TODO
+ */
+public class LiteNodeType extends BaseNodeType {
+
+    private final Session session;
+
+    private final Name name;
+
+    private final NodeType[] supertypes;
+
+    private final NodeDef[] childNodeDefs;
+
+    private final PropertyDef[] propertyDefs;
+
+    private final Name primaryItemName;
+
+    private final boolean orderableChildNodes;
+
+    private final boolean mixin;
+
+    public LiteNodeType(
+            Session session, Name name, NodeType[] supertypes,
+            NodeDef[] childNodeDefs, PropertyDef[] propertyDefs,
+            Name primaryItemName, boolean orderableChildNodes, boolean mixin) {
+        this.session = session;
+        this.name = name;
+        this.supertypes = supertypes;
+        this.childNodeDefs = childNodeDefs;
+        this.propertyDefs = propertyDefs;
+        this.primaryItemName = primaryItemName;
+        this.orderableChildNodes = orderableChildNodes;
+        this.mixin = mixin;
+    }
+
+    public String getName() {
+        try {
+            return name.toJCRName(session);
+        } catch (RepositoryException e) {
+            throw new IllegalStateException(e.getMessage());
+        }
+    }
+
+    public NodeType[] getDeclaredSupertypes() {
+        NodeType[] types = new NodeType[supertypes.length];
+        for (int i = 0; i < supertypes.length; i++) {
+            types[i] = supertypes[i];
+        }
+        return types;
+    }
+
+    public NodeDef[] getDeclaredChildNodeDefs() {
+        NodeDef[] defs = new NodeDef[childNodeDefs.length];
+        for (int i = 0; i < childNodeDefs.length; i++) {
+            defs[i] = childNodeDefs[i];
+        }
+        return defs;
+    }
+
+    public PropertyDef[] getDeclaredPropertyDefs() {
+        PropertyDef[] defs = new PropertyDef[propertyDefs.length];
+        for (int i = 0; i < propertyDefs.length; i++) {
+            defs[i] = propertyDefs[i];
+        }
+        return defs;
+    }
+
+    public String getPrimaryItemName() {
+        try {
+            return primaryItemName.toJCRName(session);
+        } catch (RepositoryException e) {
+            throw new IllegalStateException(e.getMessage());
+        }
+    }
+
+    public boolean hasOrderableChildNodes() {
+        return orderableChildNodes;
+    }
+
+    public boolean isMixin() {
+        return mixin;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeTypeManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeTypeManager.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeTypeManager.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeTypeManager.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite.nodetype;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeIterator;
+
+import org.apache.jackrabbit.base.nodetype.BaseNodeTypeManager;
+import org.apache.jackrabbit.iterator.ArrayNodeTypeIterator;
+
+/**
+ * TODO
+ */
+public class LiteNodeTypeManager extends BaseNodeTypeManager {
+
+    private final Set types;
+
+    protected LiteNodeTypeManager(Session session) {
+        this.types = new HashSet();
+    }
+
+    protected void addNodeType(NodeType type) {
+        types.add(type);
+    }
+
+    /** {@inheritDoc} */
+    public NodeTypeIterator getAllNodeTypes() throws RepositoryException {
+        return new ArrayNodeTypeIterator(
+                (NodeType[]) types.toArray(new NodeType[0]));
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LiteNodeTypeManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LitePropertyDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LitePropertyDef.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LitePropertyDef.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LitePropertyDef.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite.nodetype;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.jcr.Session;
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.PropertyDef;
+
+import org.apache.jackrabbit.name.Name;
+
+/**
+ * TODO
+ */
+public class LitePropertyDef extends LiteItemDef implements PropertyDef {
+
+    private final int requiredType;
+
+    private final boolean multiple;
+
+    private final List constraints;
+
+    private final List defaults;
+
+    public LitePropertyDef(
+            Session session, Name name, NodeType declaringNodeType,
+            int onParentVersion, boolean autoCreate,
+            boolean mandatory, boolean isProtected,
+            int requiredType, boolean multiple) {
+        super(session, name, declaringNodeType,
+                onParentVersion, autoCreate, mandatory, isProtected);
+        this.requiredType = requiredType;
+        this.multiple = multiple;
+        this.constraints = new LinkedList();
+        this.defaults = new LinkedList();
+    }
+
+    /** {@inheritDoc} */
+    public int getRequiredType() {
+        return requiredType;
+    }
+
+    /** {@inheritDoc} */
+    public boolean isMultiple() {
+        return multiple;
+    }
+
+    /** {@inheritDoc} */
+    public String[] getValueConstraints() {
+        return (String[]) constraints.toArray(new String[0]);
+    }
+
+    public void addValueConstraint(String constraint) {
+        constraints.add(constraint);
+    }
+
+    /** {@inheritDoc} */
+    public Value[] getDefaultValues() {
+        return (Value[]) defaults.toArray(new Value[0]);
+    }
+
+    public void addDefaultValue(Value value) {
+        defaults.add(value);
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/LitePropertyDef.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/PropertyDefBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/PropertyDefBuilder.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/PropertyDefBuilder.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/PropertyDefBuilder.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.lite.nodetype;
+
+/**
+ * TODO
+ */
+public class PropertyDefBuilder {
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/nodetype/PropertyDefBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/package.html
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/package.html?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/package.html (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/package.html Fri Apr 15 22:46:17 2005
@@ -0,0 +1,21 @@
+<body>
+Lightweight implementation of the JCR API.
+<p>
+This package contains lightweight implementations of the JCR API interfaces.
+The implementation classes inherit from the
+{@link org.apache.jackrabbit.base general base classes} and implement as
+much of the JCR functionality as reasonably possible without actually
+storing anything.
+<p>
+In addition to the JCR API methods, the classes in this package also provide
+a set of protected methods that allow subclasses to selectively modify the
+implemented behaviour. The implementation details are documented using
+Javadoc comments.
+<p>
+The purpose of this package is to provide a reasonable starting point
+for implementing a simple JCR adapter for an existing content repository
+or a new JCR content repository. Note however that the main goal of this
+package is to simplify, not to optimize JCR implementations. Much of the
+implemented functionality is (and will always be) slow and unnecessarily
+resource-intensive due to these constraints.
+</body>

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/lite/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/IndexedElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/IndexedElement.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/IndexedElement.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/IndexedElement.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.Item;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+
+/**
+ * TODO
+ */
+class IndexedElement implements PathElement {
+
+    private final Name name;
+
+    private final int index;
+
+    public IndexedElement(Name name, int index) {
+        this.name = name;
+        this.index = index;
+    }
+
+    /** {@inheritDoc} */
+    public Item step(Item item) throws ItemNotFoundException,
+            RepositoryException {
+        if (item.isNode()) {
+            String pattern = name.toJCRName(item.getSession());
+            NodeIterator nodes = ((Node) item).getNodes(pattern);
+            if (index <= nodes.getSize()) {
+                nodes.skip(index - 1);
+                return nodes.nextNode();
+            }
+        }
+
+        throw new ItemNotFoundException("Invalid item path " + name);
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/IndexedElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Name.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Name.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Name.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Name.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+/**
+ * TODO
+ */
+public class Name {
+
+    public static Name parseJCRName(Session session, String name)
+            throws NamespaceException, RepositoryException {
+        int p = name.indexOf(':');
+        if (p != -1) {
+            String prefix = name.substring(0, p);
+            name = name.substring(p + 1);
+            return new Name(session.getNamespaceURI(prefix), name);
+        } else {
+            return new Name(session.getNamespaceURI(""), name);
+        }
+    }
+
+    private final String namespace;
+
+    private final String name;
+
+    public Name(String namespace, String name) {
+        this.namespace = namespace;
+        this.name = name;
+    }
+
+    public String getNamespaceURI() {
+        return namespace;
+    }
+
+    public String getLocalPart() {
+        return name;
+    }
+
+    public String toJCRName(Session session)
+            throws NamespaceException, RepositoryException {
+        String prefix = session.getNamespacePrefix(namespace);
+        return prefix + ":" + name;
+    }
+
+    public boolean equals(Object object) {
+        if (object instanceof Name) {
+            Name qname = (Name) object;
+            return namespace.equals(qname.namespace) && name.equals(qname.name);
+        } else {
+            return false;
+        }
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Name.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/NamedElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/NamedElement.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/NamedElement.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/NamedElement.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.Item;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+
+/**
+ * TODO
+ */
+class NamedElement implements PathElement {
+
+    private final Name name;
+
+    public NamedElement(Name name) {
+        this.name = name;
+    }
+
+    /** {@inheritDoc} */
+    public Item step(Item item) throws ItemNotFoundException,
+            RepositoryException {
+        if (item.isNode()) {
+            String pattern = name.toJCRName(item.getSession());
+
+            PropertyIterator properties = ((Node) item).getProperties(pattern);
+            if (properties.hasNext()) {
+                return properties.nextProperty();
+            }
+
+            NodeIterator nodes = ((Node) item).getNodes(pattern);
+            if (nodes.hasNext()) {
+                return nodes.nextNode();
+            }
+        }
+
+        throw new ItemNotFoundException("Invalid item path " + name);
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/NamedElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ParentElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ParentElement.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ParentElement.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ParentElement.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.Item;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.RepositoryException;
+
+/**
+ * TODO
+ */
+class ParentElement implements PathElement {
+
+    /** Singleton instance. */
+    private static final PathElement instance = new ParentElement();
+
+    public static PathElement getInstance() {
+        return instance;
+    }
+
+    private ParentElement() {
+    }
+
+    /** {@inheritDoc} */
+    public Item step(Item item) throws ItemNotFoundException,
+            RepositoryException {
+        return item.getParent();
+    }
+
+    public boolean equals(Object other) {
+        return other == instance;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ParentElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Path.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Path.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Path.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Path.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.jcr.Item;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.NamespaceException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+/**
+ * TODO
+ */
+public class Path {
+
+    /**
+     * Pattern used to validate and parse path elements:<p>
+     * <ul>
+     * <li>group 1 is .
+     * <li>group 2 is ..
+     * <li>group 3 is namespace prefix incl. delimiter (colon)
+     * <li>group 4 is namespace prefix excl. delimiter (colon)
+     * <li>group 5 is localName
+     * <li>group 6 is index incl. brackets
+     * <li>group 7 is index excl. brackets
+     * </ul>
+     */
+    private static final Pattern PATH_ELEMENT_PATTERN = Pattern.compile(
+            "(\\.?)" + "|" + "(\\.\\.)" + "|" + "(([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?):)?([^ /:\\[\\]*'\"|](?:[^/:\\[\\]*'\"|]*[^ /:\\[\\]*'\"|])?)(\\[([1-9]\\d*)\\])?");
+
+    public static Path parseJCRPath(Session session, String path)
+            throws IllegalArgumentException, RepositoryException {
+        Vector elements = new Vector();
+
+        int p = path.indexOf('/');
+        if (p == 0) {
+            elements.add(RootElement.getInstance());
+            path = path.substring(1);
+            p = path.indexOf('/');
+        }
+
+        while (p != -1) {
+            elements.add(parseJCRPathElement(session, path.substring(0, p)));
+            path = path.substring(p + 1);
+            p = path.indexOf('/');
+        }
+
+        elements.add(parseJCRPathElement(session, path));
+
+        return new Path(elements); 
+    }
+    
+    private static PathElement parseJCRPathElement(
+            Session session, String element)
+            throws IllegalArgumentException, RepositoryException {
+        Matcher matcher = PATH_ELEMENT_PATTERN.matcher(element);
+        if (matcher.matches()) {
+            try {
+                if (matcher.group(1) != null) {
+                    return ThisElement.getInstance();
+                } else if (matcher.group(2) != null) {
+                    return ParentElement.getInstance();
+                } else if (matcher.group(3) != null) {
+                    return new NamedElement(
+                            Name.parseJCRName(session, element));
+                } else {
+                    return new IndexedElement(
+                            Name.parseJCRName(session, matcher.group(5)),
+                            Integer.parseInt(matcher.group(6)));
+                }
+            } catch (NamespaceException e) {
+                throw new IllegalArgumentException(
+                        "Invalid path element " + element);
+            }
+        } else {
+            throw new IllegalArgumentException(
+                    "Invalid path element " + element);
+        }
+    }
+
+    private final List elements;
+
+    private Path(List elements) {
+        this.elements = elements;
+    }
+
+    public Item walk(Item item)
+            throws ItemNotFoundException, RepositoryException {
+        Iterator iterator = elements.iterator();
+        while (iterator.hasNext()) {
+            PathElement element = (PathElement) iterator.next();
+            item = element.step(item);
+        }
+        return item;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/Path.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/PathElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/PathElement.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/PathElement.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/PathElement.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.Item;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.RepositoryException;
+
+/**
+ * TODO
+ */
+interface PathElement {
+
+    Item step(Item item) throws ItemNotFoundException, RepositoryException;
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/PathElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/RootElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/RootElement.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/RootElement.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/RootElement.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.Item;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.RepositoryException;
+
+/**
+ * TODO
+ */
+class RootElement implements PathElement {
+
+    /** Singleton instance. */
+    private static final PathElement instance = new RootElement();
+
+    public static PathElement getInstance() {
+        return instance;
+    }
+
+    private RootElement() {
+    }
+
+    /** {@inheritDoc} */
+    public Item step(Item item)
+            throws ItemNotFoundException, RepositoryException {
+        return item.getAncestor(0);
+    }
+
+    public boolean equals(Object other) {
+        return other == instance;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/RootElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ThisElement.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ThisElement.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ThisElement.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ThisElement.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.name;
+
+import javax.jcr.Item;
+
+/**
+ * TODO
+ */
+class ThisElement implements PathElement {
+
+    /** Singleton instance. */
+    private static final PathElement instance = new ThisElement();
+
+    public static PathElement getInstance() {
+        return instance;
+    }
+
+    private ThisElement() {
+    }
+
+    /** {@inheritDoc} */
+    public Item step(Item item) {
+        return item;
+    }
+
+    public boolean equals(Object other) {
+        return other == instance;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/name/ThisElement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceDecoratorFactory.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceDecoratorFactory.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceDecoratorFactory.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceDecoratorFactory.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.trace;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.Repository;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.decorator.DecoratorFactory;
+import org.apache.jackrabbit.decorator.SimpleDecoratorFactory;
+
+/**
+ * TODO
+ */
+public class TraceDecoratorFactory extends SimpleDecoratorFactory implements
+        DecoratorFactory {
+
+    private LogFactory logFactory;
+    
+    private TraceFingerprint fingerprint;
+    
+    private Map loggers;
+    
+    public TraceDecoratorFactory(LogFactory logFactory) {
+        this.logFactory = logFactory;
+        this.fingerprint = new TraceFingerprint();
+        this.loggers = new HashMap();
+    }
+    
+    private synchronized TraceLogger getLogger(Class klass) {
+        TraceLogger logger = (TraceLogger) loggers.get(klass);
+        if (logger == null) {
+            Log log = logFactory.getInstance(klass); 
+            logger = new TraceLogger(klass.getName(), fingerprint, log);
+            loggers.put(klass, logger);
+        }
+        return logger;
+    }
+    
+    public Repository getRepositoryDecorator(Repository repository) {
+        TraceLogger logger = getLogger(Repository.class);
+        return new TraceRepositoryDecorator(this, repository, logger);
+    }
+    
+    public Session getSessionDecorator(Repository repository, Session session) {
+        // TODO Auto-generated method stub
+        return super.getSessionDecorator(repository, session);
+    }
+    
+    public Workspace getWorkspaceDecorator(
+            Session session, Workspace workspace) {
+        TraceLogger logger = getLogger(Workspace.class);
+        return new TraceWorkspaceDecorator(this, session, workspace, logger);
+    }
+
+    public Item getItemDecorator(Session session, Item item) {
+        // TODO Auto-generated method stub
+        return super.getItemDecorator(session, item);
+    }
+    public Node getNodeDecorator(Session session, Node node) {
+        // TODO Auto-generated method stub
+        return super.getNodeDecorator(session, node);
+    }
+    public Property getPropertyDecorator(Session session, Property property) {
+        // TODO Auto-generated method stub
+        return super.getPropertyDecorator(session, property);
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceDecoratorFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceFingerprint.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceFingerprint.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceFingerprint.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceFingerprint.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.trace;
+
+import java.util.Set;
+
+/**
+ * TODO
+ */
+public class TraceFingerprint {
+    
+    private Set fingerprint;
+    
+    public void addTrace(String trace) {
+        fingerprint.add(trace);
+    }
+    
+    public Set getFingerprint() {
+        return fingerprint;
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceFingerprint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceLogger.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceLogger.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceLogger.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceLogger.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.trace;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.jcr.Credentials;
+import javax.jcr.version.Version;
+
+import org.apache.commons.logging.Log;
+import org.xml.sax.ContentHandler;
+
+/**
+ * TODO
+ */
+public class TraceLogger {
+    
+    private String klass;
+    
+    private TraceFingerprint fingerprint;
+    
+    private Log log;
+    
+    public TraceLogger(String klass, TraceFingerprint fingerprint, Log log) {
+        this.klass = klass;
+        this.fingerprint = fingerprint;
+        this.log = log;
+    }
+    
+    private void fingerprint(String signature) {
+        fingerprint.addTrace(klass + "." + signature);
+    }
+    
+    public void trace(String method) {
+        fingerprint(method + "()");
+        log.trace(method + "()");
+    }
+
+    public void trace(String method, boolean arg) {
+        fingerprint(method + "(boolean)");
+        log.trace(method + "(" + arg + ")");
+    }
+
+    public void trace(String method, String arg) {
+        fingerprint(method + "(java.lang.String)");
+        log.trace(method + "(" + arg + ")");
+    }
+
+    public void trace(String method, String arg1, String arg2) {
+        fingerprint(method + "(java.lang.String,java.lang.String)");
+        log.trace(method + "(" + arg1 + "," + arg2 + ")");
+    }
+
+    public void trace(String method, String arg1, int arg2) {
+        fingerprint(method + "(java.lang.String,int)");
+        log.trace(method + "(" + arg1 + "," + arg2 + ")");
+    }
+
+    public void trace(String method, String arg1, String arg2, String arg3) {
+        fingerprint(method
+                + "(java.lang.String,java.lang.String,java.lang.String)");
+        log.trace(method + "(" + arg1 + "," + arg2 + "," + arg3 + ")");
+    }
+
+    public void trace(String method, String arg1, InputStream arg2) {
+        fingerprint(method + "(java.lang.String,java.io.InputStream)");
+        log.trace(method + "(" + arg1 + ",inputstream)");
+    }
+
+    public void trace(String method, String arg1, InputStream arg2, int arg3) {
+        fingerprint(method + "(java.lang.String,java.io.InputStream,int)");
+        log.trace(method + "(" + arg1 + ",inputstream," + arg3 + ")");
+    }
+
+    public void trace(String method,
+            String arg1, String arg2, String arg3, boolean arg4) {
+        fingerprint(method + "(java.lang.String,java.lang.String,"
+                + "java.lang.String,boolean)");
+        log.trace(method
+                + "(" + arg1 + "," + arg2 + "," + arg3 + "," + arg4 + ")");
+    }
+
+    public void trace(String method, Credentials arg) {
+        fingerprint(method + "(javax.jcr.Credentials)");
+        log.trace(method + "("  + arg + ")");
+    }
+
+    public void trace(String method, Credentials arg1, String arg2) {
+        fingerprint(method + "(javax.jcr.Credentials,java.lang.String)");
+        log.trace(method + "("  + arg1 + "," + arg2 + ")");
+    }
+
+    public void trace(String method, Version[] arg1, boolean arg2) {
+        fingerprint(method + "(javax.jcr.version.Version[],boolean)");
+        log.trace(method + "(versions," + arg2 + ")");
+    }
+
+    public void trace(String method, String arg1, ContentHandler arg2,
+            boolean arg3, boolean arg4) {
+        fingerprint(method + "(java.lang.String,org.xml.sax.ContentHandler,"
+                + "boolean,boolean)");
+        log.trace(method
+                + "(" + arg1 + ",contenthandler," + arg3 + "," + arg4 + ")");
+    }
+    
+    public void trace(String method, String arg1, OutputStream arg2,
+            boolean arg3, boolean arg4) {
+        fingerprint(method + "(java.lang.String,java.io.OutputStream,"
+                + "boolean,boolean)");
+        log.trace(method
+                + "(" + arg1 + ",outputstream," + arg3 + "," + arg4 + ")");
+    }
+
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceRepositoryDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceRepositoryDecorator.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceRepositoryDecorator.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceRepositoryDecorator.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.trace;
+
+import javax.jcr.Credentials;
+import javax.jcr.LoginException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.decorator.DecoratorFactory;
+import org.apache.jackrabbit.decorator.RepositoryDecorator;
+
+/**
+ * TODO
+ */
+public class TraceRepositoryDecorator extends RepositoryDecorator implements
+        Repository {
+
+    private TraceLogger logger;
+    
+    public TraceRepositoryDecorator(
+            DecoratorFactory factory, Repository repository, TraceLogger log) {
+        super(factory, repository);
+        this.logger = log;
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying repository.
+     * {@inheritDoc}
+     */
+    public String getDescriptor(String key) {
+        logger.trace("getDescriptor", key);
+        return super.getDescriptor(key);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying repository.
+     * {@inheritDoc}
+     */
+    public String[] getDescriptorKeys() {
+        logger.trace("getDescriptorKeys");
+        return super.getDescriptorKeys();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying repository.
+     * {@inheritDoc}
+     */
+    public Session login() throws LoginException, NoSuchWorkspaceException,
+            RepositoryException {
+        logger.trace("login");
+        return super.login();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying repository.
+     * {@inheritDoc}
+     */
+    public Session login(Credentials credentials, String workspaceName)
+            throws LoginException, NoSuchWorkspaceException,
+            RepositoryException {
+        logger.trace("login", credentials, workspaceName);
+        return super.login(credentials, workspaceName);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying repository.
+     * {@inheritDoc}
+     */
+    public Session login(Credentials credentials) throws LoginException,
+            NoSuchWorkspaceException, RepositoryException {
+        logger.trace("login", credentials);
+        return super.login(credentials);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying repository.
+     * {@inheritDoc}
+     */
+    public Session login(String workspaceName) throws LoginException,
+            NoSuchWorkspaceException, RepositoryException {
+        logger.trace("login", workspaceName);
+        return super.login(workspaceName);
+    }
+    
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceRepositoryDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceSessionDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceSessionDecorator.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceSessionDecorator.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceSessionDecorator.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,348 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.trace;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.AccessControlException;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Credentials;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.InvalidSerializedDataException;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.LoginException;
+import javax.jcr.NamespaceException;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.version.VersionException;
+
+import org.apache.jackrabbit.decorator.DecoratorFactory;
+import org.apache.jackrabbit.decorator.SessionDecorator;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+/**
+ * TODO
+ */
+public class TraceSessionDecorator extends SessionDecorator implements Session {
+
+    private TraceLogger logger;
+    
+    public TraceSessionDecorator(DecoratorFactory factory,
+            Repository repository, Session session, TraceLogger logger) {
+        super(factory, repository, session);
+        this.logger = logger;
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void addLockToken(String lt) {
+        logger.trace("addLockToken", lt);
+        super.addLockToken(lt);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void checkPermission(String absPath, String actions)
+            throws AccessControlException {
+        logger.trace("checkPermissions", absPath, actions);
+        super.checkPermission(absPath, actions);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void exportDocView(String absPath, ContentHandler contentHandler,
+            boolean binaryAsLink, boolean noRecurse)
+            throws InvalidSerializedDataException, PathNotFoundException,
+            SAXException, RepositoryException {
+        logger.trace("exportDocView", absPath, contentHandler, binaryAsLink, noRecurse);
+        super.exportDocView(absPath, contentHandler, binaryAsLink, noRecurse);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void exportDocView(String absPath, OutputStream out,
+            boolean binaryAsLink, boolean noRecurse)
+            throws InvalidSerializedDataException, IOException,
+            PathNotFoundException, RepositoryException {
+        logger.trace("exportDocView", absPath, out, binaryAsLink, noRecurse);
+        super.exportDocView(absPath, out, binaryAsLink, noRecurse);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void exportSysView(String absPath, ContentHandler contentHandler,
+            boolean binaryAsLink, boolean noRecurse)
+            throws PathNotFoundException, SAXException, RepositoryException {
+        logger.trace("exportSysView", absPath, contentHandler, binaryAsLink, noRecurse);
+        super.exportSysView(absPath, contentHandler, binaryAsLink, noRecurse);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void exportSysView(String absPath, OutputStream out,
+            boolean binaryAsLink, boolean noRecurse) throws IOException,
+            PathNotFoundException, RepositoryException {
+        logger.trace("exportSysView", absPath, out, binaryAsLink, noRecurse);
+        super.exportSysView(absPath, out, binaryAsLink, noRecurse);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Object getAttribute(String name) {
+        logger.trace("getAttribute", name);
+        return super.getAttribute(name);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public String[] getAttributeNames() {
+        logger.trace("getAttributeNames");
+        return super.getAttributeNames();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public ContentHandler getImportContentHandler(String parentAbsPath)
+            throws PathNotFoundException, ConstraintViolationException,
+            VersionException, LockException, RepositoryException {
+        logger.trace("getImportContentHandler", parentAbsPath);
+        return super.getImportContentHandler(parentAbsPath);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Item getItem(String absPath) throws PathNotFoundException,
+            RepositoryException {
+        logger.trace("getItem", absPath);
+        return super.getItem(absPath);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public String[] getLockTokens() {
+        logger.trace("getLockTokens");
+        return super.getLockTokens();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public String getNamespacePrefix(String uri) throws NamespaceException,
+            RepositoryException {
+        logger.trace("getNamespacePrefix", uri);
+        return super.getNamespacePrefix(uri);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public String[] getNamespacePrefixes() throws RepositoryException {
+        logger.trace("getNamespacePrefixes");
+        return super.getNamespacePrefixes();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public String getNamespaceURI(String prefix) throws NamespaceException,
+            RepositoryException {
+        logger.trace("getNamespaceURI", prefix);
+        return super.getNamespaceURI(prefix);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Node getNodeByUUID(String uuid) throws ItemNotFoundException,
+            RepositoryException {
+        logger.trace("getNodeByUUID", uuid);
+        return super.getNodeByUUID(uuid);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Repository getRepository() {
+        logger.trace("getRepository");
+        return super.getRepository();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Node getRootNode() throws RepositoryException {
+        logger.trace("getRootNode");
+        return super.getRootNode();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public String getUserId() {
+        logger.trace("getUserId");
+        return super.getUserId();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Workspace getWorkspace() {
+        logger.trace("getWorkspace");
+        return super.getWorkspace();
+    }
+
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public boolean hasPendingChanges() throws RepositoryException {
+        logger.trace("hasPendingChanges");
+        return super.hasPendingChanges();
+    }
+
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public Session impersonate(Credentials credentials) throws LoginException,
+            RepositoryException {
+        logger.trace("impersonate", credentials);
+        return super.impersonate(credentials);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void importXML(String parentAbsPath, InputStream in)
+            throws IOException, PathNotFoundException, ItemExistsException,
+            ConstraintViolationException, VersionException,
+            InvalidSerializedDataException, LockException, RepositoryException {
+        logger.trace("importXML", parentAbsPath, in);
+        super.importXML(parentAbsPath, in);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public boolean itemExists(String path) {
+        logger.trace("itemExists", path);
+        return super.itemExists(path);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void logout() {
+        logger.trace("logout");
+        super.logout();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void move(String srcAbsPath, String destAbsPath)
+            throws ItemExistsException, PathNotFoundException,
+            VersionException, RepositoryException {
+        logger.trace("move", srcAbsPath, destAbsPath);
+        super.move(srcAbsPath, destAbsPath);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void refresh(boolean keepChanges) throws RepositoryException {
+        logger.trace("refresh", keepChanges);
+        super.refresh(keepChanges);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void removeLockToken(String lt) {
+        logger.trace("removeLockToken", lt);
+        super.removeLockToken(lt);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void save() throws AccessDeniedException,
+            ConstraintViolationException, InvalidItemStateException,
+            VersionException, LockException, RepositoryException {
+        logger.trace("save");
+        super.save();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying session.
+     * {@inheritDoc}
+     */
+    public void setNamespacePrefix(String prefix, String uri)
+            throws NamespaceException, RepositoryException {
+        logger.trace("setNamespacePrefix", prefix, uri);
+        super.setNamespacePrefix(prefix, uri);
+    }
+    
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceSessionDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceWorkspaceDecorator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceWorkspaceDecorator.java?view=auto&rev=161553
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceWorkspaceDecorator.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceWorkspaceDecorator.java Fri Apr 15 22:46:17 2005
@@ -0,0 +1,205 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.trace;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.InvalidSerializedDataException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.Workspace;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.observation.ObservationManager;
+import javax.jcr.query.QueryManager;
+import javax.jcr.version.Version;
+import javax.jcr.version.VersionException;
+
+import org.apache.jackrabbit.decorator.DecoratorFactory;
+import org.apache.jackrabbit.decorator.WorkspaceDecorator;
+import org.xml.sax.ContentHandler;
+
+/**
+ * TODO
+ */
+public class TraceWorkspaceDecorator extends WorkspaceDecorator implements
+        Workspace {
+    
+    private TraceLogger logger;
+    
+    public TraceWorkspaceDecorator(DecoratorFactory factory,
+            Session session, Workspace workspace, TraceLogger logger) {
+        super(factory, session, workspace);
+        this.logger = logger;
+    }
+    
+
+    public Session getSession() {
+        logger.trace("getSession");
+        return super.getSession();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public void copy(String srcAbsPath, String destAbsPath)
+            throws ConstraintViolationException, VersionException,
+            AccessDeniedException, PathNotFoundException, ItemExistsException,
+            LockException, RepositoryException {
+        logger.trace("copy", srcAbsPath, destAbsPath);
+        super.copy(srcAbsPath, destAbsPath);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public void copy(String srcWorkspace, String srcAbsPath, String destAbsPath)
+            throws NoSuchWorkspaceException, ConstraintViolationException,
+            VersionException, AccessDeniedException, PathNotFoundException,
+            ItemExistsException, LockException, RepositoryException {
+        logger.trace("copy", srcWorkspace, srcAbsPath, destAbsPath);
+        super.copy(srcWorkspace, srcAbsPath, destAbsPath);
+    }
+
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public void clone(String srcWorkspace, String srcAbsPath,
+            String destAbsPath, boolean removeExisting)
+            throws NoSuchWorkspaceException, ConstraintViolationException,
+            VersionException, AccessDeniedException, PathNotFoundException,
+            ItemExistsException, LockException, RepositoryException {
+        logger.trace("clone",
+                srcWorkspace, srcAbsPath, destAbsPath, removeExisting);
+        super.clone(srcWorkspace, srcAbsPath, destAbsPath, removeExisting);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public String[] getAccessibleWorkspaceNames() throws RepositoryException {
+        logger.trace("getAccessibleWorkspaceNames");
+        return super.getAccessibleWorkspaceNames();
+    }
+
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public ContentHandler getImportContentHandler(String parentAbsPath,
+            int uuidBehaviour) throws PathNotFoundException,
+            ConstraintViolationException, VersionException, LockException,
+            RepositoryException {
+        logger.trace("getImportContentHandler", parentAbsPath, uuidBehaviour);
+        return super.getImportContentHandler(parentAbsPath, uuidBehaviour);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public String getName() {
+        logger.trace("getName");
+        return super.getName();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public NamespaceRegistry getNamespaceRegistry() throws RepositoryException {
+        logger.trace("getNamespaceRegistry");
+        return super.getNamespaceRegistry();
+    }
+
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public NodeTypeManager getNodeTypeManager() throws RepositoryException {
+        logger.trace("getNodeTypeManager");
+        return super.getNodeTypeManager();
+    }
+
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public ObservationManager getObservationManager() throws
+            UnsupportedRepositoryOperationException, RepositoryException {
+        logger.trace("getObservationManager");
+        return super.getObservationManager();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public QueryManager getQueryManager() throws RepositoryException {
+        logger.trace("getQueryManager");
+        return super.getQueryManager();
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public void importXML(String parentAbsPath, InputStream in,
+            int uuidBehaviour) throws IOException, PathNotFoundException,
+            ItemExistsException, ConstraintViolationException,
+            InvalidSerializedDataException, LockException, RepositoryException {
+        logger.trace("importXML", parentAbsPath, in, uuidBehaviour);
+        super.importXML(parentAbsPath, in, uuidBehaviour);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public void move(String srcAbsPath, String destAbsPath)
+            throws ConstraintViolationException, VersionException,
+            AccessDeniedException, PathNotFoundException, ItemExistsException,
+            LockException, RepositoryException {
+        logger.trace("move", srcAbsPath, destAbsPath);
+        super.move(srcAbsPath, destAbsPath);
+    }
+    
+    /**
+     * Logs the method call and forwards it to the underlying workspace.
+     * {@inheritDoc}
+     */
+    public void restore(Version[] versions, boolean removeExisting)
+            throws ItemExistsException,
+            UnsupportedRepositoryOperationException, VersionException,
+            LockException, InvalidItemStateException, RepositoryException {
+        logger.trace("restore", versions, removeExisting);
+        super.restore(versions, removeExisting);
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/trace/TraceWorkspaceDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message