예제 #1
0
파일: Job.java 프로젝트: mwsobol/iGrid
 public Object putJobValue(String path, Object value) throws ContextException {
   String[] attributes = SorcerUtil.pathToArray(path);
   // remove the leading attribute of the current exertion
   if (attributes[0].equals(getName())) {
     String[] attributes1 = new String[attributes.length - 1];
     System.arraycopy(attributes, 1, attributes1, 0, attributes.length - 1);
     attributes = attributes1;
   }
   String last = attributes[0];
   Exertion exti = this;
   for (String attribute : attributes) {
     if (((ServiceExertion) exti).hasChild(attribute)) {
       exti = ((Job) exti).getChild(attribute);
       if (exti instanceof Task) {
         last = attribute;
         break;
       }
     } else {
       break;
     }
   }
   int index = path.indexOf(last);
   String contextPath = path.substring(index + last.length() + 1);
   exti.getContext().putValue(contextPath, value);
   return value;
 }
예제 #2
0
파일: Job.java 프로젝트: mwsobol/iGrid
 public Exertion getComponentExertion(String path) {
   String[] attributes = SorcerUtil.pathToArray(path);
   // remove the leading attribute of the current exertion
   if (attributes[0].equals(getName())) {
     String[] attributes1 = new String[attributes.length - 1];
     System.arraycopy(attributes, 1, attributes1, 0, attributes.length - 1);
     attributes = attributes1;
   }
   Exertion exti = this;
   for (String attribute : attributes) {
     if (((ServiceExertion) exti).hasChild(attribute)) {
       exti = ((CompoundExertion) exti).getChild(attribute);
       if (exti instanceof Task) {
         break;
       }
     } else {
       break;
     }
   }
   return exti;
 }