admin@glassfish.java.net

New _at_Param abilities

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Tue, 08 Apr 2008 14:04:06 -0700
There are 2 new Param annotation possibilities for AdminCommand's

@Param(acceptableValues="foo,bar.xyz")
String aString;

aString will either be null, empty, foo, bar, or xyz

If anything else is given then the command will fail at injection time -- before execute() is called

Call for comments -- should null and/or empty be errors?
______________________

@Param
Boolean myBool;

If  the parameter is not given at all (i.e. no --myBool) then myBool == whatever you set it to in the declaration

If the parameter is given -- this is how it works:

null or empty string --> true
case-insensitive match of "true" --> true
case-insensitive match of "false" --> false
anything else -->  fatal error.  AdminCommand.execute() will NOT be called

If you have developed an AdminCommand that uses boolean options, I urge you to change to the new capability above.


-- 
Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.