jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kn...@apache.org
Subject svn commit: r777313 [1/5] - in /jackrabbit/sandbox/JCR-1456: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/ jackr...
Date Thu, 21 May 2009 23:11:42 GMT
Author: knopp
Date: Thu May 21 23:11:22 2009
New Revision: 777313

URL: http://svn.apache.org/viewvc?rev=777313&view=rev
Log:
Update to rev 777034

Added:
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryCopier.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryCopier.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIterable.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/NodeIterable.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/PropertyIterable.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/PropertyIterable.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/RowIterable.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/iterator/RowIterable.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DecimalValue.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/DecimalValue.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/URIValue.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java
      - copied unchanged from r777034, jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/WeakReferenceValue.java
Modified:
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XALockManager.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties   (props changed)
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-nodetypes.xml   (props changed)
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/repository/workspaces/default/indexing-configuration.xml   (props changed)
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/nodetype/xml/nodetypes.dtd
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/XMLChar.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BaseValue.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ValueFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ValueHelper.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/ISO8601.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/NotExecutableException.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryHelper.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/RepositoryStub.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/XMLChar.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/AddNodeTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/DocumentViewImportTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ExportDocViewTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeItemIsModifiedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeItemIsNewTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeOrderableChildNodesTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeReadMethodsTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeUUIDTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/PropertyItemIsModifiedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/PropertyItemIsNewTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SerializationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionUUIDTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBinaryTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueBooleanTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueDateTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueDoubleTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueLongTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueReferenceTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SetValueStringTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/StringPropertyTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/TreeComparator.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AddEventListenerTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventIteratorTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventResult.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeAddedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeMovedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeRemovedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/NodeReorderTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyChangedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyRemovedTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/WorkspaceOperationTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryLevel2Test.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLOrderByTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLQueryLevel2Test.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SaveTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathOrderByTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/XPathQueryLevel2Test.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/AbstractOnParentVersionTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/AbstractVersionTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckoutTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/FrozenNodeTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/simple/AbstractVersionTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/simple/CheckinTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/simple/CheckoutTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/simple/CopyTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/simple/FrozenNodeTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/simple/RestoreTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/AbstractQValue.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-spi2jcr/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/JackrabbitRepositoryStub.java Thu May 21 23:11:22 2009
@@ -26,9 +26,8 @@
 import java.security.acl.Group;
 import java.util.Arrays;
 import java.util.Calendar;
-import java.util.HashSet;
+import java.util.Collection;
 import java.util.Properties;
-import java.util.Set;
 
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
@@ -137,30 +136,12 @@
                     dir = new File("target", "repository").getPath();
                 }
 
-                new File(dir).mkdirs();
-
                 String xml = settings.getProperty(PROP_REPOSITORY_CONFIG);
                 if (xml == null) {
                     xml = new File(dir, "repository.xml").getPath();
                 }
 
-                if (!new File(xml).exists()) {
-                    InputStream input = getResource("repository.xml");
-                    try {
-                        OutputStream output = new FileOutputStream(xml);
-                        try {
-                            IOUtils.copy(input, output);
-                        } finally {
-                            output.close();
-                        }
-                    } finally {
-                        input.close();
-                    }
-                }
-
-                RepositoryConfig config = RepositoryConfig.create(xml, dir);
-                repository = RepositoryImpl.create(config);
-
+                repository = createRepository(dir, xml);
                 Session session = repository.login(superuser);
                 try {
                     prepareTestContent(session);
@@ -177,12 +158,34 @@
         return repository;
     }
 
