Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Why would one ever want to use Load Time Weaving?

I am sorry, it still does not work. My aop-ajc.xml is:
==========================================================
<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
	<aspects>
		<aspect name="com.shunra.poc.security.AuthorizerAspect"/>
		<aspect name="com.shunra.poc.logging.LoggerHolderAspect"/>
		<aspect name="com.shunra.poc.logging.LoggerAspect"/>
		<aspect name="com.shunra.poc.handlers.ResourceHandlerLoggerAspect"/>
		<aspect name="com.shunra.poc.handlers.ConverterProviderWorkaroundAspect"/>
		<aspect name="com.shunra.poc.UserRepositoryFailAspect"/>
		<aspect name="com.shunra.poc.ServiceLoggerAspect"/>
		<aspect name="com.shunra.poc.ResponseToStringAspect"/>
	</aspects>
</aspectj>
==========================================================

My aop.xml is:
==========================================================
<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
	<aspects>
		<include within="com.shunra.poc.ResponseToStringAspect"/>
	</aspects>
	<weaver options="-showWeaveInfo
-Xset:weaveJavaxPackages=true,overWeaving=true"/>
</aspectj>
==========================================================

The project consists of a single jar, which is in LTW aspectpath of the run
configuration.

What happens now, is that nothing gets woven. I suspect, that
com.shunra.poc.ResponseToStringAspect was not woven before either. Here is
its code:
==========================================================
package com.shunra.poc;

import javax.ws.rs.core.Response;

import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class ResponseToStringAspect {
  @Pointcut("execution(public String javax.ws.rs.core.Response.toString())
&& this(o)")
  public void toString(Response o) {
  }

  @Around("toString(o)")
  public String responseToString(Response o) {
    Object entity = o.getEntity();
    return entity == null ? "null" : entity.toString();
  }
}
==========================================================

LTW produces zero messages on the console. What is wrong?

Thanks.

--
View this message in context: http://aspectj.2085585.n4.nabble.com/Why-would-one-ever-want-to-use-Load-Time-Weaving-tp4181328p4198647.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top