キューをの先頭に配線しようとしていますが、トリガーさMessageChannel
れたときに実行時に実行できるように、プログラムで配線する必要があります。osgi:listener
これまでのところ私は持っています:
public void addService(MessageChannel mc, Map<String,Object> properties)
{
//Create the queue and the QueueChannel
BlockingQueue<Message<?>> q = new LinkedBlockingQueue<Message<?>>();
QueueChannel qc = new QueueChannel(q);
//Create the Bridge and set the output to the input parameter channel
BridgeHandler b = new BridgeHandler();
b.setOutputChannel(mc);
//Presumably, I need something here to poll the QueueChannel
//and drop it onto the bridge. This is where I get lost
}
関連するさまざまなクラスを調べて、私は次のことを思いつきました。
PollerMetadata pm = new PollerMetadata();
pm.setTrigger(new IntervalTrigger(10));
PollingConsumer pc = new PollingConsumer(qc, b);
しかし、私はそれをすべてまとめることはできません。私は何が欠けていますか?