On Tue, 5 Sep 2000 19:28:57 +0200, Pedro Garcia Lopez
<[EMAIL PROTECTED]> wrote:

>Hi all,
>
>Is it possible to create interceptors for EJB components ?

Not standardized, but some containers support proprietary ones.

<vendor>
jBoss does for example. Pretty much all call-oriented functionality has
been implemented as interceptors (transactions, security, database
synchronization, cache-interaction, etc.)
</vendor>

>For example, I have a class called Bank with a method withdraw(), and I
>want to trigger an event (using JMS) each time the method is called. The
>interceptor should trigger the event and the Bank code remains intact.

In this case I would recommend that you simply generate code for a class
that inherits your bean and adds your logic before/after delegating to
the "real" super-class. Deploy the generated bean instead of your
handwritten one.

I have a code generator that could help you with this task:
http://www.dreambean.com/codegen.html

>With CORBA you can create interceptors without problem.
>In RMI you can modify stubs and mimic this interceptor concept (see
>Javaworld thismonth).

I have a few issues with that article. They are discussed in a thread on
the RMI-USERS mailing list. See:
http://archives.java.sun.com/cgi-bin/wa?A2=ind0009&L=rmi-users&D=1&O=D&P=2908

>Is it possible with the EJB model ?

No.

>I imagine that this must be supported by some App container  but must be
>vendor-specific and non-standard.
>
>Any idea ?

As above, you can create jBoss-specific interceptors if you want to, but
the portable solution is to generate subclasses of your beans which you
deploy instead.

regards,
  Rickard

--
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to