Bridging OSGi Event Admin with J2EE JMS Didier Donsez Université Joseph Fourier Grenoble 1 IMA IMAG LSR ADELE by czz18476

VIEWS: 92 PAGES: 8

									Bridging OSGi Event Admin
            with
         J2EE JMS


                        Didier Donsez
     Université Joseph Fourier (Grenoble 1)
            IMA IMAG/LSR/ADELE
                    Didier.Donsez@imag.fr




   (c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS   1
           03/10/2005
                                                                                                 2


                                                                    Outline

                                                                     Event Admin Service
                                                                     Motivation and Principles
                                                                     Architecture
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS
           03/10/2005
                                                                                                                                      3


                              R4                                    Event Admin Service (i)

                                                                     (Event) publish-subscribe model between bundles.
                                                                     • Publishers publish events on a topic
                                                                     • Subscribers subscribe events from several topics
                                                                     Object Event = topic + properties <key,value>.
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS




                                                                     Event Admin : intermediary between publishers
                                                                     and subscribers
                                                                     • A subscriber registers a EventHandler service.
                                                                        • Subscribed topics are listed in the event.topics property
                                                                     • A publisher send/post a event to the EventAdmin service
                                                                     • EventAdmin service broadcasts (in parallel) the event
                                                                        to all EventHandler subscribing for the topic
           03/10/2005
                                                                                                                                                                                            4


                              R4                                     Event Admin Service (ii)

                                                                     Publisher
                                                                     Publisher                                                                                        Subscriber
                                                                                                                                                                      Subscriber
                                                                    topic="bar"
                                                                    topic="bar"                                                                                  event.topics=
                                                                                                                                                                 event.topics=
                                                                                                                                                                        {"foo"}
                                                                                                                                                                        {"foo"}
                                                                                         E6                                                org.osgi.service
                                                                                                                                           .event.EventHandler
                                                                                                            org.osgi.service
                                                                     Publisher
                                                                     Publisher                              .log.LogListener
                                                                                                                                                                      Subscriber
                                                                                                                                                                      Subscriber
                                                                    topic="tic"
                                                                    topic="tic"     E4
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS




                                                                                                                                             E1                  event.topics=
                                                                                                                                                                 event.topics=
                                                                                         E1                                           E2                             {"tic","tac"}
                                                                                                                                 E4                                  {"tic","tac"}
                                                                                                                  Event
                                                                                                                  Event
                                                                                                                  Admin
                                                                                                                  Admin          E4 E3
                                                                                         E2                        Impl                E1                             Subscriber
                                                                                                                                                                      Subscriber
                                                                     Publisher                                      Impl
                                                                     Publisher                org.osgi.service                                                   event.topics=
                                                                                                                                                                 event.topics=
                                                                                              .event.EventAdmin
                                                                    topic="tac"
                                                                    topic="tac"                                                                                   {"tic","tic/tac/*"}
                                                                                                                                                                  {"tic","tic/tac/*"}
                                                                                                                                      E5
                                                                                         E3
                                                                                                                                                                      Subscriber
                                                                                                                                                                      Subscriber
                                                                     Publisher                                                                                   event.topics=
                                                                                                                                                                 event.topics=
                                                                      Publisher
                                                                                                                                                                 {"org.osgi.framework.*"}
                                                                                                                                                                 {"org.osgi.framework.*"}
                                                                       topic=
                                                                        topic=                          event.filter=
                                                                    "tic/tac/toe"
                                                                    "tic/tac/toe"                       (bundle.symbolicName=com.acme.*)
           03/10/2005
                                                                                                                                       5


                              R4                                    Event Admin Service (iii)

                                                                     The sendEvent method provides a synchronous
                                                                     event delivery
                                                                     • the publisher is blocked until all (concerned) event handlers
                                                                       have fully processed the event
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS




                                                                     Special events and topics related to
                                                                     • services, bundles and framework lifecycles
                                                                     • LogService logs, UPnP Base Driver events, …
                                                                     EventAdmin should blacklist erroneous or CPU-
                                                                     greedy EventHandler.
           03/10/2005
                                                                                                                                               6


                                                                    Bridging Event Admin Service and JMS (i)

                                                                     Motivation
                                                                      • Large scale deployment and administration
                                                                      • Large scale applications (Sensor-based services, …)
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS




                                                                      • get/push events to/from remote OSGi gateways
                                                                      • get/push events to/from remote J2EE servers
                                                                     Principles
                                                                      •   Mapping Event.getProperty/getPropertyNames on javax.jms.MapMessage
                                                                      •   Mapping Event.getTopic() on javax.jms.Topic
                                                                      •   Mapping EventService requesters on javax.jms.TopicPublisher
                                                                      •   Mapping EventHandler services on javax.jms.TopicSubscriber
           03/10/2005
                                                                                                                                                                                                     7


                                                                     Bridging Event Admin Service and JMS (ii)

                                                                     Publisher
                                                                     Publisher                                                                                          Subscriber
                                                                                                                                                                        Subscriber
                                                                    topic="bar"
                                                                    topic="bar"                             org.osgi.service
                                                                                                                                                                   event.topics=
                                                                                                                                                                   event.topics=
                                                                                         E6                 .log.LogListener

                                                                                                                                               E7                           {"foo"}
                                                                                                                                                                            {"foo"}
                                                                                                                                            org.osgi.service
                                                                                                                                            .event.EventHandler

                                                                     Publisher
                                                                     Publisher                                    Event
                                                                                                                  Event                                                 Subscriber
                                                                                    E4                                                                                  Subscriber
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS




                                                                    topic="tic"
                                                                    topic="tic"                                   Admin
                                                                                                                  Admin              E4 E2 E1                      event.topics=
                                                                                                                                                                   event.topics=
                                                                                                                   Impl
                                                                                                                    Impl                                                {"tic","tac"}
                                                                                                                                                                        {"tic","tac"}
                                                                                              org.osgi.service                       E4
                                                                                              .event.EventAdmin
                                                                                         E1                                               E3
                                                                                    E2              E7                          E6              E1                      Subscriber
                                                                                                                                                                        Subscriber
                                                                     Publisher                                    EAJMS                E5
                                                                     Publisher                                    EAJMS                                            event.topics=
                                                                                                                                                                   event.topics=
                                                                    topic="tac"
                                                                    topic="tac"          E3                       Bridge
                                                                                                                  Bridge                                            {"tic","tic/tac/*"}
                                                                                                                                                                    {"tic","tic/tac/*"}
                                                                                                            TopicSubscriber


                                                                                                              TopicPublisher                                            Subscriber
                                                                                                                                                                        Subscriber
                                                                     Publisher                                                                                     event.topics=
                                                                                                                                                                   event.topics=
                                                                      Publisher
                                                                       topic=
                                                                        topic=                         M7                      M6                                 {"org.osgi.framework.*"}
                                                                                                                                                                  {"org.osgi.framework.*"}

                                                                    "tic/tac/toe"
                                                                    "tic/tac/toe"                        JMS MOM                                                  event.filter=
                                                                                                                                                                  (bundle.symbolicName=com.acme.*)
           03/10/2005
                                                                                                                                           8


                                                                    References

                                                                     SensorBean
                                                                     • http://www-adele.imag.fr/sensorbean/
                                                                     • http://www-adele.imag.fr/sensorbean/SensorBean_ObjectWebCon05.pdf
(c) Didier Donsez, 2005 - Bridging OSGi Event Admin with J2EE JMS

								
To top