Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Instance of aspect

Thanks for the reply, Wes. I am not sure it did not work on Win2K box. I tried the exact same thing on Linux box & it worked. I will repeat my tests again and will report a bug, if the problem persists :-)

Thanks,


From: Wes Isberg <wes@xxxxxxxxxxxxxx>
Reply-To: aspectj-users@xxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Instance of aspect
Date: Thu, 25 Sep 2003 15:17:55 -0700

Given

    public aspect Test {
        public static String methodName = "";
        ...
     }

This should work

   {  ... Test.methodName = "foo"; ... }

if Test is in the default package[1] and the class is on
your classpath at compile-time (when using javac or ajc)
or the source file is in the list of sources (when using
ajc).  If it doesn't work, please submit a bug.

Just be sure at runtime the Test class was the same Class
for your RMI server and any type affected by the aspect.
That's a matter of your particular system configuration.

Wes

[1] and not hidden by another unqualified type Test

varanasi kiran wrote:

Hi,
I have an aspect which has a static variable defined. I want to set the value to this static variable using a RMI Server class. Can anyone suggest how can I do this?

Since aspect is just another java class (logically), I tried to access the static varaiable to some value & it does not compile. I tried to compile using ajc, BTW.

Following is my aspect:

public aspect Test {
 public static String methodName = "";

 pointcut callServlet() : execution ( * javax.servlet..*.*(..) );

 before() : callServlet() {
   System.out.println(" Method Name: " + methodName );
 }
}

I tried to access "methodName" in RMI Server impl class as: Test.methodName.


Thanks in advance,

_________________________________________________________________
Keep up with the pace of change. Register for My Tech Ed. http://server1.msn.co.in/sp03/teched/index.asp Realise your potential!

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

_________________________________________________________________
Calling all NRIs! Avail of the best financial services. http://server1.msn.co.in/msnspecials/nriservices/index.asp Smile all the way with ICICI Bank.



Back to the top