Re: [aspectj-users] AOP With Weblogic

2016-07-22 Thread Andy Clement
I’m afraid I’m no expert on weblogic configuration. I’d say perhaps search the 
AspectJ mailing list archive for an answer ( 
http://dev.eclipse.org/mhonarc/lists/aspectj-users/ 
 ) - or try stack 
overflow, there are quite a few people answering AspectJ questions on there.

cheers,
Andy

> On Jul 19, 2016, at 3:54 AM, Vivek  wrote:
> 
> Hi,
> We have a need to measure API Execution time for an Application deployed on 
> Weblogic 10.3.6 server.
> 
> Need is to print a report as in following line in a log report:
> 
> API org.foo.bar.createObject(String, List) took 20 ms to execute.
> ..
> ..
> 
> I have done the similar implementation with AspectJ AOP on a JUnit framework, 
> and is working as expected. All I had to do was put the Aspect Class file 
> with advice to measure exec time in CLASSPATH and mention Java Agent at the 
> run time to achieve this LTW.
> 
> Now, when I started exploring Server side, Weblogic provides many options 
> like WLDF, Flight Recorder , Diagnostics and Monitoring controls throug UI  
> etc. 
> Though they spit out very sophisticated information, I could not figureout 
> how to print a log as I needed above. 
> 
> Appreciate any pointers on how to print API execution time for a given 
> package/class deployed on a Weblogic Server domain.
> 
> Thanks
> Vivek
> 
> 
> 
> -- 
> ---
> From: Vivek A. Kulkarni
> ---
> ___
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: [aspectj-users] Hook Thread Creations

2016-07-22 Thread Andy Clement

aspect X {
  before(): call(Thread.new(..)) { // Thread constructor called
System.out.println("Thread created!");
  }
  before(): call(* Thread.start(..)) { // Thread.start called
System.out.println("Thread started!");
  }
}

Andy

> On Jul 20, 2016, at 1:07 AM, ants  wrote:
> 
> 
> 
> On Wed, Jul 20, 2016 at 1:03 PM, Alexander Kriegisch-2 [via AspectJ] <[hidden 
> email] > wrote:
> You can easily hook into places where your own code creates threads. 
> 
> If you need to hook into threads created by third party libs, you need to 
> weave their binaries via post-compile or load-time weaving.
> 
> Can you give some examples for it with respect to weaving thread creation? 
>  
> 
> 
> Theoretically you can also weave into the JDK, creating your own tools.jar 
> with woven classes, but probably you do not want to go that far. I have done 
> that in the past just for the fun of it. 
> -- 
> Alexander Kriegisch 
> https://scrum-master.de 
> 
> 
> > Am 20.07.2016 um 05:42 schrieb ants <[hidden email] 
> > >: 
> > 
> > Hi All, 
> > 
> > Is there a way to hook to thread creations and destroy from AspectJ 
> > pointcuts? 
> > 
> > ` Anto. 
> > 
> > 
> > 
> > -- 
> > View this message in context: 
> > http://aspectj.2085585.n4.nabble.com/Hook-Thread-Creations-tp4652108.html 
> > 
> > Sent from the AspectJ - users mailing list archive at Nabble.com. 
> > ___ 
> > aspectj-users mailing list
> > [hidden email]  
> > To change your delivery options, retrieve your password, or unsubscribe 
> > from this list, visit 
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users 
> > 
> ___ 
> aspectj-users mailing list 
> [hidden email]  
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit 
> https://dev.eclipse.org/mailman/listinfo/aspectj-users 
> 
> 
>  smime.p7s (3K) Download Attachment 
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://aspectj.2085585.n4.nabble.com/Hook-Thread-Creations-tp4652108p4652109.html
>  
> 
> To unsubscribe from Hook Thread Creations, click here 
> .
> NAML 
> 
> 
> View this message in context: Re: Hook Thread Creations 
> 
> Sent from the AspectJ - users mailing list archive 
>  at 
> Nabble.com.
> ___
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Re: [aspectj-users] Java 9 sun.boot.class.path gone

2016-07-22 Thread Andy Clement
I thought the fix for this was already in (a variant of it) - I was doing some 
work on 1.9.0 BETA4 recently. This included picking up all the latest Eclipse 
JDT support for Java9 and coping with the changes to paths. But I will admit I 
was working with a 121 build version of Java9, perhaps things have changed 
again since then. I’ll have a look when I get a moment.

cheers,
Andy
 
> On Jul 22, 2016, at 11:31 AM, Mario Ivankovits  wrote:
> 
> Hi!
> 
> In latest Java 9 builds the „sun.boot.class.path“ is gone. Due to this, the 
> core java classes can no longer be found by aspectj.
> On AspectJs earlyJava9 branch I’ve patched it like this to make that work 
> again.
> 
> 
> Index: weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java
> ===
> --- weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java(revision 
> f8b86ff2c03a77e47e87573b59bc43c57cfdee38)
> +++ weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java(revision )
> @@ -38,6 +38,7 @@
> 
>  import org.aspectj.bridge.IMessageHandler;
>  import org.aspectj.bridge.MessageUtil;
> +import org.aspectj.util.LangUtil;
>  import org.aspectj.weaver.BCException;
>  import org.aspectj.weaver.UnresolvedType;
>  import org.aspectj.weaver.WeaverMessages;
> @@ -70,6 +71,11 @@
> if (trace.isTraceEnabled())
> trace.enter("", this, new Object[] { classpath, 
> handler });
> entries = new ArrayList();
> +
> +   if (LangUtil.is19VMOrGreater()) {
> +   entries.add(new JImageEntry(null));
> +   }
> +
> for (Iterator i = classpath.iterator(); i.hasNext();) 
> {
> String name = i.next();
> addPath(name, handler);
> 
> Regards,
> Mario
> ___
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe from 
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

[aspectj-users] Java 9 sun.boot.class.path gone

2016-07-22 Thread Mario Ivankovits
Hi!

In latest Java 9 builds the „sun.boot.class.path“ is gone. Due to this, the 
core java classes can no longer be found by aspectj.
On AspectJs earlyJava9 branch I’ve patched it like this to make that work again.


Index: weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java
===
--- weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java(revision 
f8b86ff2c03a77e47e87573b59bc43c57cfdee38)
+++ weaver/src/org/aspectj/weaver/bcel/ClassPathManager.java(revision )
@@ -38,6 +38,7 @@

 import org.aspectj.bridge.IMessageHandler;
 import org.aspectj.bridge.MessageUtil;
+import org.aspectj.util.LangUtil;
 import org.aspectj.weaver.BCException;
 import org.aspectj.weaver.UnresolvedType;
 import org.aspectj.weaver.WeaverMessages;
@@ -70,6 +71,11 @@
if (trace.isTraceEnabled())
trace.enter("", this, new Object[] { classpath, 
handler });
entries = new ArrayList();
+
+   if (LangUtil.is19VMOrGreater()) {
+   entries.add(new JImageEntry(null));
+   }
+
for (Iterator i = classpath.iterator(); i.hasNext();) {
String name = i.next();
addPath(name, handler);

Regards,
Mario

smime.p7s
Description: S/MIME cryptographic signature
___
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users