You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2005/07/26 05:15:20 UTC

Hivemind + AOP : Which approach to take?

Well it's me again (I guess ppl may be getting tired of my questions)

Ok. I probably said this before, but I'm trying to create a pure
hivemind project (no springs attached :D), I have nothing against
Spring, on the opposite, I like it pretty much, I just don't see why
use spring for some pieces that Hivemind + HiveUtils could easily get
pretty well.

Ok, so I get in a real hard decision. Using AOP with spring means, all
my beans must be managed by it, which they aren't anymore :D.

I tried Interceptors ... well I really would like to have a pattern
for my methods, not apply it to all o 'em. I've checked out Jean's
TransactionInterceptorFactory source code, and found that would take a
pretty long way to do the same for my interceptors.

Ok, so we've few choices left:

AspectWerkz: I really like it, non intrusive in one aspect (uses
proxies) but you gotta change your classloader, hum.. my tomcat turned
just 300% slower with the new classloader. Out of question.

JBoss AOP: I'm a Tomcat user, I really get as far away from JBoss and
EJB stuff as I can.

AspectJ: Nice, fast, but too intrusive, and you can't debug your code anymore.

I was wondering if someone who've been using AOP with Hivemind in a
project would care to share it's experiences / opinions ?

Regards

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


RE: Hivemind + AOP : Which approach to take?

Posted by James Carman <ja...@carmanconsulting.com>.
"considering interceptors as aop is not 100% correct."

Agreed, I would (and did in the first draft of my article) say that
MethodInterceptors provide a rudimentary form of AOP.  In general, though,
you're correct (again) that AOP is far more robust than MethodInterceptors
alone.  MethodInterceptors don't allow you to introduce variables or cause a
class to implement a new interface, etc.  But, as you pointed out, there is
a learning curve with AOP, in that you have to learn how to define pointcuts
and you have to develop a new understanding of AOP in general.  If I can get
by without having to teach my team these concepts, then I will.



-----Original Message-----
From: Alexandru Popescu [mailto:the_mindstorm@evolva.ro] 
Sent: Friday, July 29, 2005 6:03 PM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivemind + AOP : Which approach to take?

#: by James Carman's words the mind was *winged* :#
> I would have to say that I believe in the KISS (keep it simple, stupid)
> principle.  Proxies are just fine in many cases.  The performance costs of
> proxies vs. "weaving" are negligible compared to what the methods are
> already doing, for the most part.  Now, if you do run into a situation
where
> the proxies are just too darned slow for you, then you can tweak the
system
> by using a different approach AOP or runtime class generation (CGLIB or
> Javassist).  I would venture to say that you probably won't need to do it.
> In other words, YAGNI.  Don't get me wrong, I do like AOP for certain
tasks,
> but when a framework such as HiveMind gives you a simplified solution
(like
> MethodInterceptors), why not use it?
> 

Sorry I have been understood this way. I was not advocating against
Hivemind, Spring or some other 
aop solutions. To me the initial post seemed to be a research for an intro
in aop. From this point 
of view I considered some clarifications were needed.

However, the KISS principle is here applied only to the framework
development, as from my point of 
view the users are required to in both situations to learn only the pointcut
definition language (I 
wouldn't bring into discussion a few interfaces API that are used in AW or
AJ f.e.).

As regards the fact that proxy solutions are covering many cases I agree
with you. But I usually 
tend to use cleaner befores and afters, instead of always using arounds.

I don't want to start a flame, but considering interceptors as aop is not
100% correct. Interceptors 
were introduced as a pattern, that at the point of aop concepts
implementation seemed appropriate to 
be used. You can do with them some of the things you are doing with aop, but
that's all. Sorry if i 
sound kinnda `religious´ about it :-).

:alex |.::the_mindstorm::.|

> 
> -----Original Message-----
> From: Alexandru Popescu [mailto:the_mindstorm@evolva.ro] 
> Sent: Friday, July 29, 2005 5:35 PM
> To: hivemind-user@jakarta.apache.org
> Subject: Re: Hivemind + AOP : Which approach to take?
> 
> #: by Vinicius Carvalho's words the mind was *winged* :#
>> In reply for James: 
>> Haven't tried yet, promise I'll try over the weekend. And BTW Thanks a
>> lot for the post.
>> 
>> Alexandru:
>> 
>> "You can do offline weaving so there is no need for special
>> classloaders." My mistake, I'm so sorry for that, did not know about
>> that feature :D
>> I found some annoying problems with Annotations and eclipse plugin as
well
> :(
>> 
> 
> I have to agree that the plugin is not our powerfull point :-s. I would be
> interested to hear what 
> problems have you faced with Annotations.
> 
>> I think it's my fault the definition of intrusive on the email
>> context. As you can see by my name and grammar (English is not my
>> native language :P). What I'd like to say is: I prefer proxy based
>> once your original code is preserved, you don't need to re-compile it
>> to add/remove features from your aspects.
>> 
> 
> Unfortunately, the proxy based solution is not something I would recommend
> to anyone. It is a very 
> easy approach (look how many so called aop solutions based on proxies are
> out-there, compaired with 
> real aop solutions) and you are loosing some of the features (f.e. static
> typing) which will finally 
> influence the performance. But this is quite another story.
> 
>> Not justifying my mistakes, just making them clear :P
>> 
> 
> No problem. For myself it is quite the same: English is not my mother
> language :-).
> 
> take care,
> :alex |.::the_mindstorm::.|
> 
>> Thanks all
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


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



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


Re: Hivemind + AOP : Which approach to take?

Posted by Alexandru Popescu <th...@evolva.ro>.
#: by James Carman's words the mind was *winged* :#
> I would have to say that I believe in the KISS (keep it simple, stupid)
> principle.  Proxies are just fine in many cases.  The performance costs of
> proxies vs. "weaving" are negligible compared to what the methods are
> already doing, for the most part.  Now, if you do run into a situation where
> the proxies are just too darned slow for you, then you can tweak the system
> by using a different approach AOP or runtime class generation (CGLIB or
> Javassist).  I would venture to say that you probably won't need to do it.
> In other words, YAGNI.  Don't get me wrong, I do like AOP for certain tasks,
> but when a framework such as HiveMind gives you a simplified solution (like
> MethodInterceptors), why not use it?
> 

Sorry I have been understood this way. I was not advocating against Hivemind, Spring or some other 
aop solutions. To me the initial post seemed to be a research for an intro in aop. From this point 
of view I considered some clarifications were needed.

However, the KISS principle is here applied only to the framework development, as from my point of 
view the users are required to in both situations to learn only the pointcut definition language (I 
wouldn't bring into discussion a few interfaces API that are used in AW or AJ f.e.).

As regards the fact that proxy solutions are covering many cases I agree with you. But I usually 
tend to use cleaner befores and afters, instead of always using arounds.

I don't want to start a flame, but considering interceptors as aop is not 100% correct. Interceptors 
were introduced as a pattern, that at the point of aop concepts implementation seemed appropriate to 
be used. You can do with them some of the things you are doing with aop, but that's all. Sorry if i 
sound kinnda `religious´ about it :-).

