1 29 30 package hero.performerAssign; 31 32 import hero.interfaces.BnNodeLocal; 33 import hero.util.HeroException; 34 import java.io.Serializable ; 35 36 public abstract class PerformerAssign implements Serializable { 37 38 39 public static final int CALLBACK=0; 40 public static final int PROPERTY=1; 41 42 private String name; 43 private int type; 44 45 public static PerformerAssign make(String name, int type) throws HeroException { 46 if (type==CALLBACK) return new CallbackPerformerAssign(name,type); 47 if (type==PROPERTY) return new PropertyPerformerAssign(name,type); 48 throw new HeroException("Wrong PerformerAssign Type " + type); 49 } 50 51 protected PerformerAssign(String name, int type) { 52 this.name=name; 53 this.type=type; 54 } 55 56 public String getName() {return this.name;} 57 public void setName(String name) {this.name=name;} 58 59 public int getType() {return this.type;} 60 public void setType(int type) {this.type=type;} 61 62 public String toXML() { 63 String result=new String (); 64 result="<performerAssign name=\""+this.getName()+ 65 "\" type=\""+this.getType()+"\"/>"; 66 return result; 67 } 68 69 public abstract void execute(Object bean, int type, BnNodeLocal role, String userName) throws HeroException; 70 71 } 72 | Popular Tags |