public class GenericAspectFactory extends AspectFactoryWithClassLoaderSupport
| Constructor and Description |
|---|
GenericAspectFactory(String classname,
Element element) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureInstance(Object instance,
Advisor advisor,
InstanceAdvisor instanceAdvisor,
Joinpoint jp) |
Object |
createPerClass(Advisor advisor)
Creates an aspect with scope value
Scope.PER_CLASS. |
Object |
createPerInstance(Advisor advisor,
InstanceAdvisor instanceAdvisor)
Creates an aspect with scope value
Scope.PER_INSTANCE. |
Object |
createPerJoinpoint(Advisor advisor,
InstanceAdvisor instanceAdvisor,
Joinpoint jp)
Creates an aspect with scope value or
Scope.PER_JOINPOINT. |
Object |
createPerJoinpoint(Advisor advisor,
Joinpoint jp)
Creates an aspect with scope value
Scope.PER_CLASS_JOINPOINT or
Scope.PER_JOINPOINT. |
Object |
createPerVM()
Creates an aspect with scope value
Scope.PER_VM. |
String |
getClassname() |
Class<?> |
getClazz()
Deprecated.
|
Element |
getElement() |
protected String |
getInjectorName(String attributeName) |
String |
getName()
The name that identifies the aspect in its domain.
|
protected void |
injectAdvisor(Object instance,
Advisor advisor,
String attributeName) |
protected void |
injectInstanceAdvisor(Object instance,
InstanceAdvisor instanceAdvisor,
String attributeName) |
protected void |
injectJoinpoint(Object instance,
Joinpoint jp,
String attributeName) |
protected void |
setAttribute(Object instance,
PropertyDescriptor[] descriptors,
String attributeName,
String attributeText) |
void |
setClassname(String classname) |
void |
setElement(Element element) |
getLoader, loadClass, peekScopedClassLoader, popScopedClassLoader, pushScopedClassLoader, setClassLoaderpublic String getClassname()
public void setClassname(String classname)
public String getName()
AspectFactoryDomainpublic Element getElement()
public void setElement(Element element)
@Deprecated public Class<?> getClazz()
public Object createPerVM()
AspectFactoryScope.PER_VM.null, the aspect
represented by this factory is ignored, resulting in no interception.public Object createPerClass(Advisor advisor)
AspectFactoryScope.PER_CLASS.advisor - manages all the interceptions that should occur during execution
of a specific classadvisor. If
null, the aspect represented by this factory is ignored,
resulting in no interception of the joinpoints contained in the
referred class.Advisor.getClazz()public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
AspectFactoryScope.PER_INSTANCE.advisor - manages all the interceptions that should occur during
execution of a specific classinstanceAdvisor - manages all the interceptions that should occur during
execution of a specific instance. The instance it
manages is an object of the class managed by
advisorinstanceAdvisor. If null, the aspect
represented by this factory is ignored, resulting in no
interception of the joinpoints contained in the referred
instance.Advisor.getClazz(),
InstanceAdvisor.getInstance()public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
AspectFactoryScope.PER_CLASS_JOINPOINT or
Scope.PER_JOINPOINT.
PER_CLASS_JOINPOINT, this method will always
be invoked to create the aspect instance. On the other hand, if the scope value
is PER_JOINPOINT, this method is called only if the joinpoint
to be intercepted is in a static context (like a static method, a static field
access, or a constructor execution).advisor - manages all the interceptions that should occur during
execution of a specific classjp - the joinpoint to be intercepted by the created instance.
This joinpoint is contained in the class managed by
advisorjp. If null, the aspect represented by this
factory is ignored, resulting in no interception of jp.Advisor.getClazz(),
Joinpointpublic Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
AspectFactoryScope.PER_JOINPOINT.
advisor - manages all the interceptions that should occur
during execution of a specific classinstanceAdvisor - manages all the interceptions that should occur during
execution of a specific instance. The instance it
manages is an object of the class managed by
advisorjp - the joinpoint to be intercepted by the created instance.
This joinpoint is contained in the class managed by
advisorjp when it happens on the instance
managed by instanceAdvisor. If null, the
aspect represented by this factory is ignored, resulting
in no interception of jp when it is executed in
the context of the referred instance.Advisor.getClazz(),
InstanceAdvisor.getInstance(),
Joinpointprotected void configureInstance(Object instance, Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
protected void setAttribute(Object instance, PropertyDescriptor[] descriptors, String attributeName, String attributeText)
protected void injectInstanceAdvisor(Object instance, InstanceAdvisor instanceAdvisor, String attributeName)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.