aop

mixing autoproxycreator and proxyfactories in spring

How do I mix BeanNameAutoProxyCreator and (Transaction)ProxyFactoryBean in such a way that there is only one proxy? I want to create a proxy with JamonInterceptor, but some have also an transaction interceptor/factory bean defined and these show up as $ProxyXYZ in Jamon. I use spring 2.5.6 ...

Effective Policy Viewer for Ent Lib 4

I can't find the effective policy viewer tool for enterprise library 4. All the links I find on the net point to source I have to compile against entlib 3 dll's. Does anyone know where I can find the updated tool? Or does the old one work and can someone provide the binaries? ...

Is there any full aspect-oriented programming language?

When I say "full" I mean a language that's not an extension to some already existent language like Java or C++. When OOP started it begun with extensions for procedural languages like C and Pascal. Is there any Aspect-Oriented programming language "by itself"? ...

SpringAOP-generated Dynamic sublcass is missing annotation

I'm trying to use Spring AOP to inject behavoir into an object. The target object has a single method which is the join point for this new behavior. That method also has a custom annotation that I want to be able to read from other unrelated code. Because my class doesn't implement an interface, Spring is using CGLIB to dynamically sub...

Is there a .Net analog of the functionality provided by java.lang.instrument?

I have looked at a few of the well-known AOP-oriented frameworks for .Net such as PostSharp, bltoolkit, Castle, Cecil, and Policy Injection Block from Microsoft. Perhaps I am ignorant, but it appears that these frameworks do not provide the ability to inject code while the class is being loaded by the virtual machine, before it is visib...

Java: Simple technique for annotation-based code injection?

Is there a way to make this code work? LogonControl.java @Audit(AuditType.LOGON) public void login(String username, String password) { // do login } AuditHandler.java public void audit(AuditType auditType) { // persist audit } Endgame being, that each time login() is called, audit() is also called, with the appropriate audittype...

Policy Injection with ASP.NET MVC Controllers

I'm running into an issue with the Policy Injection Application Block from Enterprise Library in conjunction with ASP.NET MVC. In my ControllerFactory, I'm creating the controller and then calling PolicyInjection.Wrap on the controller. This gives me back a Transparent Proxy to the controller which manages the call handler chain. Final...

Passive Logging in an existing .NET Web Application?

I've just started working on a brownfield ASP.NET 2.0 Web Application. As with a lot of brownfield applications, the architecture, and specifically the exception logging architecture, is inconsistent and in some places, missing or incorrect (swallowing exceptions, re-throwing, using them for control logic etc) As a starting point for br...

[Spring AOP] Pointcut not working for generic interface

I'm using Spring framework (2.5) and it's AOP features. I've a pointcut expression, like @Pointcut("execution(public * org.springframework.batch.item.ItemReader+.read(..))") public void itemReaderMethods() {} Where the ItemReader interface is a Spring interface and it's signature is: org.springframework.batch.item.ItemReader<T> Th...

What aspect oriented language is a good place to start for a c++ programmer

The only one I know of is called "e" which is used for test bench design in hardware design and verification but I want something for general purpose programming. ...

AOP and Applying Security to UI Elements

I'm working on an application in which we are trying hard to keep Separation of Concerns as strongly as possible. We're finding that the cross-cutting concern of security creates a number of complications. However, it looks like these can be mitigated using attributes and Aspect-Oriented Programming. I understand it as far as applying ...

defining functions in decorator

Why does this not work? How can I make it work? That is, how can I make gu accessible inside my decorated function? def decorate(f): def new_f(): def gu(): pass f() return new_f @decorate def fu(): gu() fu() Do I need to add gu to a dictionary of defined functions somehow? Or can I add gu t...

Is there a tool that enables me to insert one line of code into all functions and methods in a C++-source file?

It should turn this int Yada (int yada) { return yada; } into this int Yada (int yada) { SOME_HEIDEGGER_QUOTE; return yada; } but for all (or at least a big bunch of) syntactically legal C/C++ - function and method constructs. Maybe you've heard of some Perl library that will allow me to perform these kinds of operations...

Maven vs. AspectJ - Example?

MY aspect works great from Eclipse with AspectJ plugin, however if I try to use it with Maven I get .... nothing. I tried this http://mojo.codehaus.org/aspectj-maven-plugin/includeExclude.html I add loggin in my aspect and I try to test it with junit test, but when I run mvn clean mvn test I get... [INFO] [aspectj:compile {execut...

AspectJ vs. toString()

public pointcut myToString() : within(mypackage.*) String around(): myToString(){ System.out.println("myToString"); return proceed(); } It works only if I override toString in class Im trying to weave, is there any way to make it work on all toString methods? ...

How to Inject code in c# method calls from a separate app

I was curious if anyone knew of a way of monitoring a .Net application's runtime info (what method is being called and such) and injecting extra code to be run on certain methods from a separate running process. say i have two applications: app1.exe that for simplicity's sake could be class Program { static void Main(string[] ...

Tracking down cause of Spring's "not eligible for auto-proxying"

When you start messing around with Spring's auto-proxy stuff, you often run into this behaviour as documented: Classes that implement the BeanPostProcessor interface are special, and so they are treated differently by the container. All BeanPostProcessors and their directly referenced beans will be instantiated on start...

Looking for good tutorials / documents for Postsharp laos, understanding of "Librarian" samples.

Hi, Can anyone point me to good learning material on PostSharp / laos plugin. I liked the "Librarian" sample shipped with Postsharp, it does cover lots of stuff, but is difficult to understand. Is there any explanation / writeup on samples too? Thanks & Regards, Ajay ...

How can I intercept execution of all the methods in a Java application using Groovy?

Is it possible to intercept all the methods called in a application? I'd like to do something with them, and then let them execute. I tried to override this behaviour in Object.metaClass.invokeMethod, but it doesn't seem to work. Is this doable? ...

Session objects into Seam Interceptors

Hello guys, once more i'm here asking help on seam subject. Currently we have the following interceptor for audit @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Interceptors(LoggingInterceptor.class) public @interface IAuditavel { } and the interceptor itself private EntityManager em; @Logger private Log lo...