jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r570407 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: ./ data/ nodetype/ persistence/ persistence/bundle/ persistence/bundle/util/ state/ value/
Date Tue, 28 Aug 2007 13:05:54 GMT
Author: thomasm
Date: Tue Aug 28 06:05:52 2007
New Revision: 570407

URL: http://svn.apache.org/viewvc?rev=570407&view=rev
Log:
JCR-926: global data store: add DataStore to constructors

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PMContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PMContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/PropertyImpl.java
Tue Aug 28 06:05:52 2007
@@ -329,7 +329,7 @@
                     InternalValue.create(name).toJCRValue(session.getNamespaceResolver()),
                     reqType,
                     ValueFactoryImpl.getInstance());
-            internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
+            internalValue = InternalValue.create(targetValue, session.getNamespaceResolver(),
rep.getDataStore());
         } else {
             // no type conversion required
             internalValue = InternalValue.create(name);
@@ -380,7 +380,7 @@
                                 InternalValue.create(name).toJCRValue(session.getNamespaceResolver()),
                                 reqType,
                                 ValueFactoryImpl.getInstance());
-                        internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
+                        internalValue = InternalValue.create(targetValue, session.getNamespaceResolver(),
rep.getDataStore());
                     } else {
                         // no type conversion required
                         internalValue = InternalValue.create(name);
@@ -671,7 +671,7 @@
             Value targetVal = ValueHelper.convert(
                     new DateValue(date), reqType,
                     ValueFactoryImpl.getInstance());
-            value = InternalValue.create(targetVal, session.getNamespaceResolver());
+            value = InternalValue.create(targetVal, session.getNamespaceResolver(), rep.getDataStore());
         } else {
             // no type conversion required
             value = InternalValue.create(date);
@@ -705,7 +705,7 @@
             Value targetVal = ValueHelper.convert(
                     new DoubleValue(number), reqType,
                     ValueFactoryImpl.getInstance());
-            value = InternalValue.create(targetVal, session.getNamespaceResolver());
+            value = InternalValue.create(targetVal, session.getNamespaceResolver(), rep.getDataStore());
         } else {
             // no type conversion required
             value = InternalValue.create(number);
@@ -787,7 +787,7 @@
             Value targetValue = ValueHelper.convert(
                     string, reqType,
                     ValueFactoryImpl.getInstance());
-            internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
+            internalValue = InternalValue.create(targetValue, session.getNamespaceResolver(),
rep.getDataStore());
         } else {
             // no type conversion required
             internalValue = InternalValue.create(string);
@@ -827,7 +827,7 @@
                         Value targetValue = ValueHelper.convert(
                                 string, reqType,
                                 ValueFactoryImpl.getInstance());
-                        internalValue = InternalValue.create(targetValue, session.getNamespaceResolver());
+                        internalValue = InternalValue.create(targetValue, session.getNamespaceResolver(),
rep.getDataStore());
                     } else {
                         // no type conversion required
                         internalValue = InternalValue.create(string);
@@ -865,7 +865,7 @@
             Value targetVal = ValueHelper.convert(
                     new BooleanValue(b), reqType,
                     ValueFactoryImpl.getInstance());
-            value = InternalValue.create(targetVal, session.getNamespaceResolver());
+            value = InternalValue.create(targetVal, session.getNamespaceResolver(), rep.getDataStore());
         } else {
             // no type conversion required
             value = InternalValue.create(b);
@@ -941,7 +941,7 @@
             Value targetVal = ValueHelper.convert(
                     new LongValue(number), reqType,
                     ValueFactoryImpl.getInstance());
-            value = InternalValue.create(targetVal, session.getNamespaceResolver());
+            value = InternalValue.create(targetVal, session.getNamespaceResolver(), rep.getDataStore());
         } else {
             // no type conversion required
             value = InternalValue.create(number);
@@ -984,10 +984,10 @@
             Value targetVal = ValueHelper.convert(
                     value, reqType,
                     ValueFactoryImpl.getInstance());
-            internalValue = InternalValue.create(targetVal, session.getNamespaceResolver());
+            internalValue = InternalValue.create(targetVal, session.getNamespaceResolver(),
rep.getDataStore());
         } else {
             // no type conversion required
-            internalValue = InternalValue.create(value, session.getNamespaceResolver());
+            internalValue = InternalValue.create(value, session.getNamespaceResolver(), rep.getDataStore());
         }
         internalSetValue(new InternalValue[]{internalValue}, reqType);
     }
