Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
80 views

I'm using DispatchProxy to create a "cached" IEnumerable<T> that will evaluate its elements once upon first enumeration, then buffer them for subsequent enumerations. I'm aware that ...
jeff.w's user avatar
  • 13
-1 votes
1 answer
75 views

The code I'm writing needs to intercept calls to object #2 (part of an external library) that is instantiated/retrieved on the fly by object #1 (also in the external library). Therefore, I'm ...
Joe DiNottra's user avatar
  • 1,083
0 votes
0 answers
51 views

Is there any possibility to execute some code before every autowiring (for method and variable autowiring)? Because under some circumstances I want to add a primary component before this autowire/...
nauni77's user avatar
  • 137
0 votes
1 answer
1k views

Baeldung has this section: this limits matching to join points where the bean reference is an instance of the given type, while target limits matching to join points where the target object is an ...
SoT's user avatar
  • 1,267
3 votes
1 answer
1k views

My query is why is an instance variable null when cglib proxy with spring tries to access it inside a final method. This would mean that even if I had declared the variable directly like in the class ...
silver-soul's user avatar
0 votes
0 answers
301 views

How to intercept methods calls during runtime, For example, I have a DLL of my application that contains some methods that I would like to bypass or intercept to add some logs. Can I use some ...
Mselmi Ali's user avatar
  • 1,305
1 vote
0 answers
251 views

I am trying to make a Proxy class that implements a class called Player. public Player asPlayer() { return (Player) Proxy.newProxyInstance(Player.class.getClassLoader(), new ...
J.Doe's user avatar
  • 11
0 votes
1 answer
207 views

I'm learning proxy usage in java and want to log time of method's execution. All of this components are placed in com.example.testproxyproject package. I have Order interface which is implemented by ...
DozezQuest's user avatar
0 votes
0 answers
336 views

First, about the problem I try to solve. Imagine there is an EntityPersistentAdapter which works with some abstraction over SQL (querydsl is used in my case). This adapter implements many CRUD ...
Kirill's user avatar
  • 8,388
1 vote
1 answer
658 views

I want to register open generic interception, so I modified explample from https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/Interception.md [TestFixture] public class UnitTest3 { ...
user234878's user avatar
-2 votes
1 answer
664 views

Before using spring aop and cglib, Now I replaced a simple example.I found that executing method sayHello1 () and sayHello2 () both output "before" and "after" Oh my god, it's very difficult, Do you ...
Muscidae's user avatar
  • 109
1 vote
1 answer
610 views

I'm trying to make the tricky thing. I have method ObjectFactory.getObject() which returns an Object that needs to implement Serializable. I'm trying to make a proxy of an already existing instance of ...
Woods's user avatar
  • 139
1 vote
1 answer
739 views

In java if I want to intercept the method calls on a class I can use Proxy.newProxyInstance() and provide an InvocationHandler implementing invoke(). I've seen that in kotlin you can use delegated ...
Marinos An's user avatar
  • 11.3k
-1 votes
1 answer
345 views

I am learn cglib proxy, When I use Person class which declared in the DemoApplication class as the target of super class of enhancer, there will be a error like this. This is my code public class ...
Shao Junying's user avatar
0 votes
1 answer
537 views

TL/DR: The problem boils down to creating a custom Spring scope, injecting a prototype-like scoped bean into a singleton with proxyMode = ScopedProxyMode.TARGET_CLASS but still getting a singleton in ...
John Allison's user avatar
  • 1,006
3 votes
1 answer
773 views

Lets consider following bean: @Service @Scope(value = "prototype", proxyMode = ScopedProxyMode.INTERFACES) public class MyBeanB implements MyBeanBInterface { private static final AtomicLong ...
gstackoverflow's user avatar
8 votes
3 answers
1k views

I have a class with code like the following, where I want it to be trivial to use any class/type which represents a number. I find myself defining a large amount of methods, like the following: ...
Xerz's user avatar
  • 334
8 votes
1 answer
3k views

My question is about AOP Spring behaviour in case of internal method calls. @Service class Service { @Transactional public void method1() { method2(); } @Transactional ...
xmen-5's user avatar
  • 1,946
2 votes
1 answer
539 views

The method-object, which the dynamic proxy receives, seems to be of the reference type instead of the object type, but only when generics are involved in the method signature. Should it work that way? ...
Olard's user avatar
  • 53
3 votes
2 answers
250 views

Today I played with some java.lang.reflect.Proxy in Kotlin, and I was surprised by this behaviour: import java.lang.reflect.Proxy interface Dog { fun bark() fun bark3Times() } class DogImpl : ...
xinaiz's user avatar
  • 7,798
1 vote
0 answers
44 views

I am trying to upgrade StructureMap from 2.6 to 4.7. I had an interceptor which creates and return proxy. public object Process(object target, IContext context) { Type targetType = ...
user2412672's user avatar
  • 1,479
1 vote
1 answer
258 views

I'm using Entity Framework and have registered some types for use in a factory class. Registration is performed using Keyed like this: builder.RegisterType<CreateTypeAStrategy>().Keyed<...
Vincent's user avatar
  • 1,161
0 votes
1 answer
93 views

In our web application exists 'Access Bean' classes with some methods on them which perform queries on a DB, these are invoked multiple times per request. Therefore they need to be cached but the ...
lifesoordinary's user avatar
2 votes
1 answer
3k views

I'm trying to build a dynamic http client using dynamic proxy to intercept the calls and create an http request with it. The issue i had was with Async methods: private Task<object> PostAsync(...
Erez.L's user avatar
  • 85
0 votes
1 answer
97 views

I'm attempting to write a proxy for RemoteWebDriver to add custom logging for methods such as findElement etc. As an experiment I found a TimingHandler that just provides a start/stop time stamp for ...
mancocapac's user avatar

1
2 3 4 5