:alex |.::the_mindstorm::.|

> 
> -----Original Message-----
> From: Alexandru Popescu [mailto:the_mindstorm@evolva.ro] 
> Sent: Friday, July 29, 2005 5:35 PM
> To: hivemind-user@jakarta.apache.org
> Subject: Re: Hivemind + AOP : Which approach to take?
> 
> #: by Vinicius Carvalho's words the mind was *winged* :#
>> In reply for James: 
>> Haven't tried yet, promise I'll try over the weekend. And BTW Thanks a
>> lot for the post.
>> 
>> Alexandru:
>> 
>> "You can do offline weaving so there is no need for special
>> classloaders." My mistake, I'm so sorry for that, did not know about
>> that feature :D
>> I found some annoying problems with Annotations and eclipse plugin as well
> :(
>> 
> 
> I have to agree that the plugin is not our powerfull point :-s. I would be
> interested to hear what 
> problems have you faced with Annotations.
> 
>> I think it's my fault the definition of intrusive on the email
>> context. As you can see by my name and grammar (English is not my
>> native language :P). What I'd like to say is: I prefer proxy based
>> once your original code is preserved, you don't need to re-compile it
>> to add/remove features from your aspects.
>> 
> 
> Unfortunately, the proxy based solution is not something I would recommend
> to anyone. It is a very 
> easy approach (look how many so called aop solutions based on proxies are
> out-there, compaired with 
> real aop solutions) and you are loosing some of the features (f.e. static
> typing) which will finally 
> influence the performance. But this is quite another story.
> 
>> Not justifying my mistakes, just making them clear :P
>> 
> 
> No problem. For myself it is quite the same: English is not my mother
> language :-).
> 
> take care,
> :alex |.::the_mindstorm::.|
> 
>> Thanks all
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


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


RE: Hivemind + AOP : Which approach to take?

Posted by James Carman <ja...@carmanconsulting.com>.
I would have to say that I believe in the KISS (keep it simple, stupid)
principle.  Proxies are just fine in many cases.  The performance costs of
proxies vs. "weaving" are negligible compared to what the methods are
already doing, for the most part.  Now, if you do run into a situation where
the proxies are just too darned slow for you, then you can tweak the system
by using a different approach AOP or runtime class generation (CGLIB or
Javassist).  I would venture to say that you probably won't need to do it.
In other words, YAGNI.  Don't get me wrong, I do like AOP for certain tasks,
but when a framework such as HiveMind gives you a simplified solution (like
MethodInterceptors), why not use it?


-----Original Message-----
From: Alexandru Popescu [mailto:the_mindstorm@evolva.ro] 
Sent: Friday, July 29, 2005 5:35 PM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivemind + AOP : Which approach to take?

#: by Vinicius Carvalho's words the mind was *winged* :#
> In reply for James: 
> Haven't tried yet, promise I'll try over the weekend. And BTW Thanks a
> lot for the post.
> 
> Alexandru:
> 
> "You can do offline weaving so there is no need for special
> classloaders." My mistake, I'm so sorry for that, did not know about
> that feature :D
> I found some annoying problems with Annotations and eclipse plugin as well
:(
> 

I have to agree that the plugin is not our powerfull point :-s. I would be
interested to hear what 
problems have you faced with Annotations.

> I think it's my fault the definition of intrusive on the email
> context. As you can see by my name and grammar (English is not my
> native language :P). What I'd like to say is: I prefer proxy based
> once your original code is preserved, you don't need to re-compile it
> to add/remove features from your aspects.
> 

Unfortunately, the proxy based solution is not something I would recommend
to anyone. It is a very 
easy approach (look how many so called aop solutions based on proxies are
out-there, compaired with 
real aop solutions) and you are loosing some of the features (f.e. static
typing) which will finally 
influence the performance. But this is quite another story.

> Not justifying my mistakes, just making them clear :P
> 

No problem. For myself it is quite the same: English is not my mother
language :-).

take care,
:alex |.::the_mindstorm::.|

> Thanks all
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


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



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


Re: Hivemind + AOP : Which approach to take?

Posted by Alexandru Popescu <th...@evolva.ro>.
#: by Vinicius Carvalho's words the mind was *winged* :#
> In reply for James: 
> Haven't tried yet, promise I'll try over the weekend. And BTW Thanks a
> lot for the post.
> 
> Alexandru:
> 
> "You can do offline weaving so there is no need for special
> classloaders." My mistake, I'm so sorry for that, did not know about
> that feature :D
> I found some annoying problems with Annotations and eclipse plugin as well :(
> 

I have to agree that the plugin is not our powerfull point :-s. I would be interested to hear what 
problems have you faced with Annotations.

> I think it's my fault the definition of intrusive on the email
> context. As you can see by my name and grammar (English is not my
> native language :P). What I'd like to say is: I prefer proxy based
> once your original code is preserved, you don't need to re-compile it
> to add/remove features from your aspects.
> 

Unfortunately, the proxy based solution is not something I would recommend to anyone. It is a very 
easy approach (look how many so called aop solutions based on proxies are out-there, compaired with 
real aop solutions) and you are loosing some of the features (f.e. static typing) which will finally 
influence the performance. But this is quite another story.

> Not justifying my mistakes, just making them clear :P
> 

No problem. For myself it is quite the same: English is not my mother language :-).

take care,
:alex |.::the_mindstorm::.|

> Thanks all
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


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


Re: Hivemind + AOP : Which approach to take?

Posted by Vinicius Carvalho <ja...@gmail.com>.
In reply for James: 
Haven't tried yet, promise I'll try over the weekend. And BTW Thanks a
lot for the post.

Alexandru:

