You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/02/10 16:17:55 UTC

svn commit: r1242814 - in /incubator/airavata/trunk/modules: commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java

Author: samindaw
Date: Fri Feb 10 15:17:55 2012
New Revision: 1242814

URL: http://svn.apache.org/viewvc?rev=1242814&view=rev
Log:
nodeproperty change cache not cleared issue fix

Modified:
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java

Modified: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java?rev=1242814&r1=1242813&r2=1242814&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java Fri Feb 10 15:17:55 2012
@@ -98,6 +98,7 @@ public class JCRRegistry extends Observa
 				public void onEvent(EventIterator events) {
 					for(;events.hasNext();){
 						Event event=events.nextEvent();
+						boolean isPropertyChange = (event.getType()&(Event.PROPERTY_CHANGED|Event.PROPERTY_ADDED|Event.PROPERTY_REMOVED))>0;
 						try {
 							String path = event.getPath();
 							synchronized (sessionSynchronousObject) {
@@ -110,10 +111,14 @@ public class JCRRegistry extends Observa
 											nodesToRemove.add(node);
 										}
 									} else {
-										if (node.getSession().isLive() && (node.getPath().startsWith(path)
-												|| path.startsWith(node
-														.getPath()))) {
-											nodesToRemove.add(node);
+										if (node.getSession().isLive()) {
+											if (isPropertyChange){
+												if (node.getPath().equals(path)) {
+													nodesToRemove.add(node);
+												}
+											}else if (node.getPath().startsWith(path) || path.startsWith(node.getPath())) {
+												nodesToRemove.add(node);
+											}
 										}
 									}
 								}
@@ -123,9 +128,14 @@ public class JCRRegistry extends Observa
 								nodeIterator = getSessionNodeChildren().keySet();
 								nodesToRemove.clear();
 								for (Node node : nodeIterator) {
-									if (node.getSession().isLive() && (node.getPath().startsWith(path)
-											|| path.startsWith(node.getPath()))) {
-										nodesToRemove.add(node);
+									if (node.getSession().isLive()) {
+										if (isPropertyChange){
+											if (node.getPath().equals(path)) {
+												nodesToRemove.add(node);
+											}
+										}else if (node.getPath().startsWith(path) || path.startsWith(node.getPath())) {
+											nodesToRemove.add(node);
+										}
 									}
 								}
 								for(Node node:nodesToRemove){
@@ -242,7 +252,7 @@ public class JCRRegistry extends Observa
 							.addEventListener(
 									getWorkspaceChangeEventListener(),
 									Event.NODE_ADDED | Event.NODE_REMOVED
-											| Event.NODE_MOVED, "/", true,
+											| Event.NODE_MOVED | Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED, "/", true,
 									null, null, false);
 					currentSessionUseCount.put(session, 1);
 				}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java?rev=1242814&r1=1242813&r2=1242814&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java Fri Feb 10 15:17:55 2012
@@ -359,8 +359,8 @@ public class ServiceDescriptionDialog ex
     	Boolean selected = false;
     	if (descType.getPortType()!=null && descType.getPortType().getMethod()!=null) {
 			XmlCursor cursor = descType.getPortType().getMethod().newCursor();
-			cursor.toNextToken();
-			String value = cursor.getAttributeText(new QName("id"));
+//			cursor.toNextToken();
+			String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
 			cursor.dispose();
 			selected = false;
 			if (value != null) {