1 8 package org.codehaus.aspectwerkz.transform.aopalliance; 9 10 import org.codehaus.aspectwerkz.aspect.AbstractAspectContainer; 11 import org.codehaus.aspectwerkz.AspectContext; 12 import org.codehaus.aspectwerkz.util.ContextClassLoader; 13 14 20 public class AopAllianceAspectContainer extends AbstractAspectContainer { 21 22 27 public AopAllianceAspectContainer(final AspectContext ctx) { 28 super(ctx); 29 } 30 31 36 protected Object createAspect() { 37 final String className = m_aspectContext.getAspectDefinition().getClassName(); 38 try { 39 return ContextClassLoader.forName(className).newInstance(); 40 } catch (ClassNotFoundException e) { 41 throw new RuntimeException ("could not load AOP Alliance interceptor [" + className + "]: " + e.toString()); 42 } catch (Exception e) { 43 throw new RuntimeException ("could not instantiate AOP Alliance interceptor [" + className + "]: " + e.toString()); 44 } 45 46 } 47 } 48 | Popular Tags |