ラクダのコンテキストで定義されたルート内で、サードパーティのライブラリに含まれる抽象クラスのメソッドにアクセスしたいのですが、私は使用しています。Spring DSLのCamel Contextバージョン(2.9.1)の抽象クラスのメソッドへのアクセス
<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の原型を使用していることを試してみました= "helloBean" ... "/> <ログメッセージ=" ... "/> <豆タイプ=" java.arrays」METHOD = "のtoString" /> camelContext> 'これは私に 'org.xml.sax.SAXParseException'を与えます:' cvc-complex-type.3.2.2:属性 'type'は要素 'bean'に現れません。 '私はそれが仮定されている方法を誤解しましたか?使用するか? –
user1281204
はい内にはCamel名前空間があり、タグはルートからBeanを呼び出します。 –