1 22 package org.jboss.aop.advice; 23 24 31 public class AspectDefinition 32 { 33 protected String name; 34 protected Scope scope = Scope.PER_VM; 35 protected AspectFactory factory; 36 protected boolean deployed = true; 37 38 43 public AspectDefinition(String name, Scope scope, AspectFactory factory) 44 { 45 46 this.name = name; 47 this.scope = scope; 48 this.factory = factory; 49 if (this.scope == null) this.scope = Scope.PER_VM; 50 if (this.name == null) this.name = this.factory.getName(); 51 } 52 53 public AspectDefinition() {} 54 55 public void undeploy() 56 { 57 this.deployed = false; 58 } 59 60 public boolean isDeployed() 61 { 62 return deployed; 63 } 64 65 public void setName(String name) 66 { 67 this.name = name; 68 } 69 70 public void setScope(Scope scope) 71 { 72 this.scope = scope; 73 } 74 75 public void setFactory(AspectFactory factory) 76 { 77 this.factory = factory; 78 } 79 80 public AspectFactory getFactory() 81 { 82 return factory; 83 } 84 85 public String getName() 86 { 87 return name; 88 } 89 90 public Scope getScope() 91 { 92 return scope; 93 } 94 95 public int hashCode() 96 { 97 return name.hashCode(); 98 } 99 100 public boolean equals(Object obj) 101 { 102 if (obj == this) return true; 103 if (!(obj instanceof AspectDefinition)) return false; 104 return name.equals(((AspectDefinition) obj).name); 105 } 106 } 107 | Popular Tags |