1 29 30 package hero.performerAssign; 31 32 import hero.interfaces.BnNodeLocal; 33 import hero.util.HeroException; 34 35 import java.lang.reflect.InvocationTargetException ; 36 import java.lang.reflect.Method ; 37 38 import org.apache.log4j.Category; 39 40 public class PropertyPerformerAssign extends PerformerAssign { 41 42 private static final Category log = Category.getInstance(PropertyPerformerAssign.class); 44 45 46 public PropertyPerformerAssign(String name, int type) { 47 super(name,type); 48 } 49 50 public void execute(Object bean, int type, BnNodeLocal node, String userName) throws HeroException { 51 log.debug("execute: type="+type+" node="+node.getName()); 52 53 try { 54 Class clperformerAssign=Class.forName("hero.performerAssign.PropertySelectActors"); 55 NodePerformerAssignI ndh =(NodePerformerAssignI)clperformerAssign.newInstance(); 56 Class [] param={ 57 Class.forName("java.lang.Object"), 58 Class.forName("hero.interfaces.BnNodeLocal"), 59 Class.forName("java.lang.String")}; 60 Method evth=clperformerAssign.getMethod("selectActors",param); 61 Object [] o={bean,node,userName}; 62 evth.invoke(ndh,o); 63 } catch (InvocationTargetException ite) { 64 ite.printStackTrace(); 65 throw new HeroException("Failure during performerAssign execution : " + ite.getMessage()); 66 } catch (Exception e) { 67 throw new HeroException("Dynamic invocation of performerAssign failed :"+this.getName()+" Node:"+node.getName()+"--> performerAssign type = "+type+" ///"+e); 68 } 69 } 70 71 72 } 73 | Popular Tags |