1 22 package org.jboss.aspects.versioned; 23 24 import org.jboss.aop.Advisor; 25 import org.jboss.aop.InstanceAdvisor; 26 import org.jboss.aop.joinpoint.Joinpoint; 27 import org.jboss.util.NestedRuntimeException; 28 29 34 public class VersionedConstructorInterceptorFactory implements org.jboss.aop.advice.AspectFactory 35 { 36 private static VersionedConstructorInterceptor instance = null; 37 38 39 public static synchronized VersionedConstructorInterceptor getInstance() 40 { 41 try 42 { 43 if (instance == null) 44 { 45 instance = new VersionedConstructorInterceptor(); 46 } 47 return instance; 48 } 49 catch (Exception ex) 50 { 51 throw new NestedRuntimeException(ex); 52 } 53 } 54 55 public Object createPerVM() 56 { 57 return getInstance(); 58 } 59 60 public Object createPerClass(Advisor advisor) 61 { 62 return getInstance(); 63 } 64 65 public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) 66 { 67 return getInstance(); 68 } 69 70 public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) 71 { 72 return getInstance(); 73 } 74 75 public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) 76 { 77 return getInstance(); 78 } 79 80 public String getName() 81 { 82 return getClass().getName(); 83 } 84 } 85 | Popular Tags |