Compile Time weaving is out because I have to weave into Swing itself. I'm
not about to recompile anything that's in javax or java. I have looked at
that page and found the -debug option, which gives me what you see below.
Now this tells me that my code gets woven (as it should), org.jdesktop is
excluded (as it should) and javax.swing is never even passed to the weaver.
Why? The -Xset:weaveJavaxPackages=true is there, and <include
within="javax.swing..*"/> is there too.


[appclassloa...@19134f4] debug weaving '<mystuff>.AppClientApp'   //this is
my main() class
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SingleFrameApplication'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Application'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.AbstractBean'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.AbstractBean$EDTPropertyChangeSupport'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Application$NotifyingEvent'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Application$NoApplication'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Application$1'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ApplicationContext'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceManager'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ActionManager'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ApplicationActionMap'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.LocalStorage'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.LocalStorage$LocalIO'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.LocalStorage$PersistenceServiceIO'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.LocalStorage$LocalFileIO'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.LocalStorage$LSException'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.LocalStorage$RectanglePD'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SessionStorage'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SessionStorage$WindowProperty'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SessionStorage$Property'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SessionStorage$TabbedPaneProperty'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SessionStorage$SplitPaneProperty'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.SessionStorage$TableProperty'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.TaskService'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.TaskService$TaskPCL'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$ResourceConverterException'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$InjectFieldException'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$PropertyInjectionException'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$LookupException'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$ColorStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$BooleanResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$IntegerResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$INumberResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$MessageFormatResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$FloatResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$NumberResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$DoubleResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$LongResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$ShortResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$ByteResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$URLResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceConverter$URIResourceConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$IconStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$ImageStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$FontStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$KeyStrokeStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$DimensionStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$PointStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$RectangleStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$InsetsStringConverter'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.ResourceMap$EmptyBorderStringConverter'
Xlib:  extension "RANDR" missing on display ":0.0".
Sep 28, 2009 10:46:36 AM <mystuff>.AppClientApp setupLogger
INFO: Logger started: Mon Sep 28 10:46:36 CEST 2009
[appclassloa...@19134f4] debug weaving '<mystuff>.AppClientLoginFrame'
[methodu...@1402eeb] info AspectJ Weaver Version 1.6.5 built on Thursday Jun
18, 2009 at 03:42:32 GMT
[methodu...@1402eeb] info register classloader
sun.reflect.misc.methodu...@1402eeb
[methodu...@1402eeb] info using configuration
file:/<mystuff>/workspace/Client/lib/tooltipWrangler.jar!/META-INF/aop.xml
[methodu...@1402eeb] info register aspect <mystuff>.Wrangler
[methodu...@1402eeb] debug cannot weave 'sun.reflect.misc.Trampoline'
[appclassloa...@19134f4] debug weaving '<mystuff>.AppClientLoginFrame$1'
[appclassloa...@19134f4] debug weaving '<mystuff>.AppClientApp$1'
[appclassloa...@19134f4] debug not weaving 'org.jdesktop.application.View'
[appclassloa...@19134f4] debug weaving '<mystuff>.AppClientView'
[appclassloa...@19134f4] weaveinfo Join point 'method-call(java.lang.String
javax.swing.JMenuItem.getToolTipText())' in Type '<mystuff>.AppClientView'
(AppClientView.java:596) advised by before advice from '<mystuff>.Wrangler'
(Wrangler.aj:33)
[appclassloa...@19134f4] weaveinfo Join point 'method-call(java.lang.String
javax.swing.JMenuItem.getToolTipText(java.awt.event.MouseEvent))' in Type
'<mystuff>.AppClientView' (AppClientView.java:598) advised by before advice
from '<mystuff>.Wrangler' (Wrangler.aj:12)
[appclassloa...@19134f4] weaveinfo Join point 'method-call(void
<mystuff>.ToolTipSettings.omgAfunction())' in Type '<mystuff>.AppClientView'
(AppClientView.java:599) advised by before advice from '<mystuff>.Wrangler'
(Wrangler.aj:40)
[appclassloa...@19134f4] weaveinfo Join point 'method-call(void
<mystuff>.ToolTipSettings.omganotherfunction())' in Type
'<mystuff>.AppClientView' (AppClientView.java:601) advised by before advice
from <mystuff>.Wrangler' (Wrangler.aj:46)
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.FrameView'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Application$DoWaitForEmptyEventQ'
[appclassloa...@19134f4] debug not weaving 'org.jdesktop.application.Task'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.AccumulativeRunnable'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$4'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingPropertyChangeSupport'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$3'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$DoSubmitAccumulativeRunnable'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$2'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$1'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$StateValue'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Task$StatePCL'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$6'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$7'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingPropertyChangeSupport$1'
[appclassloa...@19134f4] debug not weaving 'org.jdesktop.application.Task$1'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.Task$BlockingScope'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.application.TaskEvent'
[appclassloa...@19134f4] debug not weaving
'org.jdesktop.swingworker.SwingWorker$5'


