|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vbs.spring.versioning.VersionedBean
public final class VersionedBean
Wrapper for each Spring bean annotated as a VersionedClass.
| Constructor Summary | |
|---|---|
VersionedBean(java.lang.String beanName,
java.lang.Class<?> versionedClass,
boolean uniqueForType)
Creates a wrapper for a Spring bean annotated as a VersionDependentClass. |
|
| Method Summary | |
|---|---|
(package private) boolean |
addIfDependent(VersionDependentBean versionDependentBean)
Adds the VersionDependentBean if it belongs to this
VersionedBean. |
(package private) boolean |
checkDuplicateBeanType(java.lang.Class<?> otherBeanType)
Returns true if this bean is of the same underlying type as the given class. |
boolean |
equals(java.lang.Object obj)
|
(package private) java.lang.Object |
getBeanForVersion(java.lang.String activeVersion)
Returns the spring bean that implements the given version or null if no such bean is found. |
(package private) java.lang.String |
getBeanName()
Returns the name of the bean within the application context. |
(package private) java.lang.Class<?> |
getVersionedClass()
Returns the VersionedClass annotated class that this bean
represents. |
int |
hashCode()
|
(package private) boolean |
isUniqueForType()
Returns true if this is the only bean configured for the bean's class. |
java.lang.String |
toString()
|
(package private) void |
validate()
Verifies that a VersionDependentBean instance is present for
each dependent class defined by VersionedClass annotation on
this bean's targert class and that all declared non-private, non-static
methods are implemented on each VersionDependentBean
annotated as @fullyImplemented. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
VersionedBean(java.lang.String beanName,
java.lang.Class<?> versionedClass,
boolean uniqueForType)
VersionDependentClass.
beanName - the name of the bean within the application context.versionedClass - the underlying class annotated by VersionedClass.uniqueForType - true if this is the only bean of the type defined by
versionedClass.| Method Detail |
|---|
boolean checkDuplicateBeanType(java.lang.Class<?> otherBeanType)
If the types are the same, then the isUniqueForType method
will return false.
otherBeanType - the VersionedClass annotated class of another bean.
otherBeanType.boolean addIfDependent(VersionDependentBean versionDependentBean)
VersionDependentBean if it belongs to this
VersionedBean.
The bean will be added if both this bean and the
VersionDependentBean are unique by target class or (if one
or both are not unigue), the name of this bean matches that of the
dependent bean suffixed by the active versions that the dependent bean
implements.
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.
versionDependentBean - the dependent bean that may belong to this.
void validate()
VersionDependentBean instance is present for
each dependent class defined by VersionedClass annotation on
this bean's targert class and that all declared non-private, non-static
methods are implemented on each VersionDependentBean
annotated as @fullyImplemented.
An INFO level log will be written listing the missing dependentg classes.
boolean isUniqueForType()
java.lang.String getBeanName()
java.lang.Class<?> getVersionedClass()
VersionedClass annotated class that this bean
represents.
VersionedClass annotated class that this bean
represents.java.lang.Object getBeanForVersion(java.lang.String activeVersion)
activeVersion - the non-default version.
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||