|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vbs.spring.versioning.VersioningAspect
public final class VersioningAspect
Intercepts any method calls on beans whose target class is annotated by
VersionedClass, delegating the call to the correct versioned
implementation where appropriate.
The call is only delegated if the active version in the current thread
(obtained via VersionHolder.getActiveVersion()) is not null and
an version dependent bean is available for the active version.
A version dependent bean is any bean whose target class is annotated by
VersionDependentClass. The injected
VersionDependentBeanResolver returns the version dependent bean
if available.
If no version dependent bean is found, or if the method does not exist on the version dependent bean, the method on the intercepted bean is invoked.
Note that by default, a version dependent bean must exist for each target
class defined for the intercepted bean and all methods on the inercepted bean
must be present on each verion dependent bean. If this bean's target class is
annotated as @lenient then not all version dependent beans may
be present.
Addtionally, if a given version dependent bean is annotated as not
@fullyImplemented , then not all methods may be present on that
bean.
Only one instance of this bean should be configured within the spring container.
| Constructor Summary | |
|---|---|
VersioningAspect()
Default constructor. |
|
| Method Summary | |
|---|---|
java.lang.Object |
executeWithVersion(org.aspectj.lang.ProceedingJoinPoint joinPoint)
Processes intercepted bean method calls. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
Attaches any beans registered as version dependent to the correct versioned bean. |
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
Registers any relevant beans whose type is annotated by VersionedClass or VersionDependentClass. |
java.lang.Object |
postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
Performs no action. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VersioningAspect()
| Method Detail |
|---|
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
VersionedClass or VersionDependentClass.
Protoype beans (and hence inner beans) are not registered.
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansException
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener
public java.lang.Object executeWithVersion(org.aspectj.lang.ProceedingJoinPoint joinPoint)
throws java.lang.Throwable
The call is only delegated if the active version in the current thread
(obtained via VersionHolder.getActiveVersion()) is not null
and an version dependent bean is available for the active version.
joinPoint - defined the method to be called on the intercepted bean.
java.lang.Throwable - any exception thrown from within the intercepted method call.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||