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  import net.kwfgrid.gworkflowdl.structure.WorkflowFormatException;
11  
12  import java.io.IOException;
13  
14  import org.xmlpull.v1.XmlSerializer;
15  
16  /***
17     Modification that sets the content of a token.
18   */
19  public class DataSet extends AbstractMethodCall {
20      protected Object _content;
21      protected ProtocolData _data;
22      
23      public DataSet(ProtocolData data, Object content) {
24  	super(data.getRoot());
25  	_data = data;
26  	_content = content;
27      }
28      
29      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
30  	encoder.marshalDataSet(serializer, _data, _content);
31      }
32  
33      public Object execute() throws WorkflowFormatException {
34  	_data.__set(_content);
35  	setExecuted();
36  	return null;
37      }
38  }