@@ -1044,10 +1044,10 @@
                         Value targetVal = ValueHelper.convert(
                                 value, reqType,
                                 ValueFactoryImpl.getInstance());
-                        internalValue = InternalValue.create(targetVal, session.getNamespaceResolver());
+                        internalValue = InternalValue.create(targetVal, session.getNamespaceResolver(),
rep.getDataStore());
                     } else {
                         // no type conversion required
-                        internalValue = InternalValue.create(value, session.getNamespaceResolver());
+                        internalValue = InternalValue.create(value, session.getNamespaceResolver(),
rep.getDataStore());
                     }
                 }
                 internalValues[i] = internalValue;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Tue Aug 28 06:05:52 2007
@@ -373,7 +373,8 @@
                 vConfig.getPersistenceManagerConfig(),
                 rootNodeId,
                 nsReg,
-                ntReg);
+                ntReg,
+                dataStore);
 
         return new VersionManagerImpl(pm, fs, ntReg, delegatingDispatcher,
                 VERSION_STORAGE_NODE_ID, SYSTEM_ROOT_NODE_ID, cacheFactory);
@@ -1123,11 +1124,12 @@
                                                                PersistenceManagerConfig pmConfig,
                                                                NodeId rootNodeId,
                                                                NamespaceRegistry nsReg,
-                                                               NodeTypeRegistry ntReg)
+                                                               NodeTypeRegistry ntReg,
+                                                               DataStore dataStore)
             throws RepositoryException {
         try {
             PersistenceManager pm = (PersistenceManager) pmConfig.newInstance();
-            pm.init(new PMContext(homeDir, fs, rootNodeId, nsReg, ntReg));
+            pm.init(new PMContext(homeDir, fs, rootNodeId, nsReg, ntReg, dataStore));
             return pm;
         } catch (Exception e) {
             String msg = "Cannot instantiate persistence manager " + pmConfig.getClassName();
@@ -1722,7 +1724,8 @@
                     config.getPersistenceManagerConfig(),
                     rootNodeId,
                     nsReg,
-                    ntReg);
+                    ntReg,
+                    dataStore);
 
             // create item state manager
             try {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
Tue Aug 28 06:05:52 2007
@@ -246,7 +246,7 @@
         }
         this.subject = subject;
         nsMappings = new LocalNamespaceMappings(rep.getNamespaceRegistry());
-        ntMgr = new NodeTypeManagerImpl(rep.getNodeTypeRegistry(), rep.getNamespaceRegistry(),
getNamespaceResolver());
+        ntMgr = new NodeTypeManagerImpl(rep.getNodeTypeRegistry(), rep.getNamespaceRegistry(),
getNamespaceResolver(), rep.getDataStore());
         String wspName = wspConfig.getName();
         wsp = createWorkspaceInstance(wspConfig,
                 rep.getWorkspaceStateManager(wspName), rep, this);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
Tue Aug 28 06:05:52 2007
@@ -54,7 +54,7 @@
 
     private final int sleepBetweenNodes;
     
-    private final int sleepBetweenEvents;
+    private int testDelay;
 
     private DataStore store;
 
@@ -62,8 +62,6 @@
 
     private ArrayList listeners = new ArrayList();
 
-    // TODO Observation: it is up to the implementation whether changes made to
-    // the subtree below jcr:system trigger events.
     // TODO It should be possible to stop and restart a garbage collection scan.
     // TODO It may be possible to delete files early, see rememberNode()
 
@@ -73,13 +71,19 @@
      * 
      * @param callback if set, this is called while scanning
      * @param sleepBetweenNodes the number of milliseconds to sleep in the main scan loop
(0 if the scan should run at full speed)
-     * @param sleepBetweenEvents the number of milliseconds to sleep while processing events
(0 to avoid delays in the application)
      */
