1 Reply Latest reply on Sep 28, 2005 2:46 PM by Tom Elrod

    Callbacks,Events, JBoss & AOP

    zx80 Newbie

      Hi,

      I've question - how do you implement callbacks (event listeners) using JBoss & EJB? I mean case, where server is event source, and client is an listener.

      I think there is a great place for AOP & JBossRemoting,
      I wanted to implement such aspect, but before, I want to ask if there is any existing solution

      Question is - is it possible with tools we have, or I need to create new one?

      test code would be:
      Client:

      @SomeCallbackAnnotation
      IMyCallback my_c = new IMyCallback() {
       onEvent(Object evt) {
       System.out.println("Event!" + evt);
       }
      }
      
      IRemoteApp app = ...
      app.foo(my_c);
      


      Server:
      class AppImpl {
       foo(IMyCallback c) {
       ...
       c.onEvent("Server says hello");
       ...
       }
      }
      


      Client's response:
      Event! Server says hello


      thanks, Dominik