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.structure;
7   
8   import net.kwfgrid.gworkflowdl.protocol.IMethodCallStrategy;
9   
10  /***
11     Abstract implementation of <code>IStructureObject</code>.
12   */
13  public abstract class AbstractStructureObject implements IStructureObject {
14      private Object _structurelock;
15  
16      public AbstractStructureObject() {
17  	_structurelock = new Object();
18      }
19  
20      /***
21         Fire an OBJECTS_ADDED event to the array of listeners.
22         @param namespace The namespace of the added object
23         @param name The name of the added object.
24         @param added The added object.
25       */
26      protected final void fireObjectAdded(String namespace, String name, Object added) {
27  	((AbstractRootObject)getRoot()).fireObjectAdded(this, namespace, name, added);
28      }
29  
30      /***
31         Fire an OBJECTS_ADDED event to the array of listeners.
32         @param namespace The namespace of the added objects.
33         @param name The name of the added objects.
34         @param added The added objects.
35       */
36      protected final void fireObjectsAdded(String namespace, String name, Object[] added) {
37  	((AbstractRootObject)getRoot()).fireObjectsAdded(this, namespace, name, added);
38      }
39  
40      /***
41         Fire an OBJECTS_REMOVED event to the array of listeners.
42         @param namespace The namespace of the removed object
43         @param name The name of the removed object.
44         @param removed The removed object.
45       */
46      protected void fireObjectRemoved(String namespace, String name, Object removed) {
47  	((AbstractRootObject)getRoot()).fireObjectRemoved(this, namespace, name, removed);
48      }
49  
50      /***
51         Fire an OBJECTS_REMOVED event to the array of listeners.
52         @param namespace The namespace of the removed object
53         @param name The name of the removed object.
54         @param removed The removed object.
55       */
56      protected void fireObjectsRemoved(String namespace, String name, Object[] removed) {
57  	((AbstractRootObject)getRoot()).fireObjectsRemoved(this, namespace, name, removed);
58      }
59  
60      /***
61         Fire a PROPERTY_CHANGED event to the array of listeners.
62         @param namespace The namespace of the changed property.
63         @param name The name of the changed property.
64         @param newvalule The new value of the property.
65       */
66      protected void firePropertyChanged(String namespace, String name, Object newvalue) {
67  	((AbstractRootObject)getRoot()).firePropertyChanged(this, namespace, name, newvalue);
68      }
69  
70      public abstract IRootObject getRoot();
71  
72      public abstract IMethodCallStrategy getMethodCallStrategy();
73  
74      public Object getStructureLock() {
75  	return _structurelock;
76      }
77  }