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.structure.*;
9   
10  import java.io.IOException;
11  
12  import org.xmlpull.v1.XmlSerializer;
13  
14  /***
15     Modification that removes all tokens from a Place.
16   */
17  public class PlaceRemoveAllTokens extends AbstractMethodCall {
18      protected ProtocolPlace _place;
19  
20      public PlaceRemoveAllTokens(ProtocolPlace place) {
21  	super(place.getRoot());
22  	_place = place;
23      }
24      
25      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
26  	encoder.marshalPlaceRemoveAllTokens(serializer, _place);
27      }
28  
29      public Object execute() {
30  	_place.__removeAllTokens();
31  	setExecuted();
32  	return null;
33      }
34  }