cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel <>
Subject XMPP event notification
Date Fri, 04 Aug 2006 00:30:41 GMT

Hi all,

I am endeavouring to use XMPP for event notification between two 
separate clients. I have two problems.

First, I don't get any rolledback or flushed events. Has anyone 
experienced such a problem?

Second, when I handle graph changed events and apply them to the graph, 
this causes events to be thrown back to the client that sent the first 
event. The first client then applies the diff and throws an event 
back...An infinite loop of event throwing is created, and I can't see a 
way to avoid it.



--- XMPP code ---

// using Object.class to ensure I capture all possible events in testing
context.getChannel().getEventManager().addListener(this, "handleXMPP", 
Object.class, DataChannel.GRAPH_ROLLEDBACK_SUBJECT);
context.getChannel().getEventManager().addListener(this, "handleXMPP", 
Object.class, DataChannel.GRAPH_CHANGED_SUBJECT);
context.getChannel().getEventManager().addListener(this, "handleXMPP", 
Object.class, DataChannel.GRAPH_FLUSHED_SUBJECT);

public void handleXMPP(Object event) {
        // System.out.println(event.toString());
        if (event instanceof GraphEvent) {
            // check to see the event comes from a different context
            if (event.getSource() != getObjectContext()) {
                firePropertyChange(PROP_EXT_CHANGE, false, true); // 
fire a property change to update visuals

View raw message