+    protected Repository createRepository(String dir, String xml)
+            throws Exception {
+        new File(dir).mkdirs();
+
+        if (!new File(xml).exists()) {
+            InputStream input = getResource("repository.xml");
+            try {
+                OutputStream output = new FileOutputStream(xml);
+                try {
+                    IOUtils.copy(input, output);
+                } finally {
+                    output.close();
+                }
+            } finally {
+                input.close();
+            }
+        }
+
+        RepositoryConfig config = RepositoryConfig.create(xml, dir);
+        return RepositoryImpl.create(config);
+    }
+
     private void prepareTestContent(Session session)
             throws RepositoryException, IOException {
         JackrabbitWorkspace workspace =
             (JackrabbitWorkspace) session.getWorkspace();
-        Set workspaces = new HashSet(
-                Arrays.asList(workspace.getAccessibleWorkspaceNames()));
+        Collection<String> workspaces =
+            Arrays.asList(workspace.getAccessibleWorkspaceNames());
         if (!workspaces.contains("test")) {
             workspace.createWorkspace("test");
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java Thu May 21 23:11:22 2009
@@ -47,6 +47,8 @@
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryResult;
 import javax.jcr.lock.Lock;
 import javax.jcr.lock.LockException;
 import javax.jcr.lock.LockManager;
@@ -1692,16 +1694,6 @@
         return prop;
     }
 
-    public Property setProperty(String name, BigDecimal value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
-        // TODO
-        throw new RuntimeException("Not implemented yet, see JCR-1609");
-    }
-
-    public Property setProperty(String name, Binary value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
-        // TODO
-        throw new RuntimeException("Not implemented yet, see JCR-1609");
-    }
-
     /**
      * @see ItemImpl#getQName()
      */
@@ -4536,16 +4528,14 @@
 
     //--------------------------------------------------< new JSR 283 methods >
     /**
-     * @see javax.jcr.Node#getIdentifier()
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     public String getIdentifier() throws RepositoryException {
         return ((NodeId) id).toString();
     }
 
     /**
-     * @see javax.jcr.Node#getReferences(String)
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     public PropertyIterator getReferences(String name)
             throws RepositoryException {
@@ -4587,26 +4577,56 @@
     }
 
     /**
-     * @see javax.jcr.Node#getWeakReferences()
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     public PropertyIterator getWeakReferences() throws RepositoryException {
-        // TODO
-        throw new RuntimeException("Not implemented yet, see JCR-2061");
+        return getWeakReferences(null);
     }
 
     /**
-     * @see javax.jcr.Node#getWeakReferences(String)
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     public PropertyIterator getWeakReferences(String name) throws RepositoryException {
-        // TODO
-        throw new RuntimeException("Not implemented yet, see JCR-2061");
+        // check state of this instance
+        sanityCheck();
+
+        // TODO tweak query implemention in order to support WEAKREFERENCE reverse lookup 
+        try {
+            Query q = session.getWorkspace().getQueryManager().createQuery(
+                    "//*[jcr:contains(., '" + data.getId() + "')]",
+                    Query.XPATH);
+            QueryResult result = q.execute();
+            ArrayList l = new ArrayList<Property>();
+            for (NodeIterator nit = result.getNodes(); nit.hasNext(); ) {
+                Node n = nit.nextNode();
+                for (PropertyIterator pit = n.getProperties(); pit.hasNext(); ) {
+                    Property p = pit.nextProperty();
+                    if (p.getType() == PropertyType.WEAKREFERENCE
+                            && p.getString().equals(getIdentifier())) {
+                        if (name != null) {
+                            if (name.equals(p.getName())) {
+                                l.add(p);
+                            }
+                        } else {
+                            l.add(p);
+                        }
+                    }
+                }
+            }
+            if (l.isEmpty()) {
+                return PropertyIteratorAdapter.EMPTY;
+            } else {
+                return new PropertyIteratorAdapter(l);
+            }
+        } catch (RepositoryException e) {
+            String msg = "Unable to retrieve WEAKREFERENCE properties that refer to " + id;
+            log.debug(msg);
+            throw new RepositoryException(msg, e);
+        }
     }
 
     /**
-     * @see javax.jcr.Node#getNodes(String[])
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     public NodeIterator getNodes(String[] nameGlobs)
             throws RepositoryException {
@@ -4620,8 +4640,7 @@
     }
 
     /**
-     * @see javax.jcr.Node#getProperties(String[])
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     // TODO rename method to 'getProperties' once JCR 2.0 api has been fixed
     public PropertyIterator getProperty(String[]
@@ -4637,8 +4656,7 @@
     }
 
     /**
-     * @see javax.jcr.Node#setPrimaryType(String) 
-     * @since JCR 2.0
+     * {@inheritDoc}
      */
     public void setPrimaryType(String nodeTypeName)
             throws NoSuchNodeTypeException, VersionException,
@@ -4845,6 +4863,62 @@
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public Property setProperty(String name, BigDecimal value)
+            throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        // check state of this instance
+        sanityCheck();
+
+        // check pre-conditions for setting property
+        checkSetProperty();
+
+        BitSet status = new BitSet();
+        PropertyImpl prop = getOrCreateProperty(
+                name, PropertyType.DECIMAL, false, false, status);
+        try {
+            prop.setValue(value);
+        } catch (RepositoryException re) {
+            if (status.get(CREATED)) {
+                // setting value failed, get rid of newly created property
+                removeChildProperty(name);
+            }
+            // rethrow
+            throw re;
+        }
+        return prop;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Property setProperty(String name, Binary value)
+            throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        // check state of this instance
+        sanityCheck();
+
+        // check pre-conditions for setting property
+        checkSetProperty();
+
+        BitSet status = new BitSet();
+        PropertyImpl prop = getOrCreateProperty(
+                name, PropertyType.BINARY, false, false, status);
+        try {
+            prop.setValue(value);
+        } catch (RepositoryException re) {
+            if (status.get(CREATED)) {
+                // setting value failed, get rid of newly created property
+                removeChildProperty(name);
+            }
+            // rethrow
+            throw re;
+        }
+        return prop;
+    }
+
     // TODO: JCR-1565 JSR 283 lifecycle management
     public String[] getAllowedLifecycleTransistions()
             throws RepositoryException {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java Thu May 21 23:11:22 2009
@@ -195,6 +195,9 @@
             case PropertyType.DATE:
             case PropertyType.REFERENCE:
             case PropertyType.BOOLEAN:
+            case PropertyType.DECIMAL:
+            case PropertyType.URI:
+            case PropertyType.WEAKREFERENCE:
                 return value.toString().length();
 
             case PropertyType.NAME:

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryFactoryImpl.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryFactoryImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryFactoryImpl.java Thu May 21 23:11:22 2009
@@ -82,17 +82,13 @@
                                                        String home)
             throws RepositoryException {
         JackrabbitRepository repo = (JackrabbitRepository) REPOSITORY_INSTANCES.get(home);
-        try {
-            if (repo == null) {
-                if (home == null) {
-                    repo = new TransientRepository();
-                } else {
-                    repo = new TransientRepository(conf, home);
-                }
-                REPOSITORY_INSTANCES.put(home, repo);
+        if (repo == null) {
+            if (home == null) {
+                repo = new TransientRepository();
+            } else {
+                repo = new TransientRepository(conf, home);
             }
-        } catch (IOException e) {
-            throw new RepositoryException(e);
+            REPOSITORY_INSTANCES.put(home, repo);
         }
         return repo;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java Thu May 21 23:11:22 2009
@@ -1207,8 +1207,11 @@
             throws RepositoryException {
         InputStream in = RepositoryImpl.class.getResourceAsStream("repository.properties");
         try {
-            props.load(in);
-            in.close();
+        	if (in != null)
+        	{
+        		props.load(in);
+        		in.close();
+        	}
 
             // set counts
             if (!props.containsKey(STATS_NODE_COUNT_PROPERTY)) {
@@ -1420,22 +1423,20 @@
     }
 
     public Value getDescriptorValue(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
+        throw new UnsupportedOperationException(
+                "not implemented yet - see JCR-2062");
     }
 
     public Value[] getDescriptorValues(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
+        throw new UnsupportedOperationException(
+                "not implemented yet - see JCR-2062");
     }
 
     public boolean isSingleValueDescriptor(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
+        throw new UnsupportedOperationException(
+                "not implemented yet - see JCR-2062");
     }
 
-    public boolean isStandardDescriptor(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
-    }
-
-
     //------------------------------------------------------< SessionListener >
     /**
      * {@inheritDoc}
@@ -2321,4 +2322,9 @@
             return RepositoryImpl.this.getDataStore();
         }
     }
+
+    VersionManagerImpl getVersionManagerImpl() {
+        return vMgr;
+    }
+
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java Thu May 21 23:11:22 2009
@@ -16,8 +16,53 @@
  */
 package org.apache.jackrabbit.core;
 
+import java.io.File;
+import java.io.PrintStream;
+import java.security.AccessControlException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Credentials;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.LoginException;
+import javax.jcr.NamespaceException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.ValueFactory;
+import javax.jcr.Workspace;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.observation.EventListener;
+import javax.jcr.observation.ObservationManager;
+import javax.jcr.retention.RetentionManager;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.version.VersionException;
+import javax.security.auth.Subject;
+
 import org.apache.commons.collections.IteratorUtils;
 import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.jackrabbit.api.JackrabbitSession;
+import org.apache.jackrabbit.api.security.principal.PrincipalManager;
+import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.jackrabbit.commons.AbstractSession;
 import org.apache.jackrabbit.core.RepositoryImpl.WorkspaceInfo;
 import org.apache.jackrabbit.core.config.WorkspaceConfig;
@@ -28,36 +73,31 @@
 import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
 import org.apache.jackrabbit.core.persistence.IterablePersistenceManager;
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
+import org.apache.jackrabbit.core.retention.RetentionManagerImpl;
+import org.apache.jackrabbit.core.retention.RetentionRegistry;
 import org.apache.jackrabbit.core.security.AMContext;
 import org.apache.jackrabbit.core.security.AccessManager;
 import org.apache.jackrabbit.core.security.SecurityConstants;
-import org.apache.jackrabbit.core.security.authorization.Permission;
-import org.apache.jackrabbit.api.security.principal.PrincipalManager;
-import org.apache.jackrabbit.api.security.user.UserManager;
-import org.apache.jackrabbit.api.JackrabbitSession;
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.retention.RetentionManager;
 import org.apache.jackrabbit.core.security.authentication.AuthContext;
+import org.apache.jackrabbit.core.security.authorization.Permission;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.SessionItemStateManager;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.apache.jackrabbit.core.util.Dumpable;
+import org.apache.jackrabbit.core.value.ValueFactoryImpl;
 import org.apache.jackrabbit.core.version.VersionManager;
 import org.apache.jackrabbit.core.version.VersionManagerImpl;
 import org.apache.jackrabbit.core.xml.ImportHandler;
 import org.apache.jackrabbit.core.xml.SessionImporter;
-import org.apache.jackrabbit.core.retention.RetentionManagerImpl;
-import org.apache.jackrabbit.core.retention.RetentionRegistry;
-import org.apache.jackrabbit.core.value.ValueFactoryImpl;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver;
+import org.apache.jackrabbit.spi.commons.conversion.IdentifierResolver;
 import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.conversion.NameException;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.conversion.IdentifierResolver;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.Logger;
@@ -65,74 +105,15 @@
 import org.xml.sax.ContentHandler;
 import org.xml.sax.InputSource;
 
-import javax.jcr.AccessDeniedException;
-import javax.jcr.Credentials;
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.Item;
-import javax.jcr.ItemExistsException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.LoginException;
-import javax.jcr.NamespaceException;
-import javax.jcr.NoSuchWorkspaceException;
-import javax.jcr.Node;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.Property;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.SimpleCredentials;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.ValueFactory;
-import javax.jcr.Workspace;
-import javax.jcr.lock.LockException;
-import javax.jcr.lock.Lock;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.observation.EventListener;
-import javax.jcr.observation.ObservationManager;
-import javax.jcr.version.VersionException;
-import javax.security.auth.Subject;
-import java.io.File;
-import java.io.PrintStream;
-import java.security.AccessControlException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Arrays;
-
 /**
  * A <code>SessionImpl</code> ...
  */
 public class SessionImpl extends AbstractSession
-        implements javax.jcr.Session, JackrabbitSession, NamespaceResolver, NamePathResolver, IdentifierResolver, Dumpable {
+        implements JackrabbitSession, NamespaceResolver, NamePathResolver, IdentifierResolver, Dumpable {
 
     private static Logger log = LoggerFactory.getLogger(SessionImpl.class);
 
     /**
-     * @deprecated Use {@link javax.jcr.Session#ACTION_READ} instead.
-     */
-    public static final String READ_ACTION = javax.jcr.Session.ACTION_READ;
-
-    /**
-     * @deprecated Use {@link javax.jcr.Session#ACTION_REMOVE} instead.
-     */
-    public static final String REMOVE_ACTION = javax.jcr.Session.ACTION_REMOVE;
-
-    /**
-     * @deprecated Use {@link javax.jcr.Session#ACTION_ADD_NODE} instead.
-     */
-    public static final String ADD_NODE_ACTION = javax.jcr.Session.ACTION_ADD_NODE;
-
-    /**
-     * @deprecated Use {@link javax.jcr.Session#ACTION_SET_PROPERTY} instead.
-     */
-    public static final String SET_PROPERTY_ACTION = javax.jcr.Session.ACTION_SET_PROPERTY;
-
-    /**
      * flag indicating whether this session is alive
      */
     protected boolean alive;
@@ -161,7 +142,8 @@
     /**
      * the attributes of this session
      */
-    protected final HashMap attributes = new HashMap();
+    protected final Map<String, Object> attributes =
+        new HashMap<String, Object>();
 
     /**
      * the node type manager
@@ -206,7 +188,8 @@
     /**
      * Listeners (weak references)
      */
-    protected final Map listeners = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
+    protected final Map<SessionListener, SessionListener> listeners =
+        new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
 
     /**
      * value factory
@@ -573,18 +556,17 @@
      */
     protected String[] getWorkspaceNames() throws RepositoryException {
         // filter workspaces according to access rights
-        ArrayList list = new ArrayList();
-        String[] names = rep.getWorkspaceNames();
-        for (int i = 0; i < names.length; i++) {
+        List<String> names = new ArrayList<String>();
+        for (String name : rep.getWorkspaceNames()) {
             try {
-                if (getAccessManager().canAccess(names[i])) {
-                    list.add(names[i]);
+                if (getAccessManager().canAccess(name)) {
+                    names.add(name);
                 }
-            } catch (NoSuchWorkspaceException nswe) {
-                // should never happen, ignore...
+            } catch (NoSuchWorkspaceException e) {
+                log.warn("Workspace disappeared unexpectedly: " + name, e);
             }
         }
-        return (String[]) list.toArray(new String[list.size()]);
+        return names.toArray(new String[names.size()]);
     }
 
     /**
@@ -625,12 +607,11 @@
      */
     protected void notifyLoggingOut() {
         // copy listeners to array to avoid ConcurrentModificationException
-        SessionListener[] la =
-                (SessionListener[]) listeners.values().toArray(
-                        new SessionListener[listeners.size()]);
-        for (int i = 0; i < la.length; i++) {
-            if (la[i] != null) {
-                la[i].loggingOut(this);
+        List<SessionListener> copy =
+            new ArrayList<SessionListener>(listeners.values());
+        for (SessionListener listener : copy) {
+            if (listener != null) {
+                listener.loggingOut(this);
             }
         }
     }
@@ -640,12 +621,11 @@
      */
     protected void notifyLoggedOut() {
         // copy listeners to array to avoid ConcurrentModificationException
-        SessionListener[] la =
-                (SessionListener[]) listeners.values().toArray(
-                        new SessionListener[listeners.size()]);
-        for (int i = 0; i < la.length; i++) {
-            if (la[i] != null) {
-                la[i].loggedOut(this);
+        List<SessionListener> copy =
+            new ArrayList<SessionListener>(listeners.values());
+        for (SessionListener listener : copy) {
+            if (listener != null) {
+                listener.loggedOut(this);
             }
         }
     }
@@ -1166,11 +1146,9 @@
             ObservationManager manager = getWorkspace().getObservationManager();
             // Use a copy to avoid modifying the set of registered listeners
             // while iterating over it
-            Collection listeners =
+            Collection<EventListener> listeners =
                 IteratorUtils.toList(manager.getRegisteredEventListeners());
-            Iterator iterator = listeners.iterator();
-            while (iterator.hasNext()) {
-                EventListener listener = (EventListener) iterator.next();
+            for (EventListener listener : listeners) {
                 try {
                     manager.removeEventListener(listener);
                 } catch (RepositoryException e) {
@@ -1490,7 +1468,7 @@
             throw new RepositoryException("Absolute path expected. Was:" + absPath);
         }
 
-        Set s = new HashSet(Arrays.asList(actions.split(",")));
+        Set<String> s = new HashSet<String>(Arrays.asList(actions.split(",")));
         int permissions = 0;
         if (s.remove(ACTION_READ)) {
             permissions |= Permission.READ;
@@ -1514,11 +1492,7 @@
             }
         }
         if (!s.isEmpty()) {
-            StringBuffer sb = new StringBuffer();
-            for (Iterator it = s.iterator(); it.hasNext();) {
-                sb.append(it.next());
-            }
-            throw new IllegalArgumentException("Unknown actions: " + sb.toString());
+            throw new IllegalArgumentException("Unknown actions: " + s);
         }
         try {
             return getAccessManager().isGranted(path, permissions);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/TransientRepository.java Thu May 21 23:11:22 2009
@@ -17,14 +17,10 @@
 package org.apache.jackrabbit.core;
 
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
+import java.util.Arrays;
 import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -34,8 +30,8 @@
 import javax.jcr.Value;
 
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.commons.io.IOUtils;
 import org.apache.jackrabbit.api.JackrabbitRepository;
+import org.apache.jackrabbit.commons.AbstractRepository;
 import org.apache.jackrabbit.core.config.ConfigurationException;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.slf4j.Logger;
@@ -48,8 +44,8 @@
  * when no longer used, this class can be used to avoid having to explicitly
  * shut down the repository.
  */
-public class TransientRepository
-        implements javax.jcr.Repository, JackrabbitRepository, SessionListener {
+public class TransientRepository extends AbstractRepository
+        implements JackrabbitRepository, SessionListener {
 
     /**
      * The logger instance used to log the repository and session lifecycles.
@@ -58,11 +54,6 @@
         LoggerFactory.getLogger(TransientRepository.class);
 
     /**
-     * Resource path of the default repository configuration file.
-     */
-    private static final String DEFAULT_REPOSITORY_XML = "repository.xml";
-
-    /**
      * Name of the repository configuration file property.
      */
     private static final String CONF_PROPERTY =
@@ -92,7 +83,7 @@
     public interface RepositoryFactory {
 
         /**
-         * Creates and intializes a repository instance. The returned instance
+         * Creates and initializes a repository instance. The returned instance
          * will be used and finally shut down by the caller of this method.
          *
          * @return initialized repository instance
@@ -119,7 +110,8 @@
      * repository instance is automatically shut down until a new session
      * is opened.
      */
-    private final Map sessions = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
+    private final Map<Session, Session> sessions =
+        new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK);
 
     /**
      * The static repository descriptors. The default {@link RepositoryImpl}
@@ -133,9 +125,8 @@
      * factory to initialize the underlying repository instances.
      *
      * @param factory repository factory
-     * @throws IOException if the static repository descriptors cannot be loaded
      */
-    public TransientRepository(RepositoryFactory factory) throws IOException {
+    public TransientRepository(RepositoryFactory factory) {
         this.factory = factory;
         this.repository = null;
         this.descriptors = new Properties();
@@ -143,12 +134,16 @@
         // FIXME: The current RepositoryImpl class does not allow static
         // access to the repository descriptors, so we need to load them
         // directly from the underlying property file.
-        InputStream in =
-            RepositoryImpl.class.getResourceAsStream("repository.properties");
         try {
-            descriptors.load(in);
-        } finally {
-            in.close();
+            InputStream in = RepositoryImpl.class.getResourceAsStream(
+                    "repository.properties");
+            try {
+                descriptors.load(in);
+            } finally {
+                in.close();
+            }
+        } catch (IOException e) {
+            logger.warn("Unable to load static repository descriptors", e);
         }
     }
 
@@ -159,11 +154,8 @@
      * <code>org.apache.jackrabbit.repository.home</code>. If these properties
      * are not found, then the default values "<code>repository.xml</code>"
      * and "<code>repository</code>" are used.
-     *
-     * @throws IOException if the static repository descriptors cannot be loaded
      */
-    public TransientRepository()
-            throws IOException {
+    public TransientRepository() {
         this(System.getProperty(CONF_PROPERTY, CONF_DEFAULT),
              System.getProperty(HOME_PROPERTY, HOME_DEFAULT));
     }
@@ -173,10 +165,8 @@
      * configuration to initialize the underlying repository instance.
      *
      * @param config repository configuration
-     * @throws IOException if the static repository descriptors cannot be loaded
      */
-    public TransientRepository(final RepositoryConfig config)
-            throws IOException {
+    public TransientRepository(final RepositoryConfig config) {
         this(new RepositoryFactory() {
             public RepositoryImpl getRepository() throws RepositoryException {
                 return RepositoryImpl.create(config);
@@ -187,6 +177,31 @@
     /**
      * Creates a transient repository proxy that will use the given repository
      * configuration file and home directory paths to initialize the underlying
+     * repository instances.
+     *
+     * @see #TransientRepository(File, File)
+     * @param config repository configuration file
+     * @param home repository home directory
+     */
+    public TransientRepository(String config, String home) {
+        this(new File(config), new File(home));
+    }
+
+    /**
+     * Creates a transient repository proxy based on the given repository
+     * home directory and the repository configuration file "repository.xml"
+     * contained in that directory.
+     *
+     * @since Apache Jackrabbit 1.6
+     * @param dir repository home directory
+     */
+    public TransientRepository(File dir) {
+        this(new File(dir, "repository.xml"), dir);
+    }
+
+    /**
+     * Creates a transient repository proxy that will use the given repository
+     * configuration file and home directory paths to initialize the underlying
      * repository instances. The repository configuration file is reloaded
      * whenever the repository is restarted, so it is safe to modify the
      * configuration when all sessions have been closed.
@@ -198,48 +213,22 @@
      * session starts. This is a convenience feature designed to reduce the
      * need for manual configuration.
      *
-     * @param config repository configuration file
-     * @param home repository home directory
-     * @throws IOException if the static repository descriptors cannot be loaded
+     * @since Apache Jackrabbit 1.6
+     * @param xml repository configuration file
+     * @param dir repository home directory
      */
-    public TransientRepository(final String config, final String home)
-            throws IOException {
+    public TransientRepository(final File xml, final File dir) {
         this(new RepositoryFactory() {
             public RepositoryImpl getRepository() throws RepositoryException {
                 try {
-                    // Make sure that the repository configuration file exists
-                    File configFile = new File(config);
-                    if (!configFile.exists()) {
-                        logger.info("Copying default configuration to " + config);
-                        OutputStream output = new FileOutputStream(configFile);
-                        try {
-                            InputStream input =
-                                TransientRepository.class.getResourceAsStream(
-                                        DEFAULT_REPOSITORY_XML);
-                            try {
-                                IOUtils.copy(input, output);
-                            } finally {
-                               input.close();
-                            }
-                        } finally {
-                            output.close();
-                        }
-                    }
-                    // Make sure that the repository home directory exists
-                    File homeDir = new File(home);
-                    if (!homeDir.exists()) {
-                        logger.info("Creating repository home directory " + home);
-                        homeDir.mkdirs();
-                    }
-                    // Load the configuration and create the repository
-                    RepositoryConfig rc = RepositoryConfig.create(config, home);
-                    return RepositoryImpl.create(rc);
+                    return RepositoryImpl.create(
+                            RepositoryConfig.install(xml, dir));
                 } catch (IOException e) {
                     throw new RepositoryException(
                             "Automatic repository configuration failed", e);
                 } catch (ConfigurationException e) {
                     throw new RepositoryException(
-                            "Invalid repository configuration: " + config, e);
+                            "Invalid repository configuration file: " + xml, e);
                 }
             }
         });
@@ -276,15 +265,15 @@
      * descriptor keys are returned.
      *
      * @return descriptor keys
-     * @see Repository#getDescriptorKeys()
      */
     public synchronized String[] getDescriptorKeys() {
         if (repository != null) {
             return repository.getDescriptorKeys();
         } else {
-            List keys = Collections.list(descriptors.propertyNames());
-            Collections.sort(keys);
-            return (String[]) keys.toArray(new String[keys.size()]);
+            String[] keys = Collections.list(
+                    descriptors.propertyNames()).toArray(new String[0]);
+            Arrays.sort(keys);
+            return keys;
         }
     }
 
@@ -305,6 +294,33 @@
         }
     }
 
+    public Value getDescriptorValue(String key) {
+        if (repository != null) {
+            return repository.getDescriptorValue(key);
+        } else {
+            throw new UnsupportedOperationException(
+                    "not implemented yet - see JCR-2062");
+        }
+    }
+
+    public Value[] getDescriptorValues(String key) {
+        if (repository != null) {
+            return repository.getDescriptorValues(key);
+        } else {
+            throw new UnsupportedOperationException(
+                    "not implemented yet - see JCR-2062");
+        }
+    }
+
+    public boolean isSingleValueDescriptor(String key) {
+        if (repository != null) {
+            return repository.isSingleValueDescriptor(key);
+        } else {
+            throw new UnsupportedOperationException(
+                    "not implemented yet - see JCR-2062");
+        }
+    }
+
     /**
      * Logs in to the content repository. Initializes the underlying repository
      * instance if needed. The opened session is added to the set of open
@@ -317,7 +333,8 @@
      * @throws RepositoryException if the session could not be created
      * @see Repository#login(Credentials,String)
      */
-    public synchronized Session login(Credentials credentials, String workspaceName)
+    public synchronized Session login(
+            Credentials credentials, String workspaceName)
             throws RepositoryException {
         // Start the repository if this is the first login
         if (sessions.isEmpty()) {
@@ -326,7 +343,8 @@
 
         try {
             logger.debug("Opening a new session");
-            SessionImpl session = (SessionImpl) repository.login(credentials, workspaceName);
+            SessionImpl session = (SessionImpl) repository.login(
+                    credentials, workspaceName);
             sessions.put(session, session);
             session.addListener(this);
             logger.info("Session opened");
@@ -341,61 +359,6 @@
         }
     }
 
-    /**
-     * Calls {@link #login(Credentials, String)} with a <code>null</code>
-     * workspace name.
-     *
-     * @param credentials login credentials
-     * @return new session
-     * @throws RepositoryException if the session could not be created
-     * @see Repository#login(Credentials)
-     */
-    public Session login(Credentials credentials) throws RepositoryException {
-        return login(credentials, null);
-    }
-
-    /**
-     * Calls {@link #login(Credentials, String)} with <code>null</code> login
-     * credentials.
-     *
-     * @param workspaceName workspace name
-     * @return new session
-     * @throws RepositoryException if the session could not be created
-     * @see Repository#login(String)
-     */
-    public Session login(String workspaceName) throws RepositoryException {
-        return login(null, workspaceName);
-    }
-
-    /**
-     * Calls {@link #login(Credentials, String)} with <code>null</code> login
-     * credentials and a <code>null</code> workspace name.
-     *
-     * @return new session
-     * @throws RepositoryException if the session could not be created
-     * @see Repository#login(Credentials)
-     */
-    public Session login() throws RepositoryException {
-        return login(null, null);
-    }
-
-
-    public Value getDescriptorValue(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
-    }
-
-    public Value[] getDescriptorValues(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
-    }
-
-    public boolean isSingleValueDescriptor(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
-    }
-
-    public boolean isStandardDescriptor(String key) {
-        throw new RuntimeException("not implemented yet - see JCR-2062");
-    }
-
     //--------------------------------------------------<JackrabbitRepository>
 
     /**
@@ -405,9 +368,8 @@
      * @see Session#logout()
      */
     public synchronized void shutdown() {
-        Iterator iterator = new HashSet(sessions.keySet()).iterator();
-        while (iterator.hasNext()) {
-            Session session = (Session) iterator.next();
+        Session[] copy = sessions.keySet().toArray(new Session[0]);
+        for (Session session : copy) {
             session.logout();
         }
     }
@@ -441,4 +403,5 @@
      */
     public void loggingOut(SessionImpl session) {
     }
+
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java Thu May 21 23:11:22 2009
@@ -16,7 +16,8 @@
  */
 package org.apache.jackrabbit.core.config;
 
-import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.IOUtils; 
+import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.data.DataStoreFactory;
 import org.apache.jackrabbit.core.fs.FileSystem;
@@ -41,10 +42,12 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.StringWriter;
@@ -71,10 +74,116 @@
     /** the default logger */
     private static Logger log = LoggerFactory.getLogger(RepositoryConfig.class);
 
+    /** Name of the default repository configuration file. */
+    private static final String REPOSITORY_XML = "repository.xml";
+
     /** Name of the workspace configuration file. */
     private static final String WORKSPACE_XML = "workspace.xml";
 
     /**
+     * Returns the configuration of a repository in a given repository
+     * directory. The repository configuration is read from a "repository.xml"
+     * file inside the repository directory.
+     * <p>
+     * The directory is created if it does not exist. If the repository
+     * configuration file does not exist, then it is created using the
+     * default Jackrabbit configuration settings.
+     *
+     * @since Apache Jackrabbit 1.6
+     * @param dir repository home directory
+     * @return repository configuration
+     * @throws ConfigurationException on configuration errors
+     */
+    public static RepositoryConfig install(File dir)
+            throws IOException, ConfigurationException {
+        return install(new File(dir, REPOSITORY_XML), dir);
+    }
+
+    /**
+     * Returns the configuration of a repository with the given configuration
+     * file and repository home directory.
+     * <p>
+     * The directory is created if it does not exist. If the repository
+     * configuration file does not exist, then it is created using the
+     * default Jackrabbit configuration settings.
+     *
+     * @since Apache Jackrabbit 1.6
+     * @param dir repository home directory
+     * @return repository configuration
+     * @throws ConfigurationException on configuration errors
+     */
+    public static RepositoryConfig install(File xml, File dir)
+            throws IOException, ConfigurationException {
+        if (!dir.exists()) {
+            log.info("Creating repository directory {}", dir);
+            dir.mkdirs();
+        }
+
+        if (!xml.exists()) {
+            log.info("Installing default repository configuration to {}", xml);
+            OutputStream output = new FileOutputStream(xml);
+            try {
+                InputStream input =
+                    RepositoryImpl.class.getResourceAsStream(REPOSITORY_XML);
+                try {
+                    IOUtils.copy(input, output);
+                } finally {
+                   input.close();
+                }
+            } finally {
+                output.close();
+            }
+        }
+
+        return create(xml, dir);
+    }
+
+    /**
+     * Returns the configuration of a repository in a given repository
+     * directory. The repository configuration is read from a "repository.xml"
+     * file inside the repository directory.
+     * <p>
+     * An exception is thrown if the directory does not exist or if
+     * the repository configuration file can not be read. 
+     *
+     * @since Apache Jackrabbit 1.6
+     * @param dir repository home directory
+     * @return repository configuration
+     * @throws ConfigurationException on configuration errors
+     */
+    public static RepositoryConfig create(File dir)
+            throws ConfigurationException {
+        return create(new File(dir, REPOSITORY_XML), dir);
+    }
+
+    /**
+     * Returns the configuration of a repository with the given configuration
+     * file and repository home directory.
+     * <p>
+     * An exception is thrown if the directory does not exist or if
+     * the repository configuration file can not be read. 
+     *
+     * @since Apache Jackrabbit 1.6
+     * @param dir repository home directory
+     * @return repository configuration
+     * @throws ConfigurationException on configuration errors
+     */
+    public static RepositoryConfig create(File xml, File dir)
+            throws ConfigurationException {
+        if (!dir.isDirectory()) {
+            throw new ConfigurationException(
+                    "Repository directory " + dir + " does not exist");
+        }
+
+        if (!xml.isFile()) {
+            throw new ConfigurationException(
+                    "Repository configuration file " + xml + " does not exist");
+        }
+
+        return create(new InputSource(xml.toURI().toString()), dir.getPath());
+    }
+
+    /**
      * Convenience method that wraps the configuration file name into an
      * {@link InputSource} and invokes the
      * {@link #create(InputSource, String)} method.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XAEnvironment.java Thu May 21 23:11:22 2009
@@ -24,6 +24,7 @@
 import org.slf4j.LoggerFactory;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.Workspace;
 import javax.jcr.lock.LockException;
 import java.util.Map;
 import java.util.HashMap;
@@ -263,16 +264,66 @@
 
     /**
      * Add lock token to this environment.
+     * @param session 
      * @param lt lock token
+     * @throws RepositoryException 
      */
-    public void addLockToken(String lt) {
+    public void addLockToken(SessionImpl session, String lt) throws RepositoryException {
+        try {
+            LockToken lockToken = LockToken.parse(lt);
+            NodeImpl node = (NodeImpl) session.getItemManager().getItem(lockToken.getId());
+            AbstractLockInfo info = getLockInfo(node);
+            if (info != null) {
+                if (info.getLockHolder() == null) {
+                    info.setLockHolder(session);
+                } else {
+                    String msg = "Cannot add lock token: lock already held by other session.";
+                    log.warn(msg);
+                    throw new LockException(msg);
+                }
+            }
+            // inform SessionLockManager
+            getSessionLockManager(session).lockTokenAdded(lt);
+        } catch (IllegalArgumentException e) {
+            String msg = "Bad lock token: " + e.getMessage();
+            log.warn(msg);
+            throw new LockException(msg);
+        }
     }
 
     /**
      * Remove lock token from this environment.
+     * @param session 
      * @param lt lock token
+     * @throws RepositoryException 
      */
-    public void removeLockToken(String lt) {
+    public void removeLockToken(SessionImpl session, String lt) throws RepositoryException {
+        try {
+            LockToken lockToken = LockToken.parse(lt);
+
+            NodeImpl node = (NodeImpl) session.getItemManager().getItem(lockToken.getId());
+            AbstractLockInfo info = getLockInfo(node);
+            if (info != null) {
+                if (session == info.getLockHolder()) {
+                    info.setLockHolder(null);
+                } else {
+                    String msg = "Cannot remove lock token: lock held by other session.";
+                    log.warn(msg);
+                    throw new LockException(msg);
+                }
+            }
+            // inform SessionLockManager
+            getSessionLockManager(session).lockTokenRemoved(lt);
+        } catch (IllegalArgumentException e) {
+            String msg = "Bad lock token: " + e.getMessage();
+            log.warn(msg);
+            throw new LockException(msg);
+        }
+    }
+
+    static SessionLockManager getSessionLockManager(SessionImpl session) throws RepositoryException {
+        Workspace wsp = (Workspace) session.getWorkspace();
+        return (SessionLockManager) wsp.getLockManager();
     }
 
     /**
@@ -437,7 +488,12 @@
             if (isUnlock) {
                 lockMgr.internalUnlock(node);
             } else {
-                lockMgr.internalLock(node, deep, sessionScoped, getSecondsRemaining(), lockOwner);
+                AbstractLockInfo internalLock = lockMgr.internalLock(node, deep, sessionScoped, getSecondsRemaining(), lockOwner);
+                AbstractLockInfo xaEnvLock = getLockInfo(node);
+                // Check if the lockToken has been removed in the transaction ...
+                if (xaEnvLock != null && xaEnvLock.getLockHolder() == null) {
+                    internalLock.setLockHolder(null);
+                }
             }
         }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XALockManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XALockManager.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XALockManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/lock/XALockManager.java Thu May 21 23:11:22 2009
@@ -205,7 +205,7 @@
      */
     public void lockTokenAdded(SessionImpl session, String lt) throws RepositoryException {
         if (isInXA()) {
-            xaEnv.addLockToken(lt);
+            xaEnv.addLockToken(session, lt);
         } else {
             lockMgr.lockTokenAdded(session, lt);
         }
@@ -216,7 +216,7 @@
      */
     public void lockTokenRemoved(SessionImpl session, String lt) throws RepositoryException {
         if (isInXA()) {
-            xaEnv.removeLockToken(lt);
+            xaEnv.removeLockToken(session, lt);
         } else {
             lockMgr.lockTokenRemoved(session, lt);
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/ValueConstraint.java Thu May 21 23:11:22 2009
@@ -87,6 +87,7 @@
         }
         switch (type) {
             case PropertyType.STRING:
+            case PropertyType.URI:
                 return new StringConstraint(definition);
 
             case PropertyType.BOOLEAN:
@@ -100,6 +101,7 @@
 
             case PropertyType.LONG:
             case PropertyType.DOUBLE:
+            case PropertyType.DECIMAL:
                 return new NumericConstraint(definition);
 
             case PropertyType.NAME:
@@ -108,6 +110,7 @@
             case PropertyType.PATH:
                 return new PathConstraint(definition, resolver);
 
+            case PropertyType.WEAKREFERENCE:
             case PropertyType.REFERENCE:
                 return new ReferenceConstraint(definition, resolver);
 
@@ -301,13 +304,13 @@
     void check(double number) throws ConstraintViolationException {
         if (lowerLimit != null) {
             if (lowerInclusive) {
-                if (number < lowerLimit.doubleValue()) {
+                if (number < lowerLimit) {
                     throw new ConstraintViolationException(number
                             + " does not satisfy the constraint '"
                             + definition + "'");
                 }
             } else {
-                if (number <= lowerLimit.doubleValue()) {
+                if (number <= lowerLimit) {
                     throw new ConstraintViolationException(number
                             + " does not satisfy the constraint '"
                             + definition + "'");
@@ -316,13 +319,13 @@
         }
         if (upperLimit != null) {
             if (upperInclusive) {
-                if (number > upperLimit.doubleValue()) {
+                if (number > upperLimit) {
                     throw new ConstraintViolationException(number
                             + " does not satisfy the constraint '"
                             + definition + "'");
                 }
             } else {
-                if (number >= upperLimit.doubleValue()) {
+                if (number >= upperLimit) {
                     throw new ConstraintViolationException(number
                             + " does not satisfy the constraint '"
                             + definition + "'");
@@ -345,6 +348,10 @@
                 check(value.getDouble());
                 return;
 
+            case PropertyType.DECIMAL:
+                check(value.getDouble());
+                return;
+
             case PropertyType.BINARY:
                 BLOBFileValue blob = value.getBLOBFileValue();
                 long length = blob.getLength();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java Thu May 21 23:11:22 2009
@@ -40,6 +40,7 @@
 import java.io.InputStream;
 import java.util.HashSet;
 import java.util.Set;
+import java.math.BigDecimal;
 
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
@@ -383,6 +384,9 @@
                 case PropertyType.DOUBLE:
                     val = InternalValue.create(in.readDouble());
                     break;
+                case PropertyType.DECIMAL:
+                    val = InternalValue.create(readDecimal(in));
+                    break;
                 case PropertyType.LONG:
                     val = InternalValue.create(in.readLong());
                     break;
@@ -392,6 +396,7 @@
                 case PropertyType.NAME:
                     val = InternalValue.create(readQName(in));
                     break;
+                case PropertyType.WEAKREFERENCE:
                 case PropertyType.REFERENCE:
                     val = InternalValue.create(readUUID(in));
                     break;
@@ -505,6 +510,15 @@
                         return false;
                     }
                     break;
+                case PropertyType.DECIMAL:
+                    try {
+                        BigDecimal d = readDecimal(in);
+                        log.debug("  decimal: " + d);
+                    } catch (IOException e) {
+                        log.error("Error while reading decimal value: " + e);
+                        return false;
+                    }
+                    break;
                 case PropertyType.LONG:
                     try {
                         double l = in.readLong();
@@ -532,6 +546,7 @@
                         return false;
                     }
                     break;
+                case PropertyType.WEAKREFERENCE:
                 case PropertyType.REFERENCE:
                     try {
                         UUID uuid = readUUID(in);
@@ -673,6 +688,14 @@
                         throw new IOException("Unexpected error while writing DOUBLE value.");
                     }
                     break;
+                case PropertyType.DECIMAL:
+                    try {
+                        writeDecimal(out, val.getDecimal());
+                    } catch (RepositoryException e) {
+                        // should never occur
+                        throw new IOException("Unexpected error while writing DECIMAL value.");
+                    }
+                    break;
                 case PropertyType.LONG:
                     try {
                         out.writeLong(val.getLong());
@@ -692,6 +715,7 @@
                 case PropertyType.NAME:
                     writeQName(out, val.getQName());
                     break;
+                case PropertyType.WEAKREFERENCE:
                 case PropertyType.REFERENCE:
                     writeUUID(out, val.getUUID());
                     break;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java Thu May 21 23:11:22 2009
@@ -38,6 +38,7 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.math.BigDecimal;
 
 /**
  * This Class implements relatively efficient serialization methods for item
@@ -316,6 +317,37 @@
     }
 
     /**
+     * Deserializes a BigDecimal
+     * @param in the input stream
+     * @return the decimal
+     * @throws IOException in an I/O error occurs.
+     */
+    public BigDecimal readDecimal(DataInputStream in) throws IOException {
+        if (in.readBoolean()) {
+            // TODO more efficient serialization format
+            return new BigDecimal(in.readUTF());
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Serializes a BigDecimal
+     * @param out the output stream
+     * @param decimal the decimal number
+     * @throws IOException in an I/O error occurs.
+     */
+    public void writeDecimal(DataOutputStream out, BigDecimal decimal) throws IOException {
+        if (decimal == null) {
+            out.writeBoolean(false);
+        } else {
+            out.writeBoolean(true);
+            // TODO more efficient serialization format
+            out.writeUTF(decimal.toString());
+        }
+    }
+
+    /**
      * Deserializes a NodeID
      * @param in the input stream
      * @return the uuid

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java Thu May 21 23:11:22 2009
@@ -21,6 +21,7 @@
 import java.util.Calendar;
 import java.util.Iterator;
 import java.util.List;
+import java.math.BigDecimal;
 
 import javax.jcr.NamespaceException;
 import javax.jcr.PropertyType;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java Thu May 21 23:11:22 2009
@@ -29,6 +29,7 @@
 import org.apache.jackrabbit.util.ISO8601;
 import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.value.StringValue;
+import org.apache.jackrabbit.value.URIValue;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl;
@@ -49,6 +50,9 @@
 import java.io.SequenceInputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.Calendar;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.math.BigDecimal;
 
 /**
  * <code>InternalValue</code> represents the internal format of a property value.
@@ -64,6 +68,8 @@
  * <tr>BOOLEAN<td></td><td>Boolean</td></tr>
  * <tr>NAME<td></td><td>Name</td></tr>
  * <tr>PATH<td></td><td>Path</td></tr>
+ * <tr>URI<td></td><td>URI</td></tr>
+ * <tr>DECIMAL<td></td><td>BigDecimal</td></tr>
  * <tr>BINARY<td></td><td>BLOBFileValue</td></tr>
  * <tr>REFERENCE<td></td><td>UUID</td></tr>
  * </table>
@@ -152,10 +158,20 @@
                 return create(value.getDate());
             case PropertyType.DOUBLE:
                 return create(value.getDouble());
+            case PropertyType.DECIMAL:
+                return create(value.getDecimal());
             case PropertyType.LONG:
                 return create(value.getLong());
             case PropertyType.REFERENCE:
                 return create(new UUID(value.getString()));
+            case PropertyType.WEAKREFERENCE:
+                return create(new UUID(value.getString()), true);
+            case PropertyType.URI:
+                try {
+                    return create(new URI(value.getString()));
+                } catch (URISyntaxException e) {
+                    throw new ValueFormatException(e.getMessage());
+                }
             case PropertyType.NAME:
                 try {
                     if (value instanceof QValueValue) {
@@ -229,6 +245,22 @@
      * @param value
      * @return the created value
      */
+    public static InternalValue create(BigDecimal value) {
+        return new InternalValue(value);
+    }
+
+    /**
+     * @param value
+     * @return the created value
+     */
+    public static InternalValue create(URI value) {
+        return new InternalValue(value);
+    }
+
+    /**
+     * @param value
+     * @return the created value
+     */
     public static InternalValue create(boolean value) {
         return value ? BOOLEAN_TRUE : BOOLEAN_FALSE;
     }
@@ -376,7 +408,16 @@
      * @return the created value
      */
     public static InternalValue create(UUID value) {
-        return new InternalValue(value);
+        return create(value, false);
+    }
+
+    /**
+     * @param value
+     * @param weak
+     * @return the created value
+     */
+    public static InternalValue create(UUID value, boolean weak) {
+        return new InternalValue(value, weak);
     }
 
     //----------------------------------------------------< conversions, etc. >
@@ -409,8 +450,14 @@
                     return vf.createValue(((Double) val).doubleValue());
                 case PropertyType.LONG:
                     return vf.createValue(((Long) val).longValue());
+                case PropertyType.DECIMAL:
+                    return vf.createValue((BigDecimal) val);
                 case PropertyType.REFERENCE:
                     return vf.createValue(val.toString(), PropertyType.REFERENCE);
+                case PropertyType.WEAKREFERENCE:
+                    return vf.createValue(val.toString(), PropertyType.WEAKREFERENCE);
+                case PropertyType.URI:
+                    return new URIValue((URI) val);
                 case PropertyType.PATH:
                     return vf.createValue(resolver.getJCRPath((Path) val), PropertyType.PATH);
                 case PropertyType.NAME:
@@ -507,12 +554,18 @@
                 return create(Double.parseDouble(s));
             case PropertyType.LONG:
                 return create(Long.parseLong(s));
+            case PropertyType.DECIMAL:
+                return create(new BigDecimal(s));
             case PropertyType.REFERENCE:
                 return create(new UUID(s));
+            case PropertyType.WEAKREFERENCE:
+                return create(new UUID(s), true);
             case PropertyType.PATH:
                 return create(PathFactoryImpl.getInstance().create(s));
             case PropertyType.NAME:
                 return create(NameFactoryImpl.getInstance().create(s));
+            case PropertyType.URI:
+                return create(URI.create(s));
             case PropertyType.STRING:
                 return create(s);
 
@@ -564,6 +617,14 @@
         super(Boolean.valueOf(value));
     }
 
+    private InternalValue(URI value) {
+        super(value, PropertyType.URI);
+    }
+
+    private InternalValue(BigDecimal value) {
+        super(value, PropertyType.DECIMAL);
+    }
+
     private InternalValue(BLOBFileValue value) {
         super(value, PropertyType.BINARY);
     }
@@ -576,6 +637,10 @@
         super(value, PropertyType.REFERENCE);
     }
 
+    private InternalValue(UUID value, boolean weak) {
+        super(value, weak ? PropertyType.WEAKREFERENCE : PropertyType.REFERENCE);
+    }
+
     /**
      * Create a BLOB value from in input stream. Small objects will create an in-memory object,
      * while large objects are stored in the data store or in a temp file (if the store parameter is not set).

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java Thu May 21 23:11:22 2009
@@ -37,6 +37,8 @@
 import java.io.UnsupportedEncodingException;
 import java.io.FileInputStream;
 import java.util.Calendar;
+import java.math.BigDecimal;
+import java.net.URI;
 
 /**
  * <code>InternalValueFactory</code>...
@@ -76,18 +78,27 @@
                     return InternalValue.create(Double.parseDouble(value));
                 case PropertyType.LONG:
                     return InternalValue.create(Long.parseLong(value));
+                case PropertyType.DECIMAL:
+                    return InternalValue.create(new BigDecimal(value));
                 case PropertyType.PATH:
                     return InternalValue.create(PathFactoryImpl.getInstance().create(value));
                 case PropertyType.NAME:
                     return InternalValue.create(NameFactoryImpl.getInstance().create(value));
                 case PropertyType.STRING:
                     return InternalValue.create(value);
+                case PropertyType.URI:
+                    return InternalValue.create(URI.create(value));
                 case PropertyType.REFERENCE:
                     return InternalValue.create(new UUID(value));
+                case PropertyType.WEAKREFERENCE:
+                    return InternalValue.create(new UUID(value), true);
                 case PropertyType.BINARY:
                     return InternalValue.create(value.getBytes("UTF-8"));
                 // default: invalid type specified -> see below.
             }
+        } catch (NumberFormatException ex) {
+            // given String value cannot be converted to Decimal
+            throw new ValueFormatException(ex);
         } catch (IllegalArgumentException ex) {
             // given String value cannot be converted to Long/Double/Path/Name
             throw new ValueFormatException(ex);

Propchange: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 21 23:11:22 2009
@@ -1 +1,2 @@
 /jackrabbit/branches/1.3/jackrabbit-core/src/test/resources/repositoryStubImpl.properties:631261
+/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties:774918-777034

Propchange: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-nodetypes.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 21 23:11:22 2009
@@ -1 +1,2 @@
 /jackrabbit/branches/1.3/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/integration/test-nodetypes.xml:631261
+/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-nodetypes.xml:774918-777034

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java?rev=777313&r1=777312&r2=777313&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java Thu May 21 23:11:22 2009
@@ -96,9 +96,6 @@
         } catch (ConfigurationException e) {
             throw new RepositoryException(
                     "Error in test repository configuration", e);
-        } catch (IOException e) {
-            throw new RepositoryException(
-                    "Error in test repository initialization", e);
         }
     }
 



Mime
View raw message