|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vbs.spring.versioning.VersionDependentBeanResolver
public final class VersionDependentBeanResolver
Resolves a VersionedBean instance to it's
VersionDependentBean delegate if registered.
Any beans the are either versioned (annotated by the
VersionedClass class) or version dependent (annotated by the
VersionDependentClass class) other than prototype beans are
registered.
An IllegalStateException is thrown if the annotations associated
with the bean are invalid. This will be the case if:
VersionedClass and
VersionDependentClass.VersionedClass annotation contains no version dependent
classes (0 length array).VersionDependentClass annotation contains no versions (0
length array).VersionHolder.
Once the application context is fully loaded, the registered beans are
validated and VersionDependentBean attached to their associated
VersionedBean instance.
Protoype beans (and hence inner beans) are not supported by versioning. If
such a VersionedBean instance is found, an INFO log will be
written and the bean will be ignored for versioning purposes.
A given version can only be implemented by one dependent bean attached to a
given VersionedBean. An IllegalStateException will
be thrown if multiple dependent beans implement the same version.
| Constructor Summary | |
|---|---|
VersionDependentBeanResolver()
|
|
| Method Summary | |
|---|---|
(package private) void |
checkForVersioningAwareBean(java.lang.Object bean,
java.lang.String beanName)
Registers each bean that is annotated by VersionedClass or
VersionDependentClass. |
(package private) java.lang.Object |
getVersionDependentBean(java.lang.Object bean,
java.lang.Class<?> versionedClass,
java.lang.String activeVersion)
Returns the version dependent instance for the intercepted bean, or null if no such bean was found. |
void |
onContextRefresh(org.springframework.context.ApplicationContext context)
On receipt of a ContextRefreshedEvent, the registered beans
are validated and VersionDependentBean attached to their
associated VersionedBean instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
VersionDependentBeanResolver()
| Method Detail |
|---|
void checkForVersioningAwareBean(java.lang.Object bean,
java.lang.String beanName)
VersionedClass or
VersionDependentClass.
bean - the candidate bean.beanName - the name of the bean.public void onContextRefresh(org.springframework.context.ApplicationContext context)
ContextRefreshedEvent, the registered beans
are validated and VersionDependentBean attached to their
associated VersionedBean instance.
java.lang.Object getVersionDependentBean(java.lang.Object bean,
java.lang.Class<?> versionedClass,
java.lang.String activeVersion)
This will be the case if the bean was identified as a prototype, not supported by versioning.
bean - the intercepted bean or it's proxy.versionedClass - the target class of the intercepted bean.activeVersion - the currently active version which must not be null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||