1
2
3
4
5
6 package net.kwfgrid.gworkflowdl.protocol.calls;
7
8 import net.kwfgrid.gworkflowdl.protocol.structure.*;
9 import net.kwfgrid.gworkflowdl.structure.CapacityException;
10
11 import java.io.IOException;
12
13 import org.xmlpull.v1.XmlSerializer;
14
15 /***
16 Modification that sets the capacity of a place.
17 */
18 public class PlaceSetCapacity extends AbstractMethodCall {
19 protected int _capacity;
20 protected ProtocolPlace _place;
21
22 public PlaceSetCapacity(ProtocolPlace place, int capacity) {
23 super(place.getRoot());
24 _capacity = capacity;
25 _place = place;
26 }
27
28 public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
29 encoder.marshalPlaceSetCapacity(serializer, _place, _capacity);
30 }
31
32 public Object execute() throws CapacityException {
33 _place.__setCapacity(_capacity);
34 setExecuted();
35 return null;
36 }
37 }