|
From: Steven D. <ste...@gm...> - 2004-12-30 12:23:03
|
Hi Juergen,
Thanks for your feedback. I'll create a JIRA issue to add this to the docs.
Steven
On Thu, 30 Dec 2004 11:30:22 +0100, j=FCrgen h=F6ller [werk3AT]
<jue...@we...> wrote:
> Hi Steven,
>=20
> The main reason why we don't perform auto-detection of implemented interf=
aces there is to avoid opening too many doors. The target object might impl=
ement internal callback interfaces like InitializingBean, DisposableBean, e=
tc which we wouldn't want to expose to callers.
>=20
> Offering a proxy with all interfaces implemented by the target usually do=
esn't matter in the local case. But when exporting a remote service, you sh=
ould expose a specific service interface, with specific operations intended=
for remote usage. Besides internal callback interfaces, the target might i=
mplement multiple business interfaces, with just one of them intended for r=
emote exposure. For these reasons, we *require* such a service interface to=
be specified.
>=20
> I guess it's a tradeoff between configuration convenience and the risk of=
accidental exposure of internal methods... IMO, always specifying a servic=
e interface is not too much effort, and puts you on the safe side regarding=
controlled exposure of specific methods.
>=20
> Juergen
>=20
> ________________________________
>=20
> Von: spr...@li... im Auftrag von=
Steven Devijver
> Gesendet: Do 30.12.2004 03:16
> An: spr...@li...
> Betreff: [Springframework-developer] Re: HttpInvokerProxyFactoryBean ques=
tion
>=20
>=20
> Hi, it's me again :-)
>=20
> 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:
>=20
> protected Object getProxyForService() {
> checkService();
> if (getServiceInterface() !=3D null) {
> return super.getProxyForService();
> } else {
> Class[] interfaces =3D AopUtils.getAllInterfaces(=
getService());
> ProxyFactory proxyFactory =3D new ProxyFactory();
> for (int i =3D 0; i < interfaces.length; i++) {
> proxyFactory.addInterface(interfaces[i]);
> }
> proxyFactory.setTarget(getService());
> return proxyFactory.getProxy();
> }
> }
>=20
> What's the chance of this making it into the source?
>=20
> Steven
>=20
> 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 tha=
t
> > > it behaves as it does now when a service interface is specifed and
> > > otherwise use:
> > >
> > > serviceObject =3D 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() !=3D null) ? getServiceInterface() :
> > > this.serviceProxy.getClass();
> > >
> > > Steven
> > >
> >
>=20
>=20
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
>
|