如何 "disable" 骆驼蓝图中的 bean 引用?
How to "disable" a bean reference in camel blueprint?
我正在使用骆驼。这是我的蓝图(摘录):
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<cm:property-placeholder id="placeholder" persistent-id="com.adelco.articulos" />
<!-- Configures the Inbound and Outbound SAP Connections -->
<bean id="sap-configuration" class="org.fusesource.camel.component.sap.SapConnectionConfiguration">
.
.
</bean>
<!--A lot of things here, let's omit them-->
<!-- Route beans-->
<bean id="rutaSTEPEntrada" class="com.adelco.articulos.RutaSTEPEntrada"/>
<bean id="rutaSTEPSap" class="com.adelco.articulos.RutaSTEPSap"/>
<camelContext id="camel-articulos" xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="rutaSTEPEntrada"/>
<routeBuilder ref="rutaSTEPSap"/>
</camelContext>
</blueprint>
我想要 "disable" bean“sap-configuration”但不使用 XML 注释。像这样:
<bean id="sap-configuration" enabled=${ENABLED} class="org.fusesource.camel.component.sap.SapConnectionConfiguration">
.
.
</bean>
我可以使用“autoStartup”和属性占位符“autoStartup=${ENABLED}[=来定义我想要激活的骆驼路线22=]" 但我找不到如何使用 bean 执行此操作。
这是不可能的。这就是 OSGi 蓝图的工作原理。如果您定义 <bean>
,那么它正在使用中。
我正在使用骆驼。这是我的蓝图(摘录):
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<cm:property-placeholder id="placeholder" persistent-id="com.adelco.articulos" />
<!-- Configures the Inbound and Outbound SAP Connections -->
<bean id="sap-configuration" class="org.fusesource.camel.component.sap.SapConnectionConfiguration">
.
.
</bean>
<!--A lot of things here, let's omit them-->
<!-- Route beans-->
<bean id="rutaSTEPEntrada" class="com.adelco.articulos.RutaSTEPEntrada"/>
<bean id="rutaSTEPSap" class="com.adelco.articulos.RutaSTEPSap"/>
<camelContext id="camel-articulos" xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="rutaSTEPEntrada"/>
<routeBuilder ref="rutaSTEPSap"/>
</camelContext>
</blueprint>
我想要 "disable" bean“sap-configuration”但不使用 XML 注释。像这样:
<bean id="sap-configuration" enabled=${ENABLED} class="org.fusesource.camel.component.sap.SapConnectionConfiguration">
.
.
</bean>
我可以使用“autoStartup”和属性占位符“autoStartup=${ENABLED}[=来定义我想要激活的骆驼路线22=]" 但我找不到如何使用 bean 执行此操作。
这是不可能的。这就是 OSGi 蓝图的工作原理。如果您定义 <bean>
,那么它正在使用中。