-    public GarbageCollector(ScanEventListener callback, int sleepBetweenNodes, int sleepBetweenEvents)
{
+    public GarbageCollector(ScanEventListener callback, int sleepBetweenNodes) {
         this.sleepBetweenNodes = sleepBetweenNodes;
-        this.sleepBetweenEvents = sleepBetweenEvents;
         this.callback = callback;
     }
+    
+    /**
+     * When testing the garbage collection, a delay class is tested, 
+     * @param testDelay the delay in milliseconds
+     */
+    public void setTestDelay(int testDelay) {
+        this.testDelay = testDelay;
+    }
 
     public void scan(Session session) throws RepositoryException,
             IllegalStateException, IOException {
@@ -235,9 +239,9 @@
         }
 
         public void onEvent(EventIterator events) {
-            if(sleepBetweenEvents > 0) {
+            if(testDelay > 0) {
                 try {
-                    Thread.sleep(sleepBetweenEvents);
+                    Thread.sleep(testDelay);
                 } catch (InterruptedException e) {
                     // ignore
                 }
@@ -250,7 +254,7 @@
                         Item item = session.getItem(path);
                         if (item.isNode()) {
                             Node n = (Node) item;
-                            recurse(n, sleepBetweenEvents);
+                            recurse(n, testDelay);
                         }
                     } catch (PathNotFoundException e) {
                         // ignore

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeImpl.java
Tue Aug 28 06:05:52 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
+import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.name.NameException;
 import org.apache.jackrabbit.name.NamespaceResolver;
@@ -50,6 +51,7 @@
     private final NodeTypeManagerImpl ntMgr;
     // namespace resolver used to translate qualified names to JCR names
     private final NamespaceResolver nsResolver;
+    private final DataStore store;    
 
     /**
      * Package private constructor
@@ -64,11 +66,12 @@
      * @param nsResolver namespace resolver
      */
     NodeTypeImpl(EffectiveNodeType ent, NodeTypeDef ntd,
-                 NodeTypeManagerImpl ntMgr, NamespaceResolver nsResolver) {
+                 NodeTypeManagerImpl ntMgr, NamespaceResolver nsResolver, DataStore store)
{
         this.ent = ent;
         this.ntMgr = ntMgr;
         this.nsResolver = nsResolver;
         this.ntd = ntd;
+        this.store = store;
     }
 
     /**
@@ -381,10 +384,10 @@
                 Value targetVal = ValueHelper.convert(
                         value, targetType,
                         ValueFactoryImpl.getInstance());
-                internalValue = InternalValue.create(targetVal, nsResolver);
+                internalValue = InternalValue.create(targetVal, nsResolver, store);
             } else {
                 // no type conversion required
-                internalValue = InternalValue.create(value, nsResolver);
+                internalValue = InternalValue.create(value, nsResolver, store);
             }
             EffectiveNodeType.checkSetPropertyValueConstraints(
                     def, new InternalValue[]{internalValue});
@@ -459,10 +462,10 @@
                         Value targetVal = ValueHelper.convert(
                                 values[i], targetType,
                                 ValueFactoryImpl.getInstance());
-                        internalValue = InternalValue.create(targetVal, nsResolver);
+                        internalValue = InternalValue.create(targetVal, nsResolver, store);
                     } else {
                         // no type conversion required
-                        internalValue = InternalValue.create(values[i], nsResolver);
+                        internalValue = InternalValue.create(values[i], nsResolver, store);
                     }
                     list.add(internalValue);
                 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
Tue Aug 28 06:05:52 2007
@@ -26,6 +26,7 @@
 import org.apache.jackrabbit.util.name.NamespaceMapping;
 import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
 import org.apache.jackrabbit.core.NamespaceRegistryImpl;
+import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.nodetype.compact.CompactNodeTypeDefReader;
 import org.apache.jackrabbit.core.nodetype.compact.ParseException;
 import org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader;
@@ -101,6 +102,8 @@
      * <code>NodeTypeManager</code>
      */
     private final Map ndCache;
+    
+    private final DataStore store;
 
     /**
      * Creates a new <code>NodeTypeManagerImpl</code> instance.
@@ -111,11 +114,12 @@
      */
     public NodeTypeManagerImpl(
             NodeTypeRegistry ntReg, NamespaceRegistryImpl nsReg,
-            NamespaceResolver nsResolver) {
+            NamespaceResolver nsResolver, DataStore store) {
         this.nsResolver = nsResolver;
         this.ntReg = ntReg;
         this.nsReg = nsReg;
         this.ntReg.addListener(this);
+        this.store = store;
 
         // setup caches with soft references to node type
         // & item definition instances
@@ -182,7 +186,7 @@
             if (nt == null) {
                 EffectiveNodeType ent = ntReg.getEffectiveNodeType(name);
                 NodeTypeDef def = ntReg.getNodeTypeDef(name);
-                nt = new NodeTypeImpl(ent, def, this, nsResolver);
+                nt = new NodeTypeImpl(ent, def, this, nsResolver, store);
                 ntCache.put(name, nt);
             }
             return nt;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PMContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PMContext.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PMContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PMContext.java
Tue Aug 28 06:05:52 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.core.persistence;
 
+import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.NodeId;
@@ -58,6 +59,11 @@
     private final NodeId rootNodeId;
 
     /**
+     * Data store for binary properties.
+     */
+    private final DataStore dataStore;
+
+    /**
      * Creates a new <code>PMContext</code>.
      *
      * @param homeDir the physical home directory
@@ -70,12 +76,14 @@
                      FileSystem fs,
                      NodeId rootNodeId,
                      NamespaceRegistry nsReg,
-                     NodeTypeRegistry ntReg) {
+                     NodeTypeRegistry ntReg, 
+                     DataStore dataStore) {
         this.physicalHomeDir = homeDir;
         this.fs = fs;
         this.rootNodeId = rootNodeId;
         this.nsReg = nsReg;
         this.ntReg = ntReg;
+        this.dataStore = dataStore;
     }
 
 
@@ -119,5 +127,14 @@
      */
     public NodeTypeRegistry getNodeTypeRegistry() {
         return ntReg;
+    }
+    
+    /**
+     * Returns the data store
+     *
+     * @return the data store
+     */
+    public DataStore getDataStore() {
+        return dataStore;
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
Tue Aug 28 06:05:52 2007
@@ -572,7 +572,7 @@
             nodeReferenceDelete = con.prepareStatement("delete from " + schemaObjectPrefix
+ "REFS where NODE_ID_HI = ? and NODE_ID_LO = ?");
         }
         // load namespaces
-        binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex());
+        binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex(),
context.getDataStore());
         binding.setMinBlobSize(minBlobSize);
 
         initialized = true;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
Tue Aug 28 06:05:52 2007
@@ -370,7 +370,7 @@
         }
 
         // load namespaces
-        binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex());
+        binding = new BundleBinding(errorHandling, blobStore, getNsIndex(), getNameIndex(),
context.getDataStore());
         binding.setMinBlobSize(minBlobSize);
 
         initialized = true;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/BundleBinding.java
Tue Aug 28 06:05:52 2007
@@ -24,6 +24,7 @@
 import org.apache.jackrabbit.core.PropertyId;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.value.BLOBFileValue;
+import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
 import org.apache.jackrabbit.name.QName;
@@ -62,8 +63,8 @@
      * @param nameIndex the name index
      */
     public BundleBinding(ErrorHandling errorHandling, BLOBStore blobStore,
-                         StringIndex nsIndex, StringIndex nameIndex) {
-        super(errorHandling, blobStore, nsIndex, nameIndex);
+                         StringIndex nsIndex, StringIndex nameIndex, DataStore dataStore)
{
+        super(errorHandling, blobStore, nsIndex, nameIndex, dataStore);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
Tue Aug 28 06:05:52 2007
@@ -29,6 +29,7 @@
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.value.BLOBFileValue;
+import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
 import org.apache.jackrabbit.name.QName;
@@ -96,6 +97,11 @@
     protected final ErrorHandling errorHandling;
 
     /**
+     * Data store for binary properties.
+     */
+    protected final DataStore dataStore;
+
+    /**
      * Creates a new item state binding
      *
      * @param errorHandling the error handing configuration
@@ -105,11 +111,12 @@
      */
     public ItemStateBinding(ErrorHandling errorHandling,
                             BLOBStore blobStore,
-                            StringIndex nsIndex, StringIndex nameIndex) {
+                            StringIndex nsIndex, StringIndex nameIndex, DataStore dataStore)
{
         this.errorHandling = errorHandling;
         this.nsIndex = nsIndex;
         this.nameIndex = nameIndex;
         this.blobStore = blobStore;
+        this.dataStore = dataStore;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PMContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PMContext.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PMContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PMContext.java
Tue Aug 28 06:05:52 2007
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.state;
 
 import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 
@@ -31,7 +32,7 @@
 public class PMContext extends org.apache.jackrabbit.core.persistence.PMContext {
 
     public PMContext(File homeDir, FileSystem fs, NodeId rootNodeId,
-                         NamespaceRegistry nsReg, NodeTypeRegistry ntReg) {
-        super(homeDir, fs, rootNodeId, nsReg, ntReg);
+                         NamespaceRegistry nsReg, NodeTypeRegistry ntReg, DataStore dataStore)
{
+        super(homeDir, fs, rootNodeId, nsReg, ntReg, dataStore);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
Tue Aug 28 06:05:52 2007
@@ -237,7 +237,6 @@
      * If this <code>BLOBFileValue</code> is backed by a persistent resource
      * calling this method will have no effect.
      *
-     * @see #delete()
      * @see #delete(boolean)
      */
     public void discard() {
@@ -252,21 +251,6 @@
         } else if (buffer != null) {
             // this instance is backed by an in-memory buffer
             buffer = EMPTY_BYTE_ARRAY;
-        }
-    }
-
-    /**
-     * Deletes the persistent resource backing this <code>BLOBFileValue</code>.
-     * Same as <code>{@link #delete(false)}</code>.
-     * <p/>
-     * If this <code>BLOBFileValue</code> is <i>not</i> backed by
a persistent
-     * resource calling this method will have no effect.
-     *
-     * @see #discard()
-     */
-    private void delete() {
-        if (!temp) {
-            delete(false);
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=570407&r1=570406&r2=570407&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
Tue Aug 28 06:05:52 2007
@@ -129,29 +129,29 @@
                     throw new ValueFormatException(ioe.getMessage());
                 }
             case PropertyType.BOOLEAN:
-                return value.getBoolean() ? BOOLEAN_TRUE : BOOLEAN_FALSE;
+                return create(value.getBoolean());
             case PropertyType.DATE:
-                return new InternalValue(value.getDate());
+                return create(value.getDate());
             case PropertyType.DOUBLE:
-                return new InternalValue(value.getDouble());
+                return create(value.getDouble());
             case PropertyType.LONG:
-                return new InternalValue(value.getLong());
+                return create(value.getLong());
             case PropertyType.REFERENCE:
-                return new InternalValue(new UUID(value.getString()));
+                return create(new UUID(value.getString()));
             case PropertyType.NAME:
                 try {
-                    return new InternalValue(NameFormat.parse(value.getString(), nsResolver));
+                    return create(NameFormat.parse(value.getString(), nsResolver));
                 } catch (NameException e) {
                     throw new ValueFormatException(e.getMessage());
                 }
             case PropertyType.PATH:
                 try {
-                    return new InternalValue(PathFormat.parse(value.getString(), nsResolver));
+                    return create(PathFormat.parse(value.getString(), nsResolver));
                 } catch (MalformedPathException mpe) {
                     throw new ValueFormatException(mpe.getMessage());
                 }
             case PropertyType.STRING:
-                return new InternalValue(value.getString());
+                return create(value.getString());
 
             default:
                 throw new IllegalArgumentException("illegal value");
@@ -424,19 +424,19 @@
             case PropertyType.BOOLEAN:
                 return create(Boolean.valueOf(s).booleanValue());
             case PropertyType.DATE:
-                return new InternalValue(ISO8601.parse(s));
+                return create(ISO8601.parse(s));
             case PropertyType.DOUBLE:
-                return new InternalValue(Double.valueOf(s).doubleValue());
+                return create(Double.valueOf(s).doubleValue());
             case PropertyType.LONG:
-                return new InternalValue(Long.valueOf(s).longValue());
+                return create(Long.valueOf(s).longValue());
             case PropertyType.REFERENCE:
-                return new InternalValue(new UUID(s));
+                return create(new UUID(s));
             case PropertyType.PATH:
-                return new InternalValue(Path.valueOf(s));
+                return create(Path.valueOf(s));
             case PropertyType.NAME:
-                return new InternalValue(QName.valueOf(s));
+                return create(QName.valueOf(s));
             case PropertyType.STRING:
-                return new InternalValue(s);
+                return create(s);
 
             case PropertyType.BINARY:
                 throw new IllegalArgumentException(



Mime
View raw message