Hi, it's me again :-)
What I did is extend the getProxyForService() method of RemoteExporter
to find the interfaces of the service and create a proxy accordingly
is no service interface is specified. Here's what I did:
protected Object getProxyForService() {
checkService();
if (getServiceInterface() != null) {
return super.getProxyForService();
} else {
Class[] interfaces = AopUtils.getAllInterfaces(getService());
ProxyFactory proxyFactory = new ProxyFactory();
for (int i = 0; i < interfaces.length; i++) {
proxyFactory.addInterface(interfaces[i]);
}
proxyFactory.setTarget(getService());
return proxyFactory.getProxy();
}
}
What's the chance of this making it into the source?
Steven
On Thu, 30 Dec 2004 03:03:26 +0100, Steven Devijver
<ste...@gm...> wrote:
> Okay, forget what I said, please :-)
>
>
> On Thu, 30 Dec 2004 02:52:21 +0100, Steven Devijver
> <ste...@gm...> wrote:
> > Hi,
> >
> > Would it be possible to change the HttpInvokerProxyFactoryBean so that
> > it behaves as it does now when a service interface is specifed and
> > otherwise use:
> >
> > serviceObject = new ProxyFactory(this).getProxy();
> >
> > This way the interfaces implemented by the object are looked up so
> > they don't to be declared. If I understand correctly it is currently
> > not possible to expose more than one interface anyway.
> >
> > Otherwise, I'm a bit lost by the implementation of the getObjectType()
> > method. If the above change is made it should look something like
> > this:
> >
> > return (getServiceInterface() != null) ? getServiceInterface() :
> > this.serviceProxy.getClass();
> >
> > Steven
> >
>
|