|
From: Bryant H. <bry...@ho...> - 2007-10-13 19:40:33
|
Hi,
I had an idea for using annotations to mark various methods in our =
business tier as corresponding to various business events =
(milestones)... ala something like this.
public class MyClass {
public void someMethod() {
method1();
method2();
}
@BusinessMilestone(description=3D"...");
protected void method1() {
...
}
@BusinessMilestone(description=3D"...");
protected void method2() {
...
}
}
The idea is to use the annotations to specify the point cuts where I can =
inject some auditing advice to record these milestones. I thought this =
would be a real quick way for us to specify this sort of thing. My only =
problem is it won't work with any sort of proxying mechanism. If you =
use a proxy, only an external call to 'someMethod' would go through the =
proxy. The internal calls to method1 and method2 (the ones that would =
need interception to apply the advice) won't go through the proxy.
So what I need is not a CGlib proxy, but an actual CGLib enhanced object =
where the point cuts are baked in to my actual object so that I can =
apply the advice.
Is there a way in Spring to accomplish something like this?
Thanks,
Bryant |
|
From: Ramnivas L. <ram...@in...> - 2007-10-14 01:58:39
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
You should be able to implement this functionality using AspectJ
weaving. Please consult AspectJ documentation for more details.<br>
<br>
-Ramnivas<br>
<br>
Bryant Harris wrote:
<blockquote cite="mid:BAY...@ph..."
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.6000.16544" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Hi,</font></div>
<div><font face="Arial" size="2"> I had an idea for using
annotations to mark various methods in our business tier as
corresponding to various business events (milestones)... ala something
like this.</font></div>
<div> </div>
<div><font face="Courier" size="2">public class MyClass {</font></div>
<div><font face="Courier" size="2"> public void someMethod() {</font></div>
<div><font face="Courier" size="2"> method1();</font></div>
<div><font face="Courier" size="2"> method2();</font></div>
<div><font face="Courier" size="2"> }</font></div>
<div> </div>
<div><font face="Courier" size="2">
@BusinessMilestone(description="...");</font></div>
<div><font face="Courier" size="2"> protected void method1() {</font></div>
<div><font face="Courier" size="2"> ..</font></div>
<div><font face="Courier" size="2"> }</font></div>
<div> </div>
<div><font face="Courier" size="2">
@BusinessMilestone(description="...");</font></div>
<div><font face="Courier" size="2"> protected void method2() {</font></div>
<div><font face="Courier" size="2"> ..</font></div>
<div><font face="Courier" size="2"> }</font></div>
<div><font face="Courier" size="2">}</font></div>
<div> </div>
<div><font face="Arial" size="2">The idea is to use the annotations
to specify the point cuts where I can inject some auditing advice to
record these milestones. I thought this would be a real quick way for
us to specify this sort of thing. My only problem is it won't work
with any sort of proxying mechanism. If you use a proxy, only an
external call to 'someMethod' would go through the proxy. The internal
calls to method1 and method2 (the ones that would need interception to
apply the advice) won't go through the proxy.</font></div>
<div> </div>
<div><font face="Arial" size="2">So what I need is not a CGlib proxy,
but an actual CGLib enhanced object where the point cuts are baked in
to my actual object so that I can apply the advice.</font></div>
<div><font face="Arial" size="2">Is there a way in Spring to
accomplish something like this?</font></div>
<div> </div>
<div><font face="Arial" size="2">Thanks,</font></div>
<div> </div>
<div><font face="Arial" size="2">Bryant</font></div>
<pre wrap="">
<hr size="4" width="90%">
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> <a class="moz-txt-link-freetext" href="http://get.splunk.com/">http://get.splunk.com/</a></pre>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Springframework-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Spr...@li...">Spr...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/springframework-developer">https://lists.sourceforge.net/lists/listinfo/springframework-developer</a>
</pre>
</blockquote>
<br>
</body>
</html>
|
|
From: vijay k. <vij...@gm...> - 2007-10-14 12:42:37
|
Yes, I agree with RamNivas.
On 10/14/07, Ramnivas Laddad <ram...@in...> wrote:
>
> You should be able to implement this functionality using AspectJ weaving.
> Please consult AspectJ documentation for more details.
>
> -Ramnivas
>
> Bryant Harris wrote:
>
> Hi,
> I had an idea for using annotations to mark various methods in our
> business tier as corresponding to various business events (milestones)...
> ala something like this.
>
> public class MyClass {
> public void someMethod() {
> method1();
> method2();
> }
>
> @BusinessMilestone(description="...");
> protected void method1() {
> ..
> }
>
> @BusinessMilestone(description="...");
> protected void method2() {
> ..
> }
> }
>
> The idea is to use the annotations to specify the point cuts where I can
> inject some auditing advice to record these milestones. I thought this
> would be a real quick way for us to specify this sort of thing. My only
> problem is it won't work with any sort of proxying mechanism. If you use a
> proxy, only an external call to 'someMethod' would go through the proxy.
> The internal calls to method1 and method2 (the ones that would need
> interception to apply the advice) won't go through the proxy.
>
> So what I need is not a CGlib proxy, but an actual CGLib enhanced object
> where the point cuts are baked in to my actual object so that I can apply
> the advice.
> Is there a way in Spring to accomplish something like this?
>
> Thanks,
>
> Bryant
>
> ------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
> ------------------------------
>
> _______________________________________________
> Springframework-developer mailing lis...@li...://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
--
Vijay Kumar Kuruva,
ASE,
Accenture services pvt ltd,
mobile:09920468458
|