aop

Unity interception behind the scenes

I wonder how Unity interception works behind the scenes? I mean interface,transparent proxy and virtual method proxy interceptors implementation. Anyone could shed some light on this? ...

Spring aop pointcut expression to access method return type

I have a service interface with many methods, all of which take a Request object and return a Response object. All request objects have a common ancestor and all response objects have a different common ancestor (which has a success flag and a message field). Now I want to have an around aspect that checks permissions etc, performs the ...

measuring method execution time using Unity interception

Do you know a pattern for method execution time measurement using EntLib's Unity and its interception mechanism? ...

How to access ContextBoundObject object in IMessageSync.SyncProcessMessage method

Hi, is there a way to access object on which intercepted method was called inside custom IMessageSink? I would like to set some properties on that object that would scope only for duration of method call, manage them, dispose etc... public IMessage SyncProcessMessage(IMessage msg) { Preprocess(msg); IMessage returnMethod = m_n...

Collections as decorators: pseudo-code implementation proposal

Meanwhile waiting for the answer on the question I would like to discuss the possible implementation plan/details or in general even answer how hard would be to implement the following and which tools/techniques are necessary for that: (excerpt from the referred question): Suppose you need to implement many (sub)types of collecti...

How can you be DRY with a programming language that doesn't have Reflection?

Any programming language that does not have a suitable reflection mechanism I find seriously debilitating for rapidly changing problems. It seems with certain languages its incredible hard or not possible to do: Convention over Configuration Automatic Databinding AOP / Meta programming with out reflection. Some example languages th...

Register multiple interceptors in castle windsor fluent

How do I register multiple interceptors using the fluent API? ...

Spring aop with struts2

Hi all, I am new to Spring aop and I decided to use aop to track my Struts2 Action class execution time. I have done the following things. But while running the application setter method of the action class is not called. Here is my code. xml configuration: <aop:aspectj-autoproxy/> <bean id="myAspect" class="abc.xyz.ActionClassAspect"...

PostSharp on assemblies I don't have source for

In the examples on their website, PostSharp has a demo of intercepting calls in main system assemblies. I have tried a few times to setup and replicate said intercept calls on assemblies I don't have the source code for with no success. My approach was to simply place the assembly level attribute targeting the namespace and method I wa...

How to implement AOP with Spring

I am using Spring and I need to implement AOP but I am totally new to it. Can anybody help me? ...

how to use a ContextBoundObject to intercept a function call before/after the invocation?

I have read this article and I can't find a good example for how to use a ContextBoundObject to intercept a function call. Can anyone show me how it's done? Also, a side question: Why can't I use a ContextBoundObject with a generic class? I am asking accroding to this msdn reference ...

How to disable AspectJ without restarting the program?

I have an application using AspectJ with load time weaving to advise various methods. I would like to put a switch in my program to disable the aspect without having to make any source code changes or having to restart the program. It needs to incur as little overhead as possible while turned off. Thanks! ...

Guice dependency injection for entity beans?

For a rich domain driven design I want to use Guice dependency injection on JPA/Hibernate entity beans. I am looking for a similar solution as the Spring @configurable annotation for non-Spring beans. Does anybody know of a library? Any code examples? ...

How to handle Wicket session per client using aop

I am using Wicket 1.4.9 + Spring 3 + iBatis. I want to get session data before used transactional but I have a big problem because this data put on Wicket web session(this data choose on login page). I am using spring aop for point cut but I cannot point cut session per client. How to solve this problem. User Class Entity package com...

Aspect Oriented Development/Programming resource

Recently, I've had a request to implement logging for all of the Controller classes in my ASP.NET project. I've used postsharp and everything is working great! But, usual question: is there any OpenSource component or any pattern? Also, I want to know more about AOP design patterns, resources and real-world application. ...

Spring AOP Advice on Annotated Controllers

I am trying to use AOP to do some processing after an annotated controller. Everything is running with no errors, but the advice is not being executed. Here is the controller code: @Controller public class HomeController { @RequestMapping("/home.fo") public String home(ModelMap model) { model = new ModelMap(); ...

Load time weaving in AspectJ using aop.xml

From what I understand, for load time weaving to work using an aop.xml file, it must be placed in META-INF. Is there a way to get around this and use an aop.xml (or any xml file) in any directory? Thanks. ...

AOP with Local Variable Annotations

I want to use local variable annotations to do better AOP. One idea is to implement the Future<T> concept with a proxy using an annotation. @NonBlocking ExpensiveObject exp = new ExpensiveObject(); //returns immediately, but has threaded out instantiation of the ExpensiveObject. exp.doStuff(); //okay, now it blocks until it's finishe...

Generated asynchronous method calls in C# - AOP?

Hello, I am working on an WPF application that uses a BusinessLogic layer (currently a single dll) in which I created my BL methods that will be called directly from the UI. Each BL manager is resolved with Unity (thinking on switching to MEF though...). BL classes implements a specific interface that have of course apropriate methods. ...

Spring AOP injecting PortletRequest

Hi there, I'm trying to inject a portletrequest in my aspect class @Autowired(required = true) private PortletRequest request; @Before("execution(* de.ac.mis.dao.*.getSessionFactory())") public void setUsername() { System.out.println("Now I'm setting the username " + this.request); } Only gives me an Caused by: org.springframew...