dynamic-proxy

Alternatives to java.lang.reflect.Proxy for creating proxies of abstract classes (rather than interfaces)

According to the documentation: [java.lang.reflect.]Proxy provides static methods for creating dynamic proxy classes and instances, and it is also the superclass of all dynamic proxy classes created by those methods. The newProxyMethod method (responsible for generating the dynamic proxies) has the following signature: pub...

Is it possible to add a property to a type, via a DynamicProxy?

I'm using Castle DynamicProxy to create a proxy of a given type at runtime - including a couple mixins. I'm trying to figure out if it's possible to also add arbitrary properties to the proxy, e.g.: class BaseType { string Foo { get; set; } } and at runtime, I create a new type, that would look like this: class BaseTypeProxy384848...

Proxy not getting attributes on virtual properties?

Using DynamicProxy 2.2 I think I'm seeing this issue: "Inheritable attributes on virtual properties not available on proxy" http://support.castleproject.org/projects/DYNPROXY/issues/view/DYNPROXY-ISSUE-109 I've got a base class with a virtual property. The property is marked with [XmlIgnore]. If I serialize a derived class, the prop...

How to inject a base class to a proxy using DynamicProxy?

I would like to inject a base class to any proxy class with a an attribute. For example: public class Base { } [SomeAttribute()] public class Foo { } public class Bar { } If Foo doesn't inherit from base, inject it however Bar shouldn't be injected with base. Anyone got a clue? ...

how to reattach singleton Spring beans upon deserialization

I want to reinject singleton-scoped dependencies into prototype Spring beans, after they have been deserialized. Say I've got a Process bean, which depends on a Repository bean. The Repository bean is a scoped as a singleton, but the Process bean is prototype-scoped. Periodically I serialize the Process, and then later deserialize i...

Wrap ActiveX to Intercept Calls (ActiveX Proxy wrapper)

Hi all, I have a deeply ingrained ActiveX control in our system which I would like to learn about / fix! I am thinking about wrapping this MFC dll with a transparent proxy class that will intercept the member etc. HOW can this be approached in MFC. Thanks! ...

Usefulness of java dynamic proxies vs regular proxies

I need some advice to which scenarios a dynamic proxy would prove more useful than a regular proxy. I've put alot of effort into learning how to use dynamic proxies effectively. In this question, set aside that frameworks like AspectJ can perform basically everything we try to achieve with dynamic proxies, or that e.g., CGLIB can be us...

Dynamic proxy and checked exceptions

How can I make my dynamic proxy throw checked exceptions? I need a transparent wrapper for an interface which sometimes throws checked exceptions such as IOException. Is it possible without 3rd party AOP or writing my own proxy? Modifying all 20 methods of the interface by hand is not an option either. ...

Is is possible to proxy a COM interface using Spring.Net?

I am trying to create a dynamic proxy using Spring.NET and C# for a COM interface. I am currently experimenting using code, not config files. I have code similar to the following: Type comInterfaceType = typeof(ICOMInterface); ProxyFactory proxyFactory = new ProxyFactory(); proxyFactory.AddInterface(comInterfaceType); proxyFactory.GetP...

How to create a proxy of an interface in Java?

Hello, How can one create a proxy for an interface without creating a class that implements it? I have a concrete example: I have an interface, Contact, and need to create a proxy object that acts as a Contact. This proxy object will be used for running some TestNG tests. I have tried using the JDK approach but could find only example...

Generating Interface Proxies

Hello, Ran into an issue with a class; I have a class that looks like: public class MyPresenter { public MyPresenter(IMyView view) { } } public class SomePresenter { public SomePresenter(ISomeView view) { } } The custom views inherit from a base IView instance. I ran into a situation where I need to create a custom class on...