-
1. Re: Hollow proxies
adrian.brock Feb 18, 2006 7:47 AM (in response to adrian.brock)To put this in context, Hollow proxies are a bit like mixins
except they redirect invocations on an interface.
e.g. the proxy implements javax.sql.DataSource which is redirected to
javax.resource.spi.ConnectionManager.allocateConnection()
There is no object that actually implements DataSource.
I don't know whether it is worth making this a first class construct in AOP
(i.e. configurable in xml) rather than having to write a redirecting interceptor to do this?
Some of the use cases can be complicated/domain specific.
e.g. in the DataSource case, the redirect actually doespublic Object invoke(Invocation invoke) throws Throwable { ConnectionRequestInfo cri = makeCRIFromArgs(invocation); ManagedConnectionFactory mcf = getFromInstanceMetaData(invocation); return connectionManager.allocationConnection(mcf, cri); }
-
2. Re: Hollow proxies
kabirkhan Feb 24, 2006 7:57 AM (in response to adrian.brock)I changed the API so that there is no need to pass in Object.class for these hollow proxies. For now I am using Object.class internally in the factory.
If target is null, I make the target a new instance of Object so that the PerInstanceInterceptor has something to match on.
This is until I figure out what you mean by the rest of your post :-) -
3. Re: Hollow proxies
adrian.brock Feb 24, 2006 8:21 AM (in response to adrian.brock)"kabir.khan@jboss.com" wrote:
This is until I figure out what you mean by the rest of your post :-)
I was just thinking out load whether the redirect of the hollow proxy
is something that is generic enough to be made into a "declarative AOP pattern".
Probably not...?