"You can do offline weaving so there is no need for special
classloaders." My mistake, I'm so sorry for that, did not know about
that feature :D
I found some annoying problems with Annotations and eclipse plugin as well :(

I think it's my fault the definition of intrusive on the email
context. As you can see by my name and grammar (English is not my
native language :P). What I'd like to say is: I prefer proxy based
once your original code is preserved, you don't need to re-compile it
to add/remove features from your aspects.

Not justifying my mistakes, just making them clear :P

Thanks all

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


Re: Hivemind + AOP : Which approach to take?

Posted by Alexandru Popescu <th...@evolva.ro>.
#: by Vinicius Carvalho's words the mind was *winged* :#
> Well it's me again (I guess ppl may be getting tired of my questions)
> 
> Ok. I probably said this before, but I'm trying to create a pure
> hivemind project (no springs attached :D), I have nothing against
> Spring, on the opposite, I like it pretty much, I just don't see why
> use spring for some pieces that Hivemind + HiveUtils could easily get
> pretty well.
> 
> Ok, so I get in a real hard decision. Using AOP with spring means, all
> my beans must be managed by it, which they aren't anymore :D.
> 
> I tried Interceptors ... well I really would like to have a pattern
> for my methods, not apply it to all o 'em. I've checked out Jean's
> TransactionInterceptorFactory source code, and found that would take a
> pretty long way to do the same for my interceptors.
> 
> Ok, so we've few choices left:
> 
> AspectWerkz: I really like it, non intrusive in one aspect (uses
> proxies) but you gotta change your classloader, hum.. my tomcat turned
> just 300% slower with the new classloader. Out of question.

Not quite true. It has support for proxies, but the main part is pure bytecode.
You can do offline weaving so there is no need for special classloaders.


> 
> JBoss AOP: I'm a Tomcat user, I really get as far away from JBoss and
> EJB stuff as I can.
> 

Subjective comment: still young and still proxy based.

> AspectJ: Nice, fast, but too intrusive, and you can't debug your code anymore.
> 

What do you mean by intrusive? It is by no means intrusive. Afaik code is debuggable (maybe with 
some small problems).

Moreover the join of AW and AJ will produce something very nice. I recomment taking a look at it.

:alex |.::the_mindstorm::.|

> I was wondering if someone who've been using AOP with Hivemind in a
> project would care to share it's experiences / opinions ?
> 
> Regards
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


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


Re: Hivemind+Tomcat

Posted by Dmitry Kozakov <di...@java.crimea.com>.
I tried to put registry to the JNDI int the LifecycleListener

Context initCtx = new InitialContext();
initCtx.bind(HIVEMIND_REGISTRY_KEY,registry);

but I can not access to it at any web aaplication.

Code generate unboun exception
Context initCtx = new InitialContext();
initCtx.lookup(HIVEMIND_REGISTRY_KEY);

Best Regards,
	Dmitry



Heiko Braun wrote:

> Hi Dmitry,
>
> the registry itself is threadsafe. you only need to take care when 
> constructing it.
> that means you can either run it as a singleton or add it to a jndi 
> context.
> these are probably the simpliest solutions, i think.
>
> btw. does someone know about any performance issues
> when running a single registry in a heavily mutlithreaded environment?
>
> hth, heiko
>
> Dmitry Kozakov schrieb:
>
>> Hi
>> Hivemind has filter which can be set for web application
>> and can be used for working with registry.
>> But I want to setup Registry for all application which will be started
>> under Tomcat. It is possible to write LifecycleListener for Tomcat
>> and init/shutdown Registry there. But how to access that registry
>> in the web applications.  I did not find any solutions. May be somebody
>> confront with this problem?
>>
>> Best Regards,
>>     Dmitry
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>
>

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


Re: Hivemind+Tomcat

Posted by Heiko Braun <he...@openj.net>.
Hi Dmitry,

the registry itself is threadsafe. you only need to take care when 
constructing it.
that means you can either run it as a singleton or add it to a jndi context.
these are probably the simpliest solutions, i think.

btw. does someone know about any performance issues
when running a single registry in a heavily mutlithreaded environment?

hth, heiko

Dmitry Kozakov schrieb:

> Hi
> Hivemind has filter which can be set for web application
> and can be used for working with registry.
> But I want to setup Registry for all application which will be started
> under Tomcat. It is possible to write LifecycleListener for Tomcat
> and init/shutdown Registry there. But how to access that registry
> in the web applications.  I did not find any solutions. May be somebody
> confront with this problem?
>
> Best Regards,
>     Dmitry
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>


-- 

Heiko Braun

Mobil: +49 177 60 29 100
Skype: heiko_braun


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


Re: Hivemind+Tomcat

Posted by Dmitry Kozakov <di...@java.crimea.com>.
Yes. I undestand this.
But all services in my registry are global.
It means that they give common functionality - all parameters
and return types are primitive. And by the way I 'll use code of
the HivemindFilter for accessing the registry in the web app.

Best Regards,
	Dmitry



Catalin Grigoroscuta wrote:

> Hello,
>
> Note that with your approach, you need to be very careful about a 
> special kind of memory leak: If the registry is global across all 
> applications, it means it will hold strong references to the classes 
> of the application, which might hold references to classes loaded by 
> application class loaders.
> If this happends, when you will stop an application, tomcat lets the 
> application class loader to be garbage collected, in order to collect 
> all objects (and classes) of the application. But in your case, the 
> application class loader will never be garbage collected because of 
> references from Hivemind registry. This means that all web application 
> you ever started (and stopped) in Tomcat will remain in memory, and 
> will never be garbage collected.
>
> Regards,
> Catalin
>
> Dmitry Kozakov wrote:
>
>> Hi
>> Hivemind has filter which can be set for web application
>> and can be used for working with registry.
>> But I want to setup Registry for all application which will be started
>> under Tomcat. It is possible to write LifecycleListener for Tomcat
>> and init/shutdown Registry there. But how to access that registry
>> in the web applications.  I did not find any solutions. May be somebody
>> confront with this problem?
>>
>> Best Regards,
>>     Dmitry
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>

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


Re: Hivemind+Tomcat

Posted by Catalin Grigoroscuta <c....@moodmedia.ro>.
Hello,

Note that with your approach, you need to be very careful about a 
special kind of memory leak: If the registry is global across all 
applications, it means it will hold strong references to the classes of 
the application, which might hold references to classes loaded by 
application class loaders.
If this happends, when you will stop an application, tomcat lets the 
application class loader to be garbage collected, in order to collect 
all objects (and classes) of the application. But in your case, the 
application class loader will never be garbage collected because of 
references from Hivemind registry. This means that all web application 
you ever started (and stopped) in Tomcat will remain in memory, and will 
never be garbage collected.

Regards,
Catalin

Dmitry Kozakov wrote:

> Hi
> Hivemind has filter which can be set for web application
> and can be used for working with registry.
> But I want to setup Registry for all application which will be started
> under Tomcat. It is possible to write LifecycleListener for Tomcat
> and init/shutdown Registry there. But how to access that registry
> in the web applications.  I did not find any solutions. May be somebody
> confront with this problem?
>
> Best Regards,
>     Dmitry
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>


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


Hivemind+Tomcat

Posted by Dmitry Kozakov <di...@java.crimea.com>.
Hi
Hivemind has filter which can be set for web application
and can be used for working with registry.
But I want to setup Registry for all application which will be started
under Tomcat. It is possible to write LifecycleListener for Tomcat
and init/shutdown Registry there. But how to access that registry
in the web applications.  I did not find any solutions. May be somebody
confront with this problem?

Best Regards,
	Dmitry





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


RE: Hivemind + AOP : Which approach to take?

Posted by James Carman <ja...@carmanconsulting.com>.
Did this work for you guys?

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Thursday, July 28, 2005 10:19 PM
To: hivemind-user@jakarta.apache.org; 'Vinicius Carvalho'
Subject: RE: Hivemind + AOP : Which approach to take?

Guys, you might try creating a common superclass called
FilteredMethodInterceptor which takes a method name pattern or something as
a parameter (warning, this code is off the top of my head)...

public abstract class FilteredMethodInterceptor implements MethodInterceptor
{
  protected Object invokeImpl( MethodInvocation methodInvocation ) throws
Throwable;

  private String methodNamePattern;

  public void setMethodNamePattern( String methodNamePattern )
  {
    this.methodNamePattern = methodNamePattern;
  }

  public Object invoke( MethodInvocation methodInvocation ) throws Throwable
  {
    if(methodInvocation.getMethod().getName().matches(methodNamePattern))
    {
      Return invokeImpl( methodInvocation );
    }
    else
    {
      Return methodInvocation.proceed();
    }
  }
}

-----Original Message-----
From: Vinicius Carvalho [mailto:java.vinicius@gmail.com] 
Sent: Thursday, July 28, 2005 9:50 PM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivemind + AOP : Which approach to take?

Hum I've tried it here but...

<service-point interface="org.apache.hivemind.ServiceInterceptorFactory"
id="nullInterceptor">
	<invoke-factory>
		<construct
class="com.cs.interceptor.NullIdentityServiceInterceptor"/>
	</invoke-factory>
</service-point>

<service-point interface="com.cs.service.ICRUDService" id="produtoService">
	<invoke-factory model="singleton">
		<construct class="com.cs.service.CRUDService">
			<set-object property="dao"
value="service:produtoDAO"/>
		</construct>
	</invoke-factory>
	<interceptor service-id="hivetranse.core.TransactionInterceptor">
		<method pattern="*" demarcation="Required"/>
	</interceptor>
	<interceptor service-id="nullInterceptor"> 
          <include method="update*"/> 
    </interceptor>
</service-point>

Problem is that the interceptor is being called for all methods not
only the ones that start with update

Any ideas???


On 7/28/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> Thanks for the nice comments :)
> 
> About interceptors:
> they get applied to the methods according to
> MethodMatcher:
>
http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/meth
odmatch/MethodMatcher.html
> By default: all methods.
> See HM LoggingInterceptor example:
> http://jakarta.apache.org/hivemind/hivemind/LoggingInterceptor.html
> 
> note inlude and exclude parameters.
> 
> --- Vinicius Carvalho <ja...@gmail.com> wrote:
> 
> > Hey Konstantin, your page Rocks dude, I've seen your
> > comparisons
> > before, excellent work, really nice! It was good to
> > see some
> > comparisons between the many AOP approaches around,
> > I really took your
> > advices when choosing one :D
> >
> > Well what I was wondering about interceptors is that
> > after defining an
> > interceptor I can't tell which method to apply it.
> > I've seen you
> > examples : "HiveMindInstrumenter" and also the
> > Interceptor from
> > HiveUtils. I didn't get a chance to see your code,
> > but I guess you
> > must threat the pattern as well.
> >
> > The problem is, my developer team should take care
> > of that all the
> > time, so I'm more error prone than with regular
> > aspects where I could
> > have full control of pointcuts through xml. Of
> > course It's just
> > wondering... I haven't had the time to test it :P
> >
> > Thanks again
> >
> > On 7/28/05, Konstantin Ignatyev
> > <kg...@yahoo.com> wrote:
> > > And what exacly you cannot achieve with HiveMind
> > > interceptors? Why do you need/want a full AOP
> > system?
> > >
> > > Speaking of AspectWerkz - it has merged with
> > AspectJ.
> > > AspectJ - they actually regained sanity after the
> > > merger and now we do not have to use altered Java
> > > syntax (but need JVM 5). See
> > >
> >
> http://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj.html
> > >
> > >
> > > I have couple of comparisons between various AOP
> > > frameworks and you can see them here:
> > >
> >
> http://kgionline.com/presentations/aop_test/overview/doc/index.html
> > >  - work in progress, some links do no work;
> > > and here:
> > > http://kgionline.com/articles/aop_1/aop_perf.jsp
> > >
> > >
> > > --- linuja <li...@gmail.com> wrote:
> > >
> > > > With javassist, you can implement one very easy
> > > > yourself.
> > > > also, you can use the *Fab class of hivemind
> > > > directly.
> > > >
> > > > 2005/7/26, Vinicius Carvalho
> > > > <ja...@gmail.com>:
> > > > >
> > > > > Well it's me again (I guess ppl may be getting
> > > > tired of my questions)
> > > > >
> > > > > Ok. I probably said this before, but I'm
> > trying to
> > > > create a pure
> > > > > hivemind project (no springs attached :D), I
> > have
> > > > nothing against
> > > > > Spring, on the opposite, I like it pretty
> > much, I
> > > > just don't see why
> > > > > use spring for some pieces that Hivemind +
> > > > HiveUtils could easily get
> > > > > pretty well.
> > > > >
> > > > > Ok, so I get in a real hard decision. Using
> > AOP
> > > > with spring means, all
> > > > > my beans must be managed by it, which they
> > aren't
> > > > anymore :D.
> > > > >
> > > > > I tried Interceptors ... well I really would
> > like
> > > > to have a pattern
> > > > > for my methods, not apply it to all o 'em.
> > I've
> > > > checked out Jean's
> > > > > TransactionInterceptorFactory source code, and
> > > > found that would take a
> > > > > pretty long way to do the same for my
> > > > interceptors.
> > > > >
> > > > > Ok, so we've few choices left:
> > > > >
> > > > > AspectWerkz: I really like it, non intrusive
> > in
> > > > one aspect (uses
> > > > > proxies) but you gotta change your
> > classloader,
> > > > hum.. my tomcat turned
> > > > > just 300% slower with the new classloader. Out
> > of
> > > > question.
> > > > >
> > > > > JBoss AOP: I'm a Tomcat user, I really get as
> > far
> > > > away from JBoss and
> > > > > EJB stuff as I can.
> > > > >
> > > > > AspectJ: Nice, fast, but too intrusive, and
> > you
> > > > can't debug your code
> > > > > anymore.
> > > > >
> > > > > I was wondering if someone who've been using
> > AOP
> > > > with Hivemind in a
> > > > > project would care to share it's experiences /
> > > > opinions ?
> > > > >
> > > > > Regards
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > hivemind-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> > > > hivemind-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> >
> >
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen
million tons of carbon to the atmosphere, destroy 115 square miles of
tropical rainforest, create seventy-two miles of desert, eliminate between
forty to one hundred species, erode seventy-one million tons of topsoil, add
2,700 tons of CFCs to the stratosphere, and increase their population by
263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs
a Strategy for Reforming Universities and Public Schools.  New York:  State
University of New York Press, 1997: (4) (5) (p.206)
>

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




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



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


