1 5 package org.exoplatform.container.groovy; 6 7 import java.util.List ; 8 13 public class GroovyManagerListener { 14 15 public void load(GroovyObject gobject) throws Exception { 16 gobject.setObject(gobject.getType().newInstance()) ; 17 } 18 19 public void reload(GroovyObject gobject) throws Exception { 20 gobject.setObject(gobject.getType().newInstance()) ; 21 } 22 23 24 public void unload(GroovyObject gobject) throws Exception { 25 gobject.setObject(null) ; 26 } 27 28 static public void load(List listeners, GroovyObject object) throws Exception { 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 listeners, GroovyObject object) throws Exception { 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 listeners, GroovyObject object) throws Exception { 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 |