Skip to content

Instantly share code, notes, and snippets.

@dennysfredericci
Created April 17, 2013 02:47
Show Gist options
  • Save dennysfredericci/5401404 to your computer and use it in GitHub Desktop.
Save dennysfredericci/5401404 to your computer and use it in GitHub Desktop.
A simple way to "build" a proxy for aspectj applications
@Aspect
public class PedidoAspect {
public interface Customer {
String getNome();
};
@DeclareParents("br.com.test.Cliente")
public static Customer customer;
@Before("execution(* br.com.test.Pedido.addCliente(..)) && args(customer)")
public void anyMethod(JoinPoint point, Customer customer) {
System.out.println(customer.getNome());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment