Glassfish is dual licensed, which means you as the user, effectively, get to choose which license affects you.
The CDDL is quite liberal and you have no obligation to open up your source code if you choose the CDDL license of GF.
That means you can have a restrictive license on your application, you can bundle it with GF, and distribute it as a whole without incurring any of the CDDL (or GPL) criteria with your application.
The GPL license for GF is there to make it compliant with those wishing to distribute their code under the GPL, and GPL and CDDL are not compatible licenses. But just because GF is GPL along with CDDL, does not mean the two licenses actually cross over.
So, your code need be only as open as you wish. You're under no obligation to release any of it.
[Message sent by forum member 'whartung' (whartung)]
http://forums.java.net/jive/thread.jspa?messageID=273853