A proxy class is a class functioning as an interface to another class or a service. Proxy classes are implementation of Proxy design pattern. These classes help using large objects or other resources that are expensive or impossible to duplicate.
Questions tagged [proxy-classes]
342 questions
4
votes
1 answer
How can you cause a javascript Object to be treated as falsy?
The use case I'm considering is creating a hopelessly egocentric Null for coalescing.
This code works but requires an explicit check against the Null in question:
const Null = new Proxy({}, {get: () => Null});
let data =…

david
- 17,925
- 4
- 43
- 57
4
votes
1 answer
how to extend (or proxy) a scala class with private constructor
I'm trying to extends, or proxy, the org.apache.spark.ml.clustering.KMeans class, such that K=1 is authorized.
class K1Means extends Estimator{
final val kmeans = new KMeans()
val k = 1
override def setK(value:Int) {
if(value…

Borbag
- 597
- 4
- 21
4
votes
3 answers
How to efficiently wrap POJO with Bytebuddy?
I want to wrap simple POJO class. The thing is I know nothing about that class beforehand, only that it's POJO with setters and getters. I want to substitute this class with my Proxyclass so that every time client calls getter or setter I would be…

swasta
- 846
- 8
- 25
4
votes
1 answer
PowerShell Proxy Function; Adding Exception Handling
Question
Is there a simple way to add exception handling to a proxy cmd's process functionality?
As you can see below, I did find a way to do this, but I suspect there's a far cleaner solution.
Full Story
I want to create a proxy function for…

JohnLBevan
- 22,735
- 13
- 96
- 178
4
votes
2 answers
How do I use ES2015 Proxy in Meteor?
Since Meteor 1.2 ES2015 is supported by default for any .js file in a Meteor project. That's great, but when I try to use the name Proxy like
const p = new Proxy(obj1, obj2);
it throws an undefined name Proxy.
I know ES6 is supported as all other…
user2344303
4
votes
1 answer
spring autowiring fails with @Transactional
I want to use @Transactional annotation in the save() method of UserService(concrete class) as follows:
@Service
public class UserService {
@Transactional
public Long save(User userCommand, BindingResult result) {
...
}
}
I will…

pincoin
- 665
- 5
- 19
4
votes
4 answers
How do I avoid web method parameters using proxy classes?
I have a serializable POCO called DataUnification.ClientData.ClientInfo in a .NET class library project A.
It's used in a parameter for a web service defined in project B:
public XmlDocument CreateNewClient(ClientInfo ci, string system)
I now wish…

Alex Angas
- 59,219
- 41
- 137
- 210
4
votes
1 answer
Caching generated classes in Byte Buddy?
I have been using CGLIB's Enhancer for a while, but considering to switch over to Byte Buddy. It's pretty basic stuff, proxy for up to a few hundred data access interfaces, created on demand.
Enhancer enhancer = new…

Balazs Varnai
- 43
- 5
4
votes
1 answer
Proxying a class in Python
I'm using the python-mpd2 module to control a media player on a Raspberry Pi in a GUI application. Thus, I'd like to gracefully handle connection errors and timeouts (the player in question drops MPD connections after 60 seconds) in the background.…

James Scholes
- 7,686
- 3
- 19
- 20
4
votes
1 answer
How to make Ruby variable that will evaluate to false in conditional expressions
I want to make my variable (a proxy object) evaluate to false when used in conditional sentences. I know I can use .nil? and even var == nil but I think that's not good enough. What I am trying go do is to:
if myproxy # not only myprroxy.nil? or…

Hubert Łępicki
- 684
- 1
- 7
- 9
4
votes
3 answers
Why can I change the Registry only the first time?
I am attempting to write an application that automatically changes the proxy server based upon what network connection is active. In this application, the user can also manually click a server in the notifyIcon context menu and call the function to…

CheapDevotion
- 107
- 1
- 8
4
votes
1 answer
@ControllerAdvice with @Autowired dependency not being injected
Anyone knows how to inject a dependency to a @ControllerAdvice?
My @ControllerAdvice extends Spring's ResponseEntityExceptionHandler and implements no interfaces.
The @ControllerAdvice gets called correctly, but the @Autowired dependency is never…

pakman
- 1,676
- 3
- 23
- 41
4
votes
4 answers
Using Proxy pattern to write a server a good idea?
For a school project, I need to write a simple Server in Java that continuously listens on an incoming directory and moves files from this directory to some place else. The server needs to log info and error messages, so I thought I could use the…

kafman
- 2,862
- 1
- 29
- 51
4
votes
2 answers
Advantages of JDK dynamic proxies
What are the advantages of JDK dynamic proxies? Especially in comparison with CGLIB proxies.
Despite the fact that JDK proxies don't bring dependency on any third party library, what are the other advantages of JDK proxies?
I read on few places…

Ondrej Bozek
- 10,987
- 7
- 54
- 70
4
votes
2 answers
Is it possible to enable relationship fixup when change tracking is disabled but proxies are generated
I have entities which form a tree relationships.
class MyEntity
{
public int Id {get;set;}
public int ParentId {get;set;}
public virtual MyEntity Parent {get;set;}
public virtual ICollection Children {get;set;}
}
When…

Pavel Voronin
- 13,503
- 7
- 71
- 137