External validators
The following is a description of the changes to how InfoSphere® MDM uses and handles external validators.
Before OSGi
Validators were assigned using a validators table and mapped to individual fields or to entire entities. The validation framework used reflection to create each validator. It didn’t matter in which .jar tile the Java™ class that was the validator resided: the application-wide class loader could find the validator Java class using reflection, and could load it.
With OSGi
The validation framework is unchanged. However, because the actual external validators can potentially be found in any bundle, there are OSGi services that are used to create them. Note that the validators themselves are not services.
<service id="CommonValidatorLocator"
interface="com.dwl.unifi.validation.ValidatorLocator">
<bean id="ConcreteValidatorFactoryBean" scope="prototype"
class="com.dwl.unifi.validation.ValidatorLocatorImpl">
<property name="bpBundle" ref="blueprintBundle" />
<argument>
<list>
<bean class="com...MyValidator1" />
<bean class="com...MyValidator2" />
<bean class="com...MyValidator3/>
</list>
<argument>
</bean>
</service>All existing external validators have these services definitions, and if you open the InfoSphere MDM bundles you’ll see them specified in blueprint XML files throughout the application.
Once you’ve declared the OSGi service that makes your validator available to the rest of the application, you must update the validator database tables.