XMPP event notification

From: Marcel (emmpeege..mail.com)
Date: Thu Aug 03 2006 - 20:30:41 EDT

  • Next message: Øyvind Harboe: "Re: Null pointer exceptions and database null"

    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.

    Cheers,

    Marcel

    --- 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()) {
                    event.getDiff().apply(getObjectContext().getGraphManager());
                    firePropertyChange(PROP_EXT_CHANGE, false, true); //
    fire a property change to update visuals
                }
            }
    }



    This archive was generated by hypermail 2.0.0 : Thu Aug 03 2006 - 20:31:17 EDT