admin@glassfish.java.net

Re: Question for Remote Command Developers

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Tue, 08 Apr 2008 10:57:35 -0700

Jerome Dochez wrote:
>
> On Apr 8, 2008, at 7:43 AM, Prashanth Abbagani wrote:
>> This will be useful. But for boolean parameters, can we encourage the
>> developers to declare the param as boolean type (as against String),
>> and you implicitly validate the option value for (true or false).
>>
> right, I like the feature but not the example...
>
> we should have
> @Param(optional=true)
> Boolean enabled
>
> and let the system figure out the conversion (constructor with String
> paramerter).
>
> having said that, the acceptableValues is interesting for other things,
> and could/ should be enhanced to support range :
> like
> @Param(acceptableValues="0..100")
> Integer numberOfThreads;

Shouldn't we use the Bean Validation spec (JSR-303) to do this?

Also, didn't we used to accept a bunch of values for boolean attributes
(true, false, on, off, yes, no, 1, 0)? Not that I think that's a good
idea, I'm just worried about compatibility.