cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Better type safety on proxy factory beans...
Date Mon, 11 Oct 2010 12:10:04 GMT
On Monday 11 October 2010 7:55:39 am Benson Margulies wrote:
> What do people think of enabling
> 
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>         factory.setDataBinding(new AegisDatabinding());
>         // perhaps not needed given the endpointInterface annotation
>         factory.setServiceClass(DocumentDatabase.class);
>         factory.setAddress(serviceUrl);
>         return (DocumentDatabase) factory.create();
> 
> to change to
> 
>        return factory.create(DocumentDatabase.class);
> 
> by way of a quick <T> on the method?

I like the idea.   Would it be something like:

<T> T  create(Class<T> cls) {
    this.setServiceClass(cls);
    return cls.cast(create());
}

so you can then avoid the setServiceClass(..) call as well?


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message