KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > core > tree > ChangeLog


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.core.tree;
10
11 import org.jboss.portal.common.FQN;
12 import org.jboss.portal.common.tree.NodeChangeListener;
13
14 import java.util.List JavaDoc;
15 import java.util.ArrayList JavaDoc;
16
17 /**
18  * Keep track of changes in the model. Each time it receives an event it notify all the thread waiting on the monitor
19  * of this object.
20  *
21  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
22  * @version $Revision: 1.1 $
23  */

24 public class ChangeLog implements NodeChangeListener
25 {
26
27    private final List JavaDoc changes = new ArrayList JavaDoc();
28
29    public List JavaDoc getChanges()
30    {
31       return changes;
32    }
33
34    public synchronized void propertyAdded(FQN nodeID, String JavaDoc name)
35    {
36       changes.add(Change.createPropertyAdded(nodeID, name));
37       notifyAll();
38    }
39
40    public synchronized void propertyChanged(FQN nodeID, String JavaDoc name)
41    {
42       changes.add(Change.createPropertyChanged(nodeID, name));
43       notifyAll();
44    }
45
46    public synchronized void propertyRemoved(FQN nodeID, String JavaDoc name)
47    {
48       changes.add(Change.createPropertyRemoved(nodeID, name));
49       notifyAll();
50    }
51
52    public synchronized void childAdded(FQN parentID, String JavaDoc name)
53    {
54       changes.add(Change.createChildAdded(parentID, name));
55       notifyAll();
56    }
57
58    public synchronized void childRemoved(FQN parentID, String JavaDoc name)
59    {
60       changes.add(Change.createChildRemoved(parentID, name));
61       notifyAll();
62    }
63 }
64
Popular Tags