Re: EventSubject implementation

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jun 27 2003 - 19:39:32 EDT

  • Next message: Andrus Adamchik: "Re: A note on the EventManager"

    On Friday, June 27, 2003, at 06:29 PM, Holger Hoffstätte wrote:

    > Oh, just curious - any reasons why you are going for JMS directly?
    > JavaGroups really is nice since it works at an higher level,
    > automatically
    > creating master/peers, taking care of delivery, removing dead peers and
    > reelecting a master etc. Have a look at the HSQLDB
    > replication/clustering
    > whitepaper, it's really sweet.

    I will definitely look at the whitepaper. Now I am kind of researching
    the options. What I came up with is an adapter between "local" and
    "remote" messaging which is a transport independent abstract class (JMS
    adapter being its first implementation). It will work like this:

    1. To make an event (or rather - subject) distributed, an instance of
    DistributedNotificationAdapter is registered with EventManager just
    like any other listener would.

    2. When a DistributedNotificationAdapter receives an event from
    EventManager, it resends it outside (using whatever transport it
    implements)

    3. When a DistributedNotificationAdapter receives an event on its
    "external" interface (say a JMS message), it recasts the event into a
    local event and posts it via EventManager.

    This makes "distribution" feature external to the EventManager. I kind
    of like it. Not sure if this approach has any inherent limitations. I
    will definitely need to do some research.

    I started with JMS (and not JavaGroups) since JMS is part of J2EE1.3
    and is therefore ubiquitous, and does not require Cayenne to bundle
    extra dependencies (and of course if notifications are disabled in an
    app, no J2EE installation is required). Wanted to see how this works.

    A



    This archive was generated by hypermail 2.0.0 : Fri Jun 27 2003 - 19:39:32 EDT