How do I write plugins (not Java EE components) for GlassFish?

This question was originally posed in this thread. In this case the forum member wanted to know how to implement a new container or an option that specifies that a WAR file should be deployed in a new container.

Sreeni responded and pointed to this resource, which explains the process of developing Add-Ons.