在骆驼上下文中定义的路由中,我想访问包含在第三方库I中的抽象类的方法I正在使用。访问驼峰上下文版本(2.9.1)中抽象类与Spring DSL的方法
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="objectFactory" class="org.example.Factory" abstract="true"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
...
<marshal>
<rss/>
</marshal>
<marshal>
<string/>
</marshal>
<to uri="jms:feeds"/>
<to uri="file:/tmp/output"/>
<!-- That is the point in the route where I would like to pass the URL of
the folder the files have been written to a static method of an abstract
class in order to instantiate an object
-->
</route>
...
上面的代码片断显示了Spring DSL中的路由定义和抽象bean的定义。我试过使用<bean>
标签来达到我想要的效果,但这总是以org.springframework.beans.factory.BeanIsAbstractException
结尾。有没有办法只是简单地访问camelcontext中的抽象类的静态方法?
感谢您的快速回答。我试图通过使用骆驼弹簧-DM原型:' <从URI ... /> <方法参照= “为helloBean” ... “/> <日志消息=” ... “/> camelContext>' 。这给了我一个'org.xml.sax.SAXParseException':'cvc-complex-type.3.2.2:属性'type'不允许出现在元素'bean'中。'我误解了它的设想要使用吗? –
user1281204
2012-03-20 17:26:48
是的里面有Camel命名空间,还有一个标签从路线中调用bean。 –
2012-03-21 08:01:49