RE: Hivemind + AOP : Which approach to take?

Posted by James Carman <ja...@carmanconsulting.com>.
Guys, you might try creating a common superclass called
FilteredMethodInterceptor which takes a method name pattern or something as
a parameter (warning, this code is off the top of my head)...

public abstract class FilteredMethodInterceptor implements MethodInterceptor
{
  protected Object invokeImpl( MethodInvocation methodInvocation ) throws
Throwable;

  private String methodNamePattern;

  public void setMethodNamePattern( String methodNamePattern )
  {
    this.methodNamePattern = methodNamePattern;
  }

  public Object invoke( MethodInvocation methodInvocation ) throws Throwable
  {
    if(methodInvocation.getMethod().getName().matches(methodNamePattern))
    {
      Return invokeImpl( methodInvocation );
    }
    else
    {
      Return methodInvocation.proceed();
    }
  }
}

-----Original Message-----
From: Vinicius Carvalho [mailto:java.vinicius@gmail.com] 
Sent: Thursday, July 28, 2005 9:50 PM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivemind + AOP : Which approach to take?

Hum I've tried it here but...

<service-point interface="org.apache.hivemind.ServiceInterceptorFactory"
id="nullInterceptor">
	<invoke-factory>
		<construct
class="com.cs.interceptor.NullIdentityServiceInterceptor"/>
	</invoke-factory>
</service-point>

<service-point interface="com.cs.service.ICRUDService" id="produtoService">
	<invoke-factory model="singleton">
		<construct class="com.cs.service.CRUDService">
			<set-object property="dao"
value="service:produtoDAO"/>
		</construct>
	</invoke-factory>
	<interceptor service-id="hivetranse.core.TransactionInterceptor">
		<method pattern="*" demarcation="Required"/>
	</interceptor>
	<interceptor service-id="nullInterceptor"> 
          <include method="update*"/> 
    </interceptor>
</service-point>

Problem is that the interceptor is being called for all methods not
only the ones that start with update

Any ideas???


On 7/28/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> Thanks for the nice comments :)
> 
> About interceptors:
> they get applied to the methods according to
> MethodMatcher:
>
http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/meth
odmatch/MethodMatcher.html
> By default: all methods.
> See HM LoggingInterceptor example:
> http://jakarta.apache.org/hivemind/hivemind/LoggingInterceptor.html
> 
> note inlude and exclude parameters.
> 
> --- Vinicius Carvalho <ja...@gmail.com> wrote:
> 
> > Hey Konstantin, your page Rocks dude, I've seen your
> > comparisons
> > before, excellent work, really nice! It was good to
> > see some
> > comparisons between the many AOP approaches around,
> > I really took your
> > advices when choosing one :D
> >
> > Well what I was wondering about interceptors is that
> > after defining an
> > interceptor I can't tell which method to apply it.
> > I've seen you
> > examples : "HiveMindInstrumenter" and also the
> > Interceptor from
> > HiveUtils. I didn't get a chance to see your code,
> > but I guess you
> > must threat the pattern as well.
> >
> > The problem is, my developer team should take care
> > of that all the
> > time, so I'm more error prone than with regular
> > aspects where I could
> > have full control of pointcuts through xml. Of
> > course It's just
> > wondering... I haven't had the time to test it :P
> >
> > Thanks again
> >
> > On 7/28/05, Konstantin Ignatyev
> > <kg...@yahoo.com> wrote:
> > > And what exacly you cannot achieve with HiveMind
> > > interceptors? Why do you need/want a full AOP
> > system?
> > >
> > > Speaking of AspectWerkz - it has merged with
> > AspectJ.
> > > AspectJ - they actually regained sanity after the
> > > merger and now we do not have to use altered Java
> > > syntax (but need JVM 5). See
> > >
> >
> http://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj.html
> > >
> > >
> > > I have couple of comparisons between various AOP
> > > frameworks and you can see them here:
> > >
> >
> http://kgionline.com/presentations/aop_test/overview/doc/index.html
> > >  - work in progress, some links do no work;
> > > and here:
> > > http://kgionline.com/articles/aop_1/aop_perf.jsp
> > >
> > >
> > > --- linuja <li...@gmail.com> wrote:
> > >
> > > > With javassist, you can implement one very easy
> > > > yourself.
> > > > also, you can use the *Fab class of hivemind
> > > > directly.
> > > >
> > > > 2005/7/26, Vinicius Carvalho
> > > > <ja...@gmail.com>:
> > > > >
> > > > > Well it's me again (I guess ppl may be getting
> > > > tired of my questions)
> > > > >
> > > > > Ok. I probably said this before, but I'm
> > trying to
> > > > create a pure
> > > > > hivemind project (no springs attached :D), I
> > have
> > > > nothing against
> > > > > Spring, on the opposite, I like it pretty
> > much, I
> > > > just don't see why
> > > > > use spring for some pieces that Hivemind +
> > > > HiveUtils could easily get
> > > > > pretty well.
> > > > >
> > > > > Ok, so I get in a real hard decision. Using
> > AOP
> > > > with spring means, all
> > > > > my beans must be managed by it, which they
> > aren't
> > > > anymore :D.
> > > > >
> > > > > I tried Interceptors ... well I really would
> > like
> > > > to have a pattern
> > > > > for my methods, not apply it to all o 'em.
> > I've
> > > > checked out Jean's
> > > > > TransactionInterceptorFactory source code, and
> > > > found that would take a
> > > > > pretty long way to do the same for my
> > > > interceptors.
> > > > >
> > > > > Ok, so we've few choices left:
> > > > >
> > > > > AspectWerkz: I really like it, non intrusive
> > in
> > > > one aspect (uses
> > > > > proxies) but you gotta change your
> > classloader,
> > > > hum.. my tomcat turned
> > > > > just 300% slower with the new classloader. Out
> > of
> > > > question.
> > > > >
> > > > > JBoss AOP: I'm a Tomcat user, I really get as
> > far
> > > > away from JBoss and
> > > > > EJB stuff as I can.
> > > > >
> > > > > AspectJ: Nice, fast, but too intrusive, and
> > you
> > > > can't debug your code
> > > > > anymore.
> > > > >
> > > > > I was wondering if someone who've been using
> > AOP
> > > > with Hivemind in a
> > > > > project would care to share it's experiences /
> > > > opinions ?
> > > > >
> > > > > Regards
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > hivemind-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> > > > hivemind-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> >
> >
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen
million tons of carbon to the atmosphere, destroy 115 square miles of
tropical rainforest, create seventy-two miles of desert, eliminate between
forty to one hundred species, erode seventy-one million tons of topsoil, add
2,700 tons of CFCs to the stratosphere, and increase their population by
263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs
a Strategy for Reforming Universities and Public Schools.  New York:  State
University of New York Press, 1997: (4) (5) (p.206)
>

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




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


