What do you mean by 'The approach taken by decorators'?
Stuart
________________________________________
From: Dan Allen [dan.j.allen(a)gmail.com]
Sent: Thursday, 15 April 2010 5:05 AM
To: Stuart Douglas
Cc: Pete Muir; Nicklas Karlsson; seam-dev(a)lists.jboss.org
Subject: Re: [seam-dev] Retrieving the Bean object for an interceptor
On Tue, Apr 13, 2010 at 8:31 PM, Stuart Douglas
<stuart@baileyroberts.com.au<mailto:stuart@baileyroberts.com.au>> wrote:
I think that the easiest way to address this would be to allow the interceptor to inject
the Bean and AnnotatedType object for the intercepted object.
e.g.
@Inject @InterceptedMetadata Bean bean;
@Inject @InterceptedMetadata AnnotatedType type;
In theory the AnnotatedType could be null, but in practice custom beans don't support
interceptors, so this should be fine.
This allows the interceptor to read the annotation information from the AnnotatedType. We
could also allow beans to inject this information as well, but I think that this can be
implemented as a portable extension without any spec changes.
The approach taken by decorators immediately comes to mind. I think the availability of
this information would really revolutionize the Java EE approach to interception. I know
if I showed this in a presentation I would get some raised brows ;)
-Dan
--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen