I have xml definitions of beans like this
<bean id="testingProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:myTests.properties"/>
</bean>
<bean id="MyBean" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl" value="${config.http.server.url}/testing/"/>
<property name="serviceInterface" value="com....ClassName"/>
<property name="httpInvokerRequestExecutor" ref="requestExecutor"/>
</bean>
<bean id="requestExecutor" class="com.CustomHttpComponentsHttpInvokerRequestExecutor"></bean>
How can I put there some if statement, for example I am checking property and depends on its value deciding whether I need to inject property httpInvokerRequestExecutor no?
This CustomHttpComponentsHttpInvokerRequestExecutor class is kind of interceptor in case I work over https, it is adding trust store etc to the context, etc. And I want decide if this class needs to be injected as an property of MyBean or not.
Is there any way to do it?