Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2745 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages

Subject: perfsonar development work

List archive

perfsonar: r2745 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2745 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages
  • Date: Wed, 29 Aug 2007 09:40:15 -0400

Author: mac
Date: 2007-08-29 09:40:14 -0400 (Wed, 29 Aug 2007)
New Revision: 2745

Modified:

branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
Log:
bug fix
eliminates problem of service crash if metadata refers to itself
(metadataIdRef==id)


Modified:
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
===================================================================
---
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
2007-08-29 13:38:57 UTC (rev 2744)
+++
branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages/Request.java
2007-08-29 13:40:14 UTC (rev 2745)
@@ -5,25 +5,21 @@

package org.perfsonar.service.base.messages;

-import java.util.Map;
-import java.util.HashMap;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;

+import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Message;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
-import org.ggf.ns.nmwg.base.v2_0.Data;
-
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
-
import org.perfsonar.base.exceptions.PerfSONARException;
-
+import org.perfsonar.service.base.engine.ServiceEngine;
import org.perfsonar.service.base.engine.ServiceEngineFactory;
-import org.perfsonar.service.base.engine.ServiceEngine;
-
import org.perfsonar.service.base.util.ResultCodesUtil;


@@ -310,7 +306,7 @@
/**
* Find metadata chain for metadata ID (the last metadata in chain)
*
- * @param inputMessage message to process (won't be chaged)
+ * @param inputMessage message to process (won't be changed)
* @param lastMetadataId id of metadata which is last in chain
* @return map <id,metadata>
* @throws NoSuchMetadataException thrown if there is no metadata with
given ID
@@ -327,8 +323,12 @@

metadatas.put(metadata.getId(), metadata);

+ //metadataIdRef in Subject
+ //prevent endless loop
if (metadata.getSubject() != null) {
- if (!("".equals(metadata.getSubject().getMetadataIdRef()))) {
+ if (!("".equals(metadata.getSubject().getMetadataIdRef()))&&
+
!(metadata.getId().equals(metadata.getSubject().getMetadataIdRef()))) {
+
getChaining(
inputMessage,

metadata.getSubject().getMetadataIdRef(),
@@ -338,7 +338,9 @@

String chainedMetadataId = metadata.getMetadataIdRef();

- if (!("".equals(chainedMetadataId))) {
+ //get other chain, prevent endless loop
+ if (!("".equals(chainedMetadataId))&&
+ !(metadata.getId().equals(chainedMetadataId))) {
getChaining(inputMessage, chainedMetadataId, metadatas);
}




  • perfsonar: r2745 - branches/new-structure/trunk/perfsonar_base/src/main/java/org/perfsonar/service/base/messages, svnlog, 08/29/2007

Archive powered by MHonArc 2.6.16.

Top of Page