Re: Hivemind + AOP : Which approach to take?

Posted by Vinicius Carvalho <ja...@gmail.com>.
Hum I've tried it here but...

<service-point interface="org.apache.hivemind.ServiceInterceptorFactory"
id="nullInterceptor">
	<invoke-factory>
		<construct class="com.cs.interceptor.NullIdentityServiceInterceptor"/>
	</invoke-factory>
</service-point>

<service-point interface="com.cs.service.ICRUDService" id="produtoService">
	<invoke-factory model="singleton">
		<construct class="com.cs.service.CRUDService">
			<set-object property="dao" value="service:produtoDAO"/>
		</construct>
	</invoke-factory>
	<interceptor service-id="hivetranse.core.TransactionInterceptor">
		<method pattern="*" demarcation="Required"/>
	</interceptor>
	<interceptor service-id="nullInterceptor"> 
          <include method="update*"/> 
    </interceptor>
</service-point>

Problem is that the interceptor is being called for all methods not
only the ones that start with update

Any ideas???


On 7/28/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> Thanks for the nice comments :)
> 
> About interceptors:
> they get applied to the methods according to
> MethodMatcher:
> http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/methodmatch/MethodMatcher.html
> By default: all methods.
> See HM LoggingInterceptor example:
> http://jakarta.apache.org/hivemind/hivemind/LoggingInterceptor.html
> 
> note inlude and exclude parameters.
> 
> --- Vinicius Carvalho <ja...@gmail.com> wrote:
> 
> > Hey Konstantin, your page Rocks dude, I've seen your
> > comparisons
> > before, excellent work, really nice! It was good to
> > see some
> > comparisons between the many AOP approaches around,
> > I really took your
> > advices when choosing one :D
> >
> > Well what I was wondering about interceptors is that
> > after defining an
> > interceptor I can't tell which method to apply it.
> > I've seen you
> > examples : "HiveMindInstrumenter" and also the
> > Interceptor from
> > HiveUtils. I didn't get a chance to see your code,
> > but I guess you
> > must threat the pattern as well.
> >
> > The problem is, my developer team should take care
> > of that all the
> > time, so I'm more error prone than with regular
> > aspects where I could
> > have full control of pointcuts through xml. Of
> > course It's just
> > wondering... I haven't had the time to test it :P
> >
> > Thanks again
> >
> > On 7/28/05, Konstantin Ignatyev
> > <kg...@yahoo.com> wrote:
> > > And what exacly you cannot achieve with HiveMind
> > > interceptors? Why do you need/want a full AOP
> > system?
> > >
> > > Speaking of AspectWerkz - it has merged with
> > AspectJ.
> > > AspectJ - they actually regained sanity after the
> > > merger and now we do not have to use altered Java
> > > syntax (but need JVM 5). See
> > >
> >
> http://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj.html
> > >
> > >
> > > I have couple of comparisons between various AOP
> > > frameworks and you can see them here:
> > >
> >
> http://kgionline.com/presentations/aop_test/overview/doc/index.html
> > >  - work in progress, some links do no work;
> > > and here:
> > > http://kgionline.com/articles/aop_1/aop_perf.jsp
> > >
> > >
> > > --- linuja <li...@gmail.com> wrote:
> > >
> > > > With javassist, you can implement one very easy
> > > > yourself.
> > > > also, you can use the *Fab class of hivemind
> > > > directly.
> > > >
> > > > 2005/7/26, Vinicius Carvalho
> > > > <ja...@gmail.com>:
> > > > >
> > > > > Well it's me again (I guess ppl may be getting
> > > > tired of my questions)
> > > > >
> > > > > Ok. I probably said this before, but I'm
> > trying to
> > > > create a pure
> > > > > hivemind project (no springs attached :D), I
> > have
> > > > nothing against
> > > > > Spring, on the opposite, I like it pretty
> > much, I
> > > > just don't see why
> > > > > use spring for some pieces that Hivemind +
> > > > HiveUtils could easily get
> > > > > pretty well.
> > > > >
> > > > > Ok, so I get in a real hard decision. Using
> > AOP
> > > > with spring means, all
> > > > > my beans must be managed by it, which they
> > aren't
> > > > anymore :D.
> > > > >
> > > > > I tried Interceptors ... well I really would
> > like
> > > > to have a pattern
> > > > > for my methods, not apply it to all o 'em.
> > I've
> > > > checked out Jean's
> > > > > TransactionInterceptorFactory source code, and
> > > > found that would take a
> > > > > pretty long way to do the same for my
> > > > interceptors.
> > > > >
> > > > > Ok, so we've few choices left:
> > > > >
> > > > > AspectWerkz: I really like it, non intrusive
> > in
> > > > one aspect (uses
> > > > > proxies) but you gotta change your
> > classloader,
> > > > hum.. my tomcat turned
> > > > > just 300% slower with the new classloader. Out
> > of
> > > > question.
> > > > >
> > > > > JBoss AOP: I'm a Tomcat user, I really get as
> > far
> > > > away from JBoss and
> > > > > EJB stuff as I can.
> > > > >
> > > > > AspectJ: Nice, fast, but too intrusive, and
> > you
> > > > can't debug your code
> > > > > anymore.
> > > > >
> > > > > I was wondering if someone who've been using
> > AOP
> > > > with Hivemind in a
> > > > > project would care to share it's experiences /
> > > > opinions ?
> > > > >
> > > > > Regards
> > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > hivemind-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> > > > hivemind-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> >
> >
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)
>

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


Re: Hivemind + AOP : Which approach to take?

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
Thanks for the nice comments :)

About interceptors:
they get applied to the methods according to
MethodMatcher: 
http://jakarta.apache.org/hivemind/hivemind/apidocs/org/apache/hivemind/methodmatch/MethodMatcher.html
By default: all methods.
See HM LoggingInterceptor example:
http://jakarta.apache.org/hivemind/hivemind/LoggingInterceptor.html

note inlude and exclude parameters. 

--- Vinicius Carvalho <ja...@gmail.com> wrote:

> Hey Konstantin, your page Rocks dude, I've seen your
> comparisons
> before, excellent work, really nice! It was good to
> see some
> comparisons between the many AOP approaches around,
> I really took your
> advices when choosing one :D
> 
> Well what I was wondering about interceptors is that
> after defining an
> interceptor I can't tell which method to apply it.
> I've seen you
> examples : "HiveMindInstrumenter" and also the
> Interceptor from
> HiveUtils. I didn't get a chance to see your code,
> but I guess you
> must threat the pattern as well.
> 
> The problem is, my developer team should take care
> of that all the
> time, so I'm more error prone than with regular
> aspects where I could
> have full control of pointcuts through xml. Of
> course It's just
> wondering... I haven't had the time to test it :P
> 
> Thanks again
> 
> On 7/28/05, Konstantin Ignatyev
> <kg...@yahoo.com> wrote:
> > And what exacly you cannot achieve with HiveMind
> > interceptors? Why do you need/want a full AOP
> system?
> > 
> > Speaking of AspectWerkz - it has merged with
> AspectJ.
> > AspectJ - they actually regained sanity after the
> > merger and now we do not have to use altered Java
> > syntax (but need JVM 5). See
> >
>
http://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj.html
> > 
> > 
> > I have couple of comparisons between various AOP
> > frameworks and you can see them here:
> >
>
http://kgionline.com/presentations/aop_test/overview/doc/index.html
> >  - work in progress, some links do no work;
> > and here:
> > http://kgionline.com/articles/aop_1/aop_perf.jsp
> > 
> > 
> > --- linuja <li...@gmail.com> wrote:
> > 
> > > With javassist, you can implement one very easy
> > > yourself.
> > > also, you can use the *Fab class of hivemind
> > > directly.
> > >
> > > 2005/7/26, Vinicius Carvalho
> > > <ja...@gmail.com>:
> > > >
> > > > Well it's me again (I guess ppl may be getting
> > > tired of my questions)
> > > >
> > > > Ok. I probably said this before, but I'm
> trying to
> > > create a pure
> > > > hivemind project (no springs attached :D), I
> have
> > > nothing against
> > > > Spring, on the opposite, I like it pretty
> much, I
> > > just don't see why
> > > > use spring for some pieces that Hivemind +
> > > HiveUtils could easily get
> > > > pretty well.
> > > >
> > > > Ok, so I get in a real hard decision. Using
> AOP
> > > with spring means, all
> > > > my beans must be managed by it, which they
> aren't
> > > anymore :D.
> > > >
> > > > I tried Interceptors ... well I really would
> like
> > > to have a pattern
> > > > for my methods, not apply it to all o 'em.
> I've
> > > checked out Jean's
> > > > TransactionInterceptorFactory source code, and
> > > found that would take a
> > > > pretty long way to do the same for my
> > > interceptors.
> > > >
> > > > Ok, so we've few choices left:
> > > >
> > > > AspectWerkz: I really like it, non intrusive
> in
> > > one aspect (uses
> > > > proxies) but you gotta change your
> classloader,
> > > hum.. my tomcat turned
> > > > just 300% slower with the new classloader. Out
> of
> > > question.
> > > >
> > > > JBoss AOP: I'm a Tomcat user, I really get as
> far
> > > away from JBoss and
> > > > EJB stuff as I can.
> > > >
> > > > AspectJ: Nice, fast, but too intrusive, and
> you
> > > can't debug your code
> > > > anymore.
> > > >
> > > > I was wondering if someone who've been using
> AOP
> > > with Hivemind in a
> > > > project would care to share it's experiences /
> > > opinions ?
> > > >
> > > > Regards
> > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > hivemind-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > hivemind-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> hivemind-user-help@jakarta.apache.org
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> hivemind-user-help@jakarta.apache.org
> 
> 


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)

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


Re: Hivemind + AOP : Which approach to take?

Posted by Vinicius Carvalho <ja...@gmail.com>.
Hey Konstantin, your page Rocks dude, I've seen your comparisons
before, excellent work, really nice! It was good to see some
comparisons between the many AOP approaches around, I really took your
advices when choosing one :D

Well what I was wondering about interceptors is that after defining an
interceptor I can't tell which method to apply it. I've seen you
examples : "HiveMindInstrumenter" and also the Interceptor from
HiveUtils. I didn't get a chance to see your code, but I guess you
must threat the pattern as well.

The problem is, my developer team should take care of that all the
time, so I'm more error prone than with regular aspects where I could
have full control of pointcuts through xml. Of course It's just
wondering... I haven't had the time to test it :P

Thanks again

On 7/28/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> And what exacly you cannot achieve with HiveMind
> interceptors? Why do you need/want a full AOP system?
> 
> Speaking of AspectWerkz - it has merged with AspectJ.
> AspectJ - they actually regained sanity after the
> merger and now we do not have to use altered Java
> syntax (but need JVM 5). See
> http://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj.html
> 
> 
> I have couple of comparisons between various AOP
> frameworks and you can see them here:
> http://kgionline.com/presentations/aop_test/overview/doc/index.html
>  - work in progress, some links do no work;
> and here:
> http://kgionline.com/articles/aop_1/aop_perf.jsp
> 
> 
> --- linuja <li...@gmail.com> wrote:
> 
> > With javassist, you can implement one very easy
> > yourself.
> > also, you can use the *Fab class of hivemind
> > directly.
> >
> > 2005/7/26, Vinicius Carvalho
> > <ja...@gmail.com>:
> > >
> > > Well it's me again (I guess ppl may be getting
> > tired of my questions)
> > >
> > > Ok. I probably said this before, but I'm trying to
> > create a pure
> > > hivemind project (no springs attached :D), I have
> > nothing against
> > > Spring, on the opposite, I like it pretty much, I
> > just don't see why
> > > use spring for some pieces that Hivemind +
> > HiveUtils could easily get
> > > pretty well.
> > >
> > > Ok, so I get in a real hard decision. Using AOP
> > with spring means, all
> > > my beans must be managed by it, which they aren't
> > anymore :D.
> > >
> > > I tried Interceptors ... well I really would like
> > to have a pattern
> > > for my methods, not apply it to all o 'em. I've
> > checked out Jean's
> > > TransactionInterceptorFactory source code, and
> > found that would take a
> > > pretty long way to do the same for my
> > interceptors.
> > >
> > > Ok, so we've few choices left:
> > >
> > > AspectWerkz: I really like it, non intrusive in
> > one aspect (uses
> > > proxies) but you gotta change your classloader,
> > hum.. my tomcat turned
> > > just 300% slower with the new classloader. Out of
> > question.
> > >
> > > JBoss AOP: I'm a Tomcat user, I really get as far
> > away from JBoss and
> > > EJB stuff as I can.
> > >
> > > AspectJ: Nice, fast, but too intrusive, and you
> > can't debug your code
> > > anymore.
> > >
> > > I was wondering if someone who've been using AOP
> > with Hivemind in a
> > > project would care to share it's experiences /
> > opinions ?
> > >
> > > Regards
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > hivemind-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > hivemind-user-help@jakarta.apache.org
> > >
> > >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

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


Re: Hivemind + AOP : Which approach to take?

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
And what exacly you cannot achieve with HiveMind
interceptors? Why do you need/want a full AOP system?

Speaking of AspectWerkz - it has merged with AspectJ.
AspectJ - they actually regained sanity after the
merger and now we do not have to use altered Java
syntax (but need JVM 5). See
http://www.eclipse.org/aspectj/doc/next/adk15notebook/ataspectj.html


I have couple of comparisons between various AOP
frameworks and you can see them here:
http://kgionline.com/presentations/aop_test/overview/doc/index.html
 - work in progress, some links do no work;
and here:
http://kgionline.com/articles/aop_1/aop_perf.jsp


--- linuja <li...@gmail.com> wrote:

> With javassist, you can implement one very easy
> yourself.
> also, you can use the *Fab class of hivemind
> directly.
> 
> 2005/7/26, Vinicius Carvalho
> <ja...@gmail.com>:
> > 
> > Well it's me again (I guess ppl may be getting
> tired of my questions)
> > 
> > Ok. I probably said this before, but I'm trying to
> create a pure
> > hivemind project (no springs attached :D), I have
> nothing against
> > Spring, on the opposite, I like it pretty much, I
> just don't see why
> > use spring for some pieces that Hivemind +
> HiveUtils could easily get
> > pretty well.
> > 
> > Ok, so I get in a real hard decision. Using AOP
> with spring means, all
> > my beans must be managed by it, which they aren't
> anymore :D.
> > 
> > I tried Interceptors ... well I really would like
> to have a pattern
> > for my methods, not apply it to all o 'em. I've
> checked out Jean's
> > TransactionInterceptorFactory source code, and
> found that would take a
> > pretty long way to do the same for my
> interceptors.
> > 
> > Ok, so we've few choices left:
> > 
> > AspectWerkz: I really like it, non intrusive in
> one aspect (uses
> > proxies) but you gotta change your classloader,
> hum.. my tomcat turned
> > just 300% slower with the new classloader. Out of
> question.
> > 
> > JBoss AOP: I'm a Tomcat user, I really get as far
> away from JBoss and
> > EJB stuff as I can.
> > 
> > AspectJ: Nice, fast, but too intrusive, and you
> can't debug your code 
> > anymore.
> > 
> > I was wondering if someone who've been using AOP
> with Hivemind in a
> > project would care to share it's experiences /
> opinions ?
> > 
> > Regards
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> hivemind-user-help@jakarta.apache.org
> > 
> >
> 


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


Re: Hivemind + AOP : Which approach to take?

Posted by linuja <li...@gmail.com>.
With javassist, you can implement one very easy yourself.
also, you can use the *Fab class of hivemind directly.

2005/7/26, Vinicius Carvalho <ja...@gmail.com>:
> 
> Well it's me again (I guess ppl may be getting tired of my questions)
> 
> Ok. I probably said this before, but I'm trying to create a pure
> hivemind project (no springs attached :D), I have nothing against
> Spring, on the opposite, I like it pretty much, I just don't see why
> use spring for some pieces that Hivemind + HiveUtils could easily get
> pretty well.
> 
> Ok, so I get in a real hard decision. Using AOP with spring means, all
> my beans must be managed by it, which they aren't anymore :D.
> 
> I tried Interceptors ... well I really would like to have a pattern
> for my methods, not apply it to all o 'em. I've checked out Jean's
> TransactionInterceptorFactory source code, and found that would take a
> pretty long way to do the same for my interceptors.
> 
> Ok, so we've few choices left:
> 
> AspectWerkz: I really like it, non intrusive in one aspect (uses
> proxies) but you gotta change your classloader, hum.. my tomcat turned
> just 300% slower with the new classloader. Out of question.
> 
> JBoss AOP: I'm a Tomcat user, I really get as far away from JBoss and
> EJB stuff as I can.
> 
> AspectJ: Nice, fast, but too intrusive, and you can't debug your code 
> anymore.
> 
> I was wondering if someone who've been using AOP with Hivemind in a
> project would care to share it's experiences / opinions ?
> 
> Regards
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
>

Re: Hivemind + AOP : Which approach to take?

Posted by Achim Hügen <ac...@gmx.de>.
I haven't tried it in combination with hivemind, but dynaop may be worth a 
look:
https://dynaop.dev.java.net/

It has a really slim und easy api and doesn't need
special classloaders. It aspectizes your class on the fly.

Achim

Am Tue, 26 Jul 2005 00:15:20 -0300 schrieb Vinicius Carvalho 
<ja...@gmail.com>:

> Well it's me again (I guess ppl may be getting tired of my questions)
>
> Ok. I probably said this before, but I'm trying to create a pure
> hivemind project (no springs attached :D), I have nothing against
> Spring, on the opposite, I like it pretty much, I just don't see why
> use spring for some pieces that Hivemind + HiveUtils could easily get
> pretty well.
>
> Ok, so I get in a real hard decision. Using AOP with spring means, all
> my beans must be managed by it, which they aren't anymore :D.
>
> I tried Interceptors ... well I really would like to have a pattern
> for my methods, not apply it to all o 'em. I've checked out Jean's
> TransactionInterceptorFactory source code, and found that would take a
> pretty long way to do the same for my interceptors.
>
> Ok, so we've few choices left:
>
> AspectWerkz: I really like it, non intrusive in one aspect (uses
> proxies) but you gotta change your classloader, hum.. my tomcat turned
> just 300% slower with the new classloader. Out of question.
>
> JBoss AOP: I'm a Tomcat user, I really get as far away from JBoss and
> EJB stuff as I can.
>
> AspectJ: Nice, fast, but too intrusive, and you can't debug your code 
> anymore.
>
> I was wondering if someone who've been using AOP with Hivemind in a
> project would care to share it's experiences / opinions ?
>
> Regards
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-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