dev@jax-ws.java.net

Re: Proposal for WebServiceFeature Extension

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 20 Oct 2006 13:14:30 -0700

Jitendra Kotamraju wrote:
>> public class FooFeature extends WebServiceFeature {
>> public static final String ID = "foo";
>> private final boolean param2;
>> private final String param1;
>>
>> public FooFeature(
>> @FeatureParameter("param1") String param1,
>> @FeatureParameter("param2") boolean param2){
>> this.param1 = param1;
>> this.param2 = param2;
>> }
>> }
>>
>> This approach minimizes the exposure of this mechanism to the users.
> How does one get param2, param1 ? are they supposed be public ?
> Otherwise, it makes it hard to use the bean

The problem at hand is how to populate a bean from its corresponding
annotation. One can use reflection to get all annotation parameters,
then use the reflection again to invoke the constructor. The only
missing piece is to figure out which parameter corresponds to which
annotation element, and hence this @FeatureParameter annotation.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com