KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > container > groovy > GroovyManagerListener


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.container.groovy;
6
7 import java.util.List JavaDoc ;
8 /**
9  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
10  * @since Nov 9, 2004
11  * @version $Id$
12  */

13 public class GroovyManagerListener {
14   
15   public void load(GroovyObject gobject) throws Exception JavaDoc {
16     gobject.setObject(gobject.getType().newInstance()) ;
17   }
18   
19   public void reload(GroovyObject gobject) throws Exception JavaDoc {
20     gobject.setObject(gobject.getType().newInstance()) ;
21   }
22   
23   
24   public void unload(GroovyObject gobject) throws Exception JavaDoc {
25     gobject.setObject(null) ;
26   }
27   
28   static public void load(List JavaDoc listeners, GroovyObject object) throws Exception JavaDoc {
29     for(int i = 0; i < listeners.size(); i++) {
30       GroovyManagerListener listener = (GroovyManagerListener) listeners.get(i) ;
31       listener.load(object) ;
32     }
33   }
34   
35   static public void reload(List JavaDoc listeners, GroovyObject object) throws Exception JavaDoc {
36     for(int i = 0; i < listeners.size(); i++) {
37       GroovyManagerListener listener = (GroovyManagerListener) listeners.get(i) ;
38       listener.reload(object) ;
39     }
40   }
41   
42   static public void unload(List JavaDoc listeners, GroovyObject object) throws Exception JavaDoc {
43     for(int i = 0; i < listeners.size(); i++) {
44       GroovyManagerListener listener = (GroovyManagerListener) listeners.get(i) ;
45       listener.unload(object) ;
46     }
47   }
48 }
Popular Tags