2009/9/25 Andy Clement <[email protected]>

> Hi,
>
> Take a look at:
> http://andrewclement.blogspot.com/2009/02/load-time-weaving-basics.html
> and try some of the debug/verbose options there - that will tell you
> whether the classloader is able to pass the types you are interested
> to a weaver.  If they cannot be passed to a weaver they will never be
> woven, regardless of options or pointcuts.  Can you use compile time
> weaving? That would definetly work.
>
> Andy
>
> 2009/9/25 Kajetan Abt <[email protected]>:
> > That did not work, I get an identical behaviour. Still, thanks for
> finding a
> > bug.
> >
> > 2009/9/25 <[email protected]>
> >>
> >> I have made the same error few months ago. You have to set only one Xset
> >> like :
> >>
> >> -Xset:weaveJavaxPackages=true,weaveJavaPackages=true
> >>
> >>
> >>
> >>
> >>
> >> Jean-Louis Pasturel
> >>
> >>
> >>
> >> ________________________________
> >>
> >> De : [email protected]
> >> [mailto:[email protected]] De la part de Kajetan Abt
> >> Envoyé : vendredi 25 septembre 2009 14:14
> >> À : [email protected]
> >> Objet : [aspectj-users] LTW into javax.swing
> >>
> >>
> >>
> >> What I am trying to do: Swing has support for Tooltips, but that
> >> functionality is very basic. There are two functions (SetToolTip() and
> >> GetToolTip()) which either take a String argument or return one. I would
> >> like to have different Tooltips, to be precise, different verbosity
> levels,
> >> for all tooltips in my project. Of course I could either overload all
> used
> >> JComponents (hah!) or use some other nontrivial approach (manage my own
> >> listeners...) to set these values anew every time the user changes the
> >> verbosity level.
> >>
> >> But on the other hand, having an Aspect weave into GetToolTip() would
> >> instantly solve my issues, as I could then change the return parameter
> (read
> >> from a properties file). I have managed to figure out how to basically
> do
> >> this, and it works, as long as I am weaving into my own code (I suppose
> it
> >> would work at compile time even). But for some reason, weaving into
> Swing
> >> fails without error messages, it just does not happen. I assume the
> class
> >> loader has my classes prepared before the weaver kicks in, but I have
> >> absolutely no idea how to do that different. There is also not a lot of
> >> literature on the subject and I only assume this happens because I've
> read
> >> somewhere that writing a classloader might be necessary (without
> explanation
> >> as to why or how). I am settnig the option to the weaver to include
> javax,
> >> but it won't find JComponent. If I don't exclude the org.jdesktop
> package,
> >> it even tries to find the superclasses of some of the jdesktop parts at
> >> javax.jnlp.*, so it doesn't completely fail.
> >> As for the call I want to intercept: javax.swing.ToolTipManager is the
> >> class that calls my target function. It never gets woven.
> >>
> >> As for the code I use:
> >>
> >> aop.xml:
> >>          <aspectj>
> >>             <aspects>
> >>               <aspect name="<something>.weaver.
> >>
> >> Wrangler"/>
> >>                <include within="<something>..*"/>
> >>                <include within="javax.swing..*"/>
> >>                <exclude within="org.jdesktop..*"/>
> >>             </aspects>
> >>             <weaver options="-verbose -Xset:weaveJavaxPackages=true
> >> -Xset:weaveJavaPackages=true -showWeaveInfo" >
> >>                <include within="<something>..*"/>
> >>                <include within="javax.swing..*"/>
> >>                <exclude within="org.jdesktop..*"/>
> >>             </weaver>
> >>           </aspectj>
> >>
> >> public aspect Wrangler {
> >>     before(JComponent component):
> >>         call( public String JComponent.getToolTipText(MouseEvent) )
> >>         && target(component)
> >>         {
> >>             System.out.println("Intercepted!");
> >>             //target.setToolTip("My new thing");
> >>         }
> >> }
> >>
> >> The output I get:
> >> [appclassloa...@19134f4] weaveinfo Join point
> >> 'method-call(java.lang.String javax.swing.JMenuItem.getToolTipText())'
> in
> >> Type <something>.gui.AppClientView' (AppClientView.java:596) advised by
> >> before advice from '<something>.weaver.Wrangler' (Wrangler.aj:33)
> >>
> >> And all other calls I make myself. Changing this to execution or
> anything
> >> like that does not help at all. No Javax.Swing classes are woven at all.
> >>
> >> *********************************
> >> This message and any attachments (the "message") are confidential and
> >> intended solely for the addressees.
> >> Any unauthorised use or dissemination is prohibited.
> >> Messages are susceptible to alteration.
> >> France Telecom Group shall not be liable for the message if altered,
> >> changed or falsified.
> >> If you are not the intended addressee of this message, please cancel it
> >> immediately and inform the sender.
> >> ********************************
> >>
> >> _______________________________________________
> >> aspectj-users mailing list
> >> [email protected]
> >> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >>
> >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > [email protected]
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to