View Javadoc

1   /*
2    * Copyright (c) 2005, The K-Wf Grid Consortium
3    * Fraunhofer Institute for Computer Architecture and Software Technology
4    * See http://www.kwfgrid.eu and http://www.first.fraunhofer.de for more details.
5    */
6   package net.kwfgrid.gworkflowdl.protocol.calls;
7   
8   import net.kwfgrid.gworkflowdl.protocol.*;
9   import net.kwfgrid.gworkflowdl.protocol.structure.*;
10  
11  import java.io.IOException;
12  
13  import org.xmlpull.v1.XmlSerializer;
14  
15  /***
16     Modification that sets a key of a property.
17   */
18  public class PropertySetValue extends AbstractMethodCall {
19      protected ProtocolProperty _property;
20      protected String _newvalue;
21  
22      public PropertySetValue(ProtocolProperty property, String newvalue) {
23  	super(property.getRoot());
24  	_property = property;
25  	_newvalue = newvalue;
26      }
27      
28      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
29  	encoder.marshalPropertySetValue(serializer, _property, _newvalue);
30      }
31  
32      public Object execute() {
33  	_property.__setValue(_newvalue);
34  	setExecuted();
35  	return null;
36      }
37  }