public class SimpleAspectInstanceFactory extends Object implements AspectInstanceFactory
AspectInstanceFactory that creates a new instance
of the specified aspect class for every getAspectInstance() call.HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
SimpleAspectInstanceFactory(Class aspectClass)
Create a new SimpleAspectInstanceFactory for the given aspect class.
|
| Modifier and Type | Method and Description |
|---|---|
Class |
getAspectClass()
Return the specified aspect class (never
null). |
ClassLoader |
getAspectClassLoader()
Expose the aspect class loader that this factory uses.
|
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(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(Class aspectClass)
aspectClass - the aspect classpublic final Class getAspectClass()
null).public final Object getAspectInstance()
AspectInstanceFactorygetAspectInstance in interface AspectInstanceFactorynull)public ClassLoader getAspectClassLoader()
AspectInstanceFactorygetAspectClassLoader in interface AspectInstanceFactorynull)public int getOrder()
Ordered interface,
or a fallback order.getOrder in interface OrderedOrdered,
getOrderForAspectClass(java.lang.Class<?>)protected int getOrderForAspectClass(Class<?> aspectClass)
Ordered interface.
The default implementation simply returns Ordered.LOWEST_PRECEDENCE.
aspectClass - the aspect class