Questions tagged [interception]

174 questions
33
votes
3 answers

How to catch any method call on object in PHP?

I am trying to figure out how to catch any method called on an object in PHP. I know about the magic function __call, but it is triggered only for methods that do not exist on the called object. For example i have something like this: class Foo { …
Pirozek
  • 1,250
  • 4
  • 16
  • 25
30
votes
3 answers

how to intercept innerHTML changes in javascript?

I need to intercept any changes in the content of a cell inside my webpage. The following code shows me that addEventListener does not work. function modifyText() { alert("!"); } var…
tic
  • 4,009
  • 15
  • 45
  • 86
23
votes
3 answers

How use IInterceptor in Castle.DynamicProxy?

I wrote an example like this Simple Calculator class : public class Calculator { public int Add(int a, int b) { return a + b; } } implemented "IInterceptor" that provided by DynamicProxy [Serializable] public abstract class…
22
votes
5 answers

If Spring can successfully intercept intra class function calls in a @Configuration class, why does it not support it in a regular bean?

I have recently noticed that Spring successfully intercepts intra class function calls in a @Configuration class but not in a regular bean. A call like this @Repository public class CustomerDAO { @Transactional(value=TxType.REQUIRED) …
Gonen I
  • 5,576
  • 1
  • 29
  • 60
18
votes
2 answers

How to vary between child and parent view group touch events

I decided to post this question and answer in response to this comment to this question: How to handle click in the child Views, and touch in the parent ViewGroups? I will paste the comment here: Suppose I want to override the touch events only for…
user3956566
10
votes
1 answer

c and LD_PRELOAD. open and open64 calls intercepted, but not stat64

I've done a little shared library that tries to intercept open, open64, stat and stat64 sys calls. When I export LD_PRELOAD and run oracle's sqlplus, I can see the traces of the open and open64 calls, but no traces of the stat and stat64 calls. The…
klayme
  • 145
  • 2
  • 5
10
votes
1 answer

Can I intercept Task.Factory.StartNew?

Our application has a lot of calls to Task.Factory.StartNew(Action action). Unfortunately, when doing this, the culture is not set, and furthermore, there is no error handling. I began with a starter class that would do both: public static class…
Ray
  • 4,679
  • 10
  • 46
  • 92
8
votes
2 answers

Ninject Interception Extension (AOP) - Good working example/tutorial?

I've been having a very difficult time finding an easy to follow tutorial or example of using the interception extension with Ninject, or ideally, a working example. I've tried the below tutorial, but immediately had problems getting namespaces to…
David
  • 660
  • 7
  • 18
7
votes
1 answer

Burp proxy interception doesn't work for localhosted web apps with Firefox

Although I can and do use the Burp proxy with Firefox for remote web servers without any problem, I can't seem to get it to work on the local network with test web applications I host on my local server. Burp cannot see traffic from these requests.…
7
votes
2 answers

How do I get CallerFilePath and CallerLineNumber without using the CallerInfo attributes?

For my log4net solution, I have an API wrapper that uses the CallerInfo attributes, e.g. public void Write(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string…
Raymond
  • 3,382
  • 5
  • 43
  • 67
7
votes
2 answers
7
votes
2 answers

C# unity interception by attribute

Is there a way on how to use interception by attribute in C# unity and keep the object registration code in XML file(like app.config)? If yes, can you provide me with code, how should such registration look? I did a lot of workaround but did not…
TechCrap
  • 930
  • 3
  • 14
  • 28
6
votes
4 answers

Wrapping functions and function.length

Let's consider I have the following code /*...*/ var _fun = fun; fun = function() { /*...*/ _fun.apply(this, arguments); } I have just lost the .length data on _fun because I tried to wrap it with some interception logic. The following doesn't…
Raynos
  • 166,823
  • 56
  • 351
  • 396
6
votes
4 answers

Intercepting click event for all controls in an app in C# (WinForms)

I want to make an application to intercept all UI events in all the forms of my application and to write them to a log. This data can than be used to see which controls are the most used, in what order, etc. The problem is that I want this to happen…
Gratian Lup
  • 1,485
  • 3
  • 19
  • 29
5
votes
4 answers

Java - Use annotations and intercept methods?

Is there a simple way to intercept methods in java. I need to add an annotation to required methods so that a piece of logic gets called before going through the method. public void verifyActivity() { // Asset if you are on a wrong…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
1
2 3
11 12