ozeigermann 2004/09/23 00:26:52
Modified: src/share/org/apache/slide/structure Tag:
SLIDE_2_1_RELEASE_BRANCH ObjectNode.java
Log:
Took over core part (not store implementation) of
enhancement #30442 from HEAD branch into release
Revision Changes Path
No revision
No revision
1.27.2.1 +28 -4
jakarta-slide/src/share/org/apache/slide/structure/ObjectNode.java
Index: ObjectNode.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/ObjectNode.java,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -u -r1.27 -r1.27.2.1
--- ObjectNode.java 5 Aug 2004 15:44:58 -0000 1.27
+++ ObjectNode.java 23 Sep 2004 07:26:52 -0000 1.27.2.1
@@ -26,6 +26,8 @@
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Vector;
+import java.util.Set;
+import java.util.HashSet;
import org.apache.slide.common.ObjectValidationFailedException;
import org.apache.slide.common.UriPath;
import org.apache.slide.util.Messages;
@@ -40,6 +42,12 @@
public abstract class ObjectNode
implements Serializable, Cloneable {
+
+ /**
+ * For tracking which bindings need to be updated.
+ */
+ private Set updatedBindings = null;
+
/**
* Uniform ressource identifier (URI) of the object.
*/
@@ -95,6 +103,7 @@
this.links = new Vector();
this.bindings = new BindingList();
this.parentBindings = new ParentBindingList();
+ this.updatedBindings = new HashSet();
}
/**
@@ -125,6 +134,10 @@
this.bindings = new BindingList(bindings);
this.parentBindings = new ParentBindingList(parentBindings);
this.links = links;
+ Enumeration e = bindings.elements();
+ while(e.hasMoreElements()) {
+
updatedBindings.add(((ObjectNode.Binding)e.nextElement()).getUuri());
+ }
}
/**
@@ -173,6 +186,15 @@
this.uuri = uuri;
}
+
+ public Set getUpdatedBindings() {
+ return updatedBindings;
+ }
+
+ public void resetUpdatedBindings() {
+ updatedBindings.clear();
+ }
+
/**
* Return this object's children
*
@@ -459,6 +481,7 @@
* @param source the child ObjectNode
*/
public void addBinding( String bindingName, ObjectNode source ) {
+ updatedBindings.add(source.getUri());
if (!hasBinding(bindingName)) {
if(bindingsShared) {
// Lazy cloning on first write access
@@ -482,6 +505,7 @@
* @param child The child to remove
*/
public void removeChild(ObjectNode child) {
+ updatedBindings.add(child.getUri());
if (child == null) {
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]