Questions tagged [method-interception]

Intercepts calls on an interface on its way to the target. These are nested "on top" of the target.

28 questions
7
votes
3 answers

Can you add a function to a hijacked JavaScript Array?

This question is related to What are the best practices to follow when declaring an array in Javascript? Let's say a client, let's call them "D. B. Cooper", has a first requirement that the following code must run before any other JavaScript…
Briguy37
  • 8,342
  • 3
  • 33
  • 53
4
votes
1 answer

Postsharp MethodInterceptionAspect get method return value

I have an implementation of MethodInterceptionAspect(PostSharp) but when I in the override OnInvoke method, the args.Method is null, I need to know the method return value type, anyone know about? [PSerializable] public class…
Shoshana Tzi
  • 99
  • 4
  • 10
4
votes
0 answers

method call interception in scala

Hi I was wondering if there is a way to reflectively (or otherwise) intercept all method calls send to a class. I know that unknown methods can be intercepted using Dynamic, but how about methods already defined in the class? I would like to find a…
3
votes
1 answer

How to exclude interception of internal methods in AspectJ AOP?

We are migrating an application that is using Jboss AOP (which is proxy based) to AspectJ AOP with compile time weaving. However, we do not want the internal methods to be intercepted by AspectJ, but that seems to be the default behavior of…
Srinivas C
  • 33
  • 1
  • 5
2
votes
1 answer

Code Cop App just hangs

I written an test application using a Code Cop, a method interception approach. However, as soon as I ran my first application I hit a snag whereby the application would fire up and hang with no information as to what was happening. I had followed…
AndyT
  • 176
  • 8
2
votes
1 answer

CodeCop and .NET 4.6 - why won't it run?

I have recently tried Code Cop 1.3.1 - a method interceptor. However won't run when .NET Framework 4.6 is installed.
AndyT
  • 176
  • 8
2
votes
3 answers

framework for method interception for benchmark measurement

before I rush into writing such framework, I would like to know if anyone have encountered or developed such framework. We've reached a point in our project where focus is on performance improvement. I'm the owner of a spring RESTful microservice,…
kumetix
  • 1,032
  • 1
  • 12
  • 18
2
votes
1 answer

Multiple method interceptions in Guice

I am working with Guice's method interception feature. What I need to know is how to properly implement multiple interceptors, of the form: this.bindInterceptor(Matchers.any(), Matchers.any(), new Interceptor1(), new Interceptor2()); Specifically,…
1
vote
1 answer

Spring ProxyFactoryBean @Autowired not working

I need to intercept methods from a interface, and found this implementation of MethodInterceptor, which I tested on a new spring app and worked. The problem is, I can't seem to get it working on the spring application I need it…
ajms
  • 67
  • 7
1
vote
1 answer

how to hijack a Callable and execute hidden methods before call()

I'm adding implementations to some subsystems in a bigger project (HypergraphDB), and I should avoid to modify important code. In this project, there are about 70 Callable objects which define transaction blocks for some database operations. I'm…
ib84
  • 675
  • 5
  • 16
1
vote
0 answers

.NET and Castle DynamicProxy - How to check if one interception is "inside" another interception

I have an AOP auditing library that intercepts methods using Castle DynamicProxy with Autofac and checks if they have this specific attribute: [Audit(AuditOperation.Create), MethodImpl(MethodImplOptions.NoInlining)] public virtual TEntity…
1
vote
0 answers

C# Inject code into external method at runtime using AOP

I want to inject code into a external method, without editing the source code. I can already replace the current method to reference to my own method, because of Dynamically replace the contents of a C# method?. I still need to able to modify a…
1
vote
1 answer

Postsharp AOP MethodInterception Aspect Not Working

I was trying to add a Permission based Attribute to be used by an existing Windows application built with WPF that I should work on. the idea was to intercept the calls to the Canexecute methods of certain commands and return false -which would…
user1874288
  • 135
  • 2
  • 11
1
vote
1 answer

How do you resolve instances of IInterceptionBehavior from the container when using StructureMap DynamicProxyInterceptor?

I'm migrating from Unity to StructureMap. I've made some use of Unity's InterceptionBehavior. I thought I could switch that to use StructureMap .InterceptWith and the DynamicProxyInterceptor but my interceptors have dependencies and I can't work…
BenCr
  • 5,991
  • 5
  • 44
  • 68
1
vote
1 answer

Method Interception to get property name

I am looking for a utility class or library that gives me the name of the property in a type-safe way. I have something similar like the following in mind: PropertyDescriptor descriptor =…
1
2