1 22 package org.jboss.aop.microcontainer.beans; 23 24 import java.util.List ; 25 26 import org.jboss.aop.AspectManager; 27 import org.jboss.aop.introduction.InterfaceIntroduction; 28 import org.jboss.util.id.GUID; 29 30 36 public class IntroductionBinding 37 { 38 protected AspectManager manager; 39 40 protected String name = GUID.asString(); 41 42 protected String classes; 43 44 protected List <String > interfaces; 45 46 public String getName() 47 { 48 return name; 49 } 50 51 public void setName(String name) 52 { 53 this.name = name; 54 } 55 56 61 public String getClasses() 62 { 63 return classes; 64 } 65 66 71 public void setClasses(String classes) 72 { 73 this.classes = classes; 74 } 75 76 81 public List getInterfaces() 82 { 83 return interfaces; 84 } 85 86 91 public void setInterfaces(List <String > interfaces) 92 { 93 this.interfaces = interfaces; 94 } 95 96 101 public AspectManager getManager() 102 { 103 return manager; 104 } 105 106 111 public void setManager(AspectManager manager) 112 { 113 this.manager = manager; 114 } 115 116 public void start() throws Exception 117 { 118 if (manager == null) 119 throw new IllegalArgumentException ("Null manager"); 120 if (classes == null) 121 throw new IllegalArgumentException ("Null classes"); 122 if (interfaces == null) 123 throw new IllegalArgumentException ("Null interfaces"); 124 String [] intfs = interfaces.toArray(new String [interfaces.size()]); 125 InterfaceIntroduction introduction = new InterfaceIntroduction(name, classes, intfs); 126 manager.addInterfaceIntroduction(introduction); 127 } 128 129 public void stop() throws Exception 130 { 131 manager.removeInterfaceIntroduction(name); 132 } 133 } 134 | Popular Tags |