Download Developer Guide - Oracle Documentation

Transcript
Plug-In Architecture
Here's an example of the PluginBeanFactoryPostProcessor class in use in a plug-in
module's plugin.xml file to override the original bean definition
<!-- Override the authenticationProcessingFilter to use the WLS filter
and add a customerService property -->
<bean class="com.bea.alcs.commons.util.impl.PluginBeanFactoryPostProcessor">
<property name="extensionBeanName">
<value>"authenticationProcessingFilter</value>
</property>
<property name="extensionClassName">
<value>com.bea.alcs.plugins.wls_authenticator.filters.WlsAuthenticationProcessingFilter</val
ue>
</property>
<property name="propertyName">
<value>customerService</value>
<property name="propertyValue">
<ref bean="customerService"/>
</property>
</bean>
The properties are as follows
Property
Description
extensionBeanName
The name of the bean to find an override
extensionClassName
(optional) The class to set the overridden bean to use. This property can be omitted to
leave the class as assigned in the original bean definition
propertyName
The property of the bean to override or add
propertyValue
The value for the above property
Effectively, the above example has the same effect as manually editing the original
configuration file like this
<bean id="authenticationProcessingFilter" class=
"com.bea.alcs.plugins.wls_authenticator.filters.WlsAuthenticationProcessingFilter"
>
<property name="webCustomerSessionService">
<ref bean="webCustomerSessionService"/>
BEA AquaLogic Commerce Services Developer Guide
159