I agree!  And imagine if each method of any Object as a pre/post hook you
can implement persistence on...  this would almost be akin to EJB's ejbLoad
and ejbStore!

Hmm...  wouldn't this obviate the need for EJB servers altogether???  Maybe
that's it!  Java Object Interceptors were originally in the works for the
next JDK draft, but due to collusion between EJB vendors and Sun, this
wonderful idea was dropped!  I smell a conspiracy! :-)

Gene

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
To: [EMAIL PROTECTED]
Sent: 9/6/00 8:21 PM
Subject: Re: Interceptors in the EJB model

I wonder if this interview was pre-Dynamic proxies. They have so much
more
flexibility than this construct. They give you the pre, post, and a lot
more. You can even end up invoking a completely different method than
the
one that was called. You can reuse the proxy "wrapper" class on any
class.
Imagine subclassing *all* of your classes to get some simple
timestamping
pre- and post- routines to execute. ugh.

jim

> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Gene Chuang
> Sent: Wednesday, September 06, 2000 9:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Interceptors in the EJB model
>
>
> Yes, you can implement method interceptors using Dynamic Proxies;
>  however,
> you gotta use Dynamic Proxies for all your references!
>
> What Gosling was describing was something more on the lines of:
>
> Object.preMethodInvoke(Method aMethod, Object[] aArgs)
> Object.postMethodInvoke(Method aMethod, Object[] aArgs, Object
aReturn)
>
> where method interception is built into all Java Objects!  Of course
the
> default implementation does nothing, you're extended class would have
to
> override these methods...  That would be cool!
>
> Gene Chuang
> Teach the world...  Join Kiko!
> <http://www.kiko.com/profile/join.jsp?refcode=TAF-gchuang>
>
>
>
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of James Cook
> Sent: Wednesday, September 06, 2000 5:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Interceptors in the EJB model
>
>
> It's already there in JDK 1.3 in the form of Dynamic Proxies.
>
> jim
>
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Gene Chuang
> > Sent: Wednesday, September 06, 2000 6:38 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Interceptors in the EJB model
> >
> >
> > I was reading some interview with James Gosling (java creator)
somewhere
> > where he was saying in the proposed draft for JDK 2.0, method
> > pre-and-post-interceptors were gonna be implemented for native
> > Java...  but
> > I don't think this idea got anywhere; too bad!
> >
> > Gene
> >
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Tony Abbott
> > Sent: Wednesday, September 06, 2000 3:03 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Interceptors in the EJB model
> >
> >
> > Method interceptors are listed as one of the features that have been
> > "deferred
> > to future releases" in the EJB 2.0 public draft.
> >
> > -t
> >
> >
> >
> >
> > On Tue, Sep 05, 2000 at 10:41:44AM -0700, Gene Chuang wrote:
> > > Hi,
> > >
> > > Are you asking for the following hooks in the Bean class?
> > >
> > > void ejbPreCall(Method aMethod, Object[] aArgs);
> > > void ejbPostCall(Method aMethod, Object[] aArgs, Object aReturn);
> > >
> > > Yeah, it'll be cool if they existed in the specs...  EJB 3.0,
maybe?
> > >
> > > Gene Chuang
> > > Teach the world...  Join Kiko!
> > > <http://www.kiko.com/profile/join.jsp?refcode=TAF-gchuang>
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: A mailing list for Enterprise JavaBeans development
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of Pedro Garcia Lopez
> > > Sent: Tuesday, September 05, 2000 10:29 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Interceptors in the EJB model
> > >
> > >
> > > Hi all,
> > >
> > > Is it possible to create interceptors for EJB components ?
> > >
> > > 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.
> > >
> > > With CORBA you can create interceptors without problem.
> > > In RMI you can modify stubs and mimic this interceptor concept
(see
> > > Javaworld thismonth).
> > >
> > > Is it possible with the EJB model ?
> > > I imagine that this must be supported by some App container
> but must be
> > > vendor-specific and non-standard.
> > >
> > > Any idea ?
> > >
> > >
> > ==================================================================
> > =========
> > > 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".
> > >
> > >
> > ==================================================================
> > =========
> > > 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".
> > >
> >
> > --
> >
> >    Tony Abbott                          [EMAIL PROTECTED]
> >
> > ==================================================================
> > =========
> > 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".
> >
> > ==================================================================
> > =========
> > 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".
> >
> >
>
> ==================================================================
> =========
> 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".
>
> ==================================================================
> =========
> 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".
>
>

========================================================================
===
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".

===========================================================================
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