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 removes a property.
17   */
18  public class GenericPropertiesRemoveProperty extends AbstractMethodCall {
19      protected ProtocolProperties _properties;
20      protected String _key;
21      protected int _i;
22  
23      public GenericPropertiesRemoveProperty(ProtocolProperties properties, int i) {
24  	super(properties.getRoot());
25  	_properties = properties;
26  	_key = properties.getProperty(i).getKey();
27  	_i = i;
28      }
29      
30      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException, IndexOutOfBoundsException {
31  	encoder.marshalGenericPropertiesRemove(serializer, _properties, _key);
32      }
33  
34      public Object execute() {
35  	_properties.__removeProperty(_i);
36  	setExecuted();
37  	return null;
38      }
39  }