This issue is likely to have changed behavior significantly in GF 3.1.
But I cannot address this in GF 3.1, because for many other reasons,
we don't have a completely clean orderly shutdown. The asadmin command
stop-instance of course shuts down the instance, but it forces the shutdown
with a System.exit or equivalent mechanism due to some unresolved issues
with non-daemon threads.
There are also problems in the EJB container, because the EJB contained
does not shutdown the ORB. It should, and it should to this BEFORE it
undeploys EJBs and marks the container as STOPPED (or whatever the equivalent
is in GF 3.1). Consequently, I am moving this issue to GF 3.2 for further
consideration in the next release.