The intent is to allow "private" collaboration of services via event
listener, behind the scenes.  The event listener interface is
implemented by the service implementation and is not part of the
service interface.

In practicality, the core service implementation is created before the
interceptors are.

If you want event notifications to go through the proxies and
interceptors, you need to have the BuilderFactory inject the event
source service, and the service, and initialize it it in code:

public class MyServiceImpl implements MyService
{
  private MyService __thisService;;
  private EventSource _eventSource;

  public void initializeService()
  {
     _eventSource.addEventListener(_thisService);
  }

  . . .
}

<service-point id="MyService" ...>
  <invoke-factory>
    <set-service proeprty="thisService" service-id="MyService"/>
    <set-service property="eventSource" service-id="EventSource"/>
  </invoke-factory>
</service-point>

I omitted the setter methods.  What will be injected into the
implementation will be the *proxy*, the same object seen by any other
service. Registering the proxy with the event source means that method
invocations progress through proxy and interceptors before reaching
the implementation.


----- Original Message -----
From: Pablo Lalloni <[EMAIL PROTECTED]>
Date: Fri, 03 Sep 2004 10:44:38 -0300
Subject: event listeners and BuilderFactory
To: hivemind-dev <[email protected]>

 I've just came across this on HiveMind's BuilderFactory documentation:
 
 "Event notifications go directly to the constructed service instance;
they don't go through any proxies or interceptors for the service."
 
 I'm sure there must be a reason for this but can't see it ATM.
 So I'm wondering why is that? Why not go through all
proxy/interceptor stack so I get my security and transaction code
invoked?
 
 
 -- Pablo I. Lalloni <[EMAIL PROTECTED]> Tel�fono +54 (11)
4347-3177 Proyecto Cuenta Corriente Tributaria Direcci�n Inform�tica
Tributaria AFIP



-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to