Hi,
I don't know HazelCast, but the problem you are seeing is that EventBus.get()
only works when the application is attached to the current thread. You either
have to pass a reference to the EventBus to your broadcaster, or, if you have
access to the Wicket Application, you can set it on ThreadLocal (make sure you
unset it in a finally). wicket-atmosphere-0.4-SNAPSHOT has a
EventBus.get(Application), where you can pass in to application to use.
Best regards,
Emonds
On Monday 10 September 2012 05:38:15 esajjkh wrote:
> Hi
>
> I am using HazelCast(HazelcastBroadcaster) and Atmosphere in Wicket 6
> application. When a new message is published the application throws a
> *WicketRunTimeException* "There is no application attached with current
> thread" in the follwing signature of MyHazelcastBroadcaster :
>
> class MyHazelcastBroadcaster extends HazelcastBroadcaster{
> ......
> @Override
> public void incomingBroadcast() {
> ITopic topic = Hazelcast.getTopic(getID());
> topic.addMessageListener(new SSPMessageListner() {
>
> @Override
> public void onMessage(String e) {
> * EventBus.get().post(e);* //post the event so the method
> with @Subscribe annotation should be called.
> }
> });
>
> }
> }
>
> In my ApplicationClass i configured this broadcaster and Atmospher like
> this:
> .......
> MyHazelcastBroadcaster bc = (MyHazelcastBroadcaster)
> BroadcasterFactory.getDefault().get(MY_EVENT);
> bc.setUp();
> eventBus= new EventBus(this,bc) //my broadcaster is registered with
> eventbus
>
>
> Am I missing anything? Thank you!
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/HazelCast-and-Atmosphere-Integra
> tion-with-Wicket-6-tp4651891.html Sent from the Users forum mailing list
> archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]