EventHandler not being called! [message #642858] |
Fri, 03 December 2010 01:12 |
AppleJus Mising name Messages: 46 Registered: July 2010 |
Member |
|
|
Hi there,
I am really stuck on this one, I appreciate any help:
I have two parts in my app. In the code of the first part, I create and initialize an eventBroker using the IEContext, and pass to it an object via post().
In the second part, I want to get this object, so I create and initialize an eventBroker again using the IEContext, and also create an eventHandler. The problem I am getting is that the method handleEvent(...) is not being called.
I put some System.err.println() there and it is just confirming is it not being called, even though the .subscribe() call is returning successful. I have subscribed and posted data on the same topic string, I call "NEWDATA".
eventHandler = new EventHandler() {
@Override
public void handleEvent(org.osgi.service.event.Event event) {
System.err.println("TEST2: ");
CNCE_E.CNCE = (CreateNewCaseEncapsulate) event
.getProperty("NewCaseCreated");
}
};
System.err.println("SUCCESS: "
+ eventBroker.subscribe("NEWDATA", eventHandler));
|
|
|
Re: EventHandler not being called! [message #642880 is a reply to message #642858] |
Fri, 03 December 2010 07:43 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
How does your subscription look like? How does your post code look like?
Maybe there's a missmatch in your topics?
Tom
Am 03.12.10 02:12, schrieb AppleJus:
> Hi there,
>
> I am really stuck on this one, I appreciate any help:
>
> I have two parts in my app. In the code of the first part, I create and
> initialize an eventBroker using the IEContext, and pass to it an object
> via post().
> In the second part, I want to get this object, so I create and
> initialize an eventBroker again using the IEContext, and also create an
> eventHandler. The problem I am getting is that the method
> handleEvent(...) is not being called.
> I put some System.err.println() there and it is just confirming is it
> not being called, even though the .subscribe() call is returning
> successful. I have subscribed and posted data on the same topic string,
> I call "NEWDATA".
>
> eventHandler = new EventHandler() {
>
>
> @Override
> public void handleEvent(org.osgi.service.event.Event
> event) {
>
> System.err.println("TEST2: ");
>
> CNCE_E.CNCE = (CreateNewCaseEncapsulate) event
> .getProperty("NewCaseCreated");
>
> }
> };
>
> System.err.println("SUCCESS: "
> + eventBroker.subscribe("NEWDATA", eventHandler));
|
|
|
|
Powered by
FUDForum. Page generated in 0.03451 seconds