You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by James Carman <ja...@carmanconsulting.com> on 2006/02/28 14:58:18 UTC

Annotation-based Method Interception?

All,

I really like how Tapestry did the MethodAnnotationEnhancementWorker stuff.
Do you there could be a way for us to do something like this in HiveMInd?
The problem is that we need to know the type of the implementation object,
since most of the time, annotations for stuff like transactions will be
placed on the implementation class, not the interface.

James



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: Annotation-based Method Interception?

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've been putting annotations on my service implementation, not on the
implementation class.

It does get tricky ... the order in which interceptors occur.

I think, ideally, HiveMind should be able to see an annotation on a
service interface, and have that trigger an interceptor factory,
without the need for an <interceptor> element.

This would imply a configuration point to match annotations to a
service interceptor factory.

I really don't like the idea of the implementation class "escaping"
from the service implementation factory. Further, I think many
interesting services will come to exist as just interfaces and
annotations, with HiveMind supplying all the implementations.

I hope to bring my focus back to HiveMind and Tapestry in a few weeks.

On 2/28/06, James Carman <ja...@carmanconsulting.com> wrote:
> All,
>
> I really like how Tapestry did the MethodAnnotationEnhancementWorker stuff.
> Do you there could be a way for us to do something like this in HiveMInd?
> The problem is that we need to know the type of the implementation object,
> since most of the time, annotations for stuff like transactions will be
> placed on the implementation class, not the interface.
>
> James
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org
>
>


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

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


RE: Annotation-based Method Interception?

Posted by James Carman <ja...@carmanconsulting.com>.
No thoughts on this, guys.  Here's what I have in mind...

if( servicePoint.getHint( "impl-class" ) != null ) {
  // Check impl class for annotations that you want.
}

So, basically, the ServicePoint class (I think that's what it's called)
would have name/value pair hints on it that can be set by the factories or
whatever.

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Tuesday, February 28, 2006 9:02 AM
To: hivemind-dev@jakarta.apache.org
Subject: RE: Annotation-based Method Interception?

Maybe BuilderFactory could place a "hint" on the service point which tells
us the implementation class?  :-)  Boy, that sure opens up a can of worms!

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Tuesday, February 28, 2006 8:58 AM
To: hivemind-dev@jakarta.apache.org
Subject: Annotation-based Method Interception?

All,

I really like how Tapestry did the MethodAnnotationEnhancementWorker stuff.
Do you there could be a way for us to do something like this in HiveMInd?
The problem is that we need to know the type of the implementation object,
since most of the time, annotations for stuff like transactions will be
placed on the implementation class, not the interface.

James



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


RE: Annotation-based Method Interception?

Posted by James Carman <ja...@carmanconsulting.com>.
Maybe BuilderFactory could place a "hint" on the service point which tells
us the implementation class?  :-)  Boy, that sure opens up a can of worms!

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Tuesday, February 28, 2006 8:58 AM
To: hivemind-dev@jakarta.apache.org
Subject: Annotation-based Method Interception?

All,

I really like how Tapestry did the MethodAnnotationEnhancementWorker stuff.
Do you there could be a way for us to do something like this in HiveMInd?
The problem is that we need to know the type of the implementation object,
since most of the time, annotations for stuff like transactions will be
placed on the implementation class, not the interface.

James



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org