public class SimpleAspectInstanceFactory extends java.lang.Object implements AspectInstanceFactory
AspectInstanceFactory
that creates a new instance
of the specified aspect class for every getAspectInstance()
call.Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
aspectClass |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
SimpleAspectInstanceFactory(java.lang.Class<?> aspectClass)
Create a new SimpleAspectInstanceFactory for the given aspect class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
getAspectClass()
Return the specified aspect class (never
null ). |
java.lang.ClassLoader |
getAspectClassLoader()
Expose the aspect class loader that this factory uses.
|
java.lang.Object |
getAspectInstance()
Create an instance of this factory's aspect.
|
int |
getOrder()
Determine the order for this factory's aspect instance,
either an instance-specific order expressed through implementing
the
Ordered interface,
or a fallback order. |
protected int |
getOrderForAspectClass(java.lang.Class<?> aspectClass)
Determine a fallback order for the case that the aspect instance
does not express an instance-specific order through implementing
the
Ordered interface. |
public SimpleAspectInstanceFactory(java.lang.Class<?> aspectClass)
aspectClass
- the aspect classpublic final java.lang.Class<?> getAspectClass()
null
).public final java.lang.Object getAspectInstance()
AspectInstanceFactory
getAspectInstance
in interface AspectInstanceFactory
null
)public java.lang.ClassLoader getAspectClassLoader()
AspectInstanceFactory
getAspectClassLoader
in interface AspectInstanceFactory
null
)public int getOrder()
Ordered
interface,
or a fallback order.getOrder
in interface Ordered
Ordered
,
getOrderForAspectClass(java.lang.Class<?>)
protected int getOrderForAspectClass(java.lang.Class<?> aspectClass)
Ordered
interface.
The default implementation simply returns Ordered.LOWEST_PRECEDENCE
.
aspectClass
- the aspect class