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.OperationCandidate;
11  
12  import java.io.IOException;
13  
14  import org.xmlpull.v1.XmlSerializer;
15  
16  /***
17     Modification that sets the operationName of a operationCandidate
18   */
19  public class OperationCandidateSetType extends AbstractMethodCall {
20      protected ProtocolOperationCandidate _oc;
21      protected String _type;
22  
23      public OperationCandidateSetType(ProtocolOperationCandidate oc, String type) {
24  	super(oc.getRoot());
25  	_oc = oc;
26  	_type = type;
27      }
28  
29      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
30  	encoder.marshalOperationCandidateSetType(serializer, _oc, _type);
31      }
32  
33      public Object execute() {
34  	_oc.__setType(_type);
35  	setExecuted();
36  	return null;
37      }
38  }