Forums de discussion
Firing Events from a thread
Philipp Böser, modifié il y a 13 années.
Firing Events from a thread
New Member Publications: 3 Date d'inscription: 15/11/10 Publications récentes
Hello everyone,
I'm working on a project with Portlets and XMPP. Inside the portlet starts an additional thread for getting messages or pubsub items:
public void run() {
ItemEventListener<Item> listener = new ItemEventListener<Item>() {
@Override
public void handlePublishedItems(ItemPublishEvent<Item> items) {
System.out.println(items.getItems());
//Process content and firing events
}
};
node.addItemEventListener(listener);
while(!isInterrupted());
node.removeItemEventListener(listener);
}
Is there a way for firing events from this thread, like the method setEvent of actionResponse does?
Best regards,
Philipp
I'm working on a project with Portlets and XMPP. Inside the portlet starts an additional thread for getting messages or pubsub items:
public void run() {
ItemEventListener<Item> listener = new ItemEventListener<Item>() {
@Override
public void handlePublishedItems(ItemPublishEvent<Item> items) {
System.out.println(items.getItems());
//Process content and firing events
}
};
node.addItemEventListener(listener);
while(!isInterrupted());
node.removeItemEventListener(listener);
}
Is there a way for firing events from this thread, like the method setEvent of actionResponse does?
Best regards,
Philipp