Questions tagged [interception]
174 questions
5
votes
4 answers
Intercepting JUnit Assert functions
I would like to do some "own stuff" when an assertion in JUnit fails. I would like to have this:
public class MyAssert extends org.junit.Assert {
// @Override
static public void fail(String message) {
System.err.println("I am…

Bjoern Milcke
- 51
- 3
5
votes
1 answer
LD_PRELOAD not working for printf
i am using LD_PRELOAD to capture write() system call in linux .
I am successfully able to do this for write system call and make it work.
But when i call printf() that time it does not work. If we observe printf stack trace using strace i found…

app
- 421
- 1
- 4
- 7
5
votes
0 answers
Why does Unity apply injection behavior when resolving class registered as implementation of some interface
I register dependency like this:
this.Container.RegisterType(
new ContainerControlledLifetimeManager(),
new InterceptionBehavior(), new Interceptor());
this works fine.
However when…

Pavel Voronin
- 13,503
- 7
- 71
- 137
5
votes
6 answers
Intercept method calls
Is there a way of intercepting some method calls without making any code changes around the method itself?
I don't need to inject any custom behaviour at runtime, only add custom performance logging to an existing project.

aly
- 373
- 2
- 7
- 22
4
votes
1 answer
Autofac + Castle DynamicProxy: Order of interceptors
I'm using Castle DynamicProxy with Autofac. I have an object for which I've created a proxy, and I have two interceptors that act on the proxy, one for logging an exception and the second for for altering the return value of the method. The…

musicologyman
- 368
- 4
- 9
4
votes
1 answer
Playwright intercept server side network request
Can't see to find any good docs on how to mock/stub the server Sider side requests with playwright.
An example would be to intercept the getServerSideProps in nextjs: hitting the routes makes the server do a request (db API etc). Then it can do some…

Norfeldt
- 8,272
- 23
- 96
- 152
4
votes
1 answer
Intercepting global functions with Valgrind on Linux using g++
I'm trying to intercept a function with Valgrind, according to their example.
I am able to do the interception of global function when building with gcc, however when I compile the same code with g++, interception doesn't work.
Is there anything…

Igal Tabachnik
- 31,174
- 15
- 92
- 157
4
votes
1 answer
MutationObserver: ignore a DOM action
How can I make an observing instance of MutationObserver to ignore some DOM changes, which are caused by my code?
For example (with jQuery):
//initialize MutationObserver
var mo = new MutationObserver(mutations =>…

impulsgraw
- 887
- 3
- 13
- 34
4
votes
0 answers
How to get the value of the property of a transparent proxy via reflection?
My code receives transparent proxy instead of original instance.
While this var type = obj.GetType(); yields the type of original class,
the following code throws TargetException:
Object does not match target type
var value =…

Pavel Voronin
- 13,503
- 7
- 71
- 137
4
votes
1 answer
nginx proxy authentication intercept
I have a couple of service and they stand behind an nginx instance. In order to handle authentication, in nginx, I am intercepting each request and sending it to the authentication service. There, if the credentials are are correct, I am setting a…

Horia Radu
- 81
- 1
- 5
4
votes
1 answer
How can I force iOS MapKit to use HTTPS for all its communications?
Embedding a map in my app causes many HTTP requests to be produced, of the form:
http://gspe19.ls.apple.com/tile.vf?flags=1&style=1&size=2&scale=0&v=99999999&z=99&x=9999&y=9999&checksum=1&sid=999999&accessKey=XXXXXX
This is the tile data that is…

Opine Parens
- 41
- 2
4
votes
1 answer
Intercept or Decorate calls to ILogger
I'm currently using castle windsor, along with it's logging facility in my application.
However, in my logging I would like to include some contextual information that is not within the logged message, but stored within the CallContext.
I have…

Lawrence
- 3,287
- 19
- 32
4
votes
1 answer
Is there a way to measure C# function execution time from an attribute?
I'm looking to publish custom performance counters for certain important function calls in the system. I'd like to continously monitor these performance counters in a production environment.
Is there a way for me to mark certain functions with a…

Igorek
- 15,716
- 3
- 54
- 92
4
votes
1 answer
Custom onInterceptTouchEvent in ListView
How can I implement a custom onInterceptTouchEvent() in a ListView that give the scrolling priority to the child's of the ListView and as soon as they did their scrolling , give it back to the ListView ? I want to give priority to the inner views.

Soheil Setayeshi
- 2,343
- 2
- 31
- 43
4
votes
3 answers
How to intercept key strokes in Matlab while GUI is running
Do you know how to read keyboard strokes into Matlab while a Matlab gui is running? (I.e., without using the "input" function which sends a prompt to the command window and needs you to press return).
We would like to avoid using a mex function if…

learnvst
- 15,455
- 16
- 74
- 121