Start Glassfish as a SMF Service in Solaris 10

I was surprised how easy it was to register Glassfish as a SMF(5) service in
Solaris 10.

The asadmin command already has a target command

bin/asadmin create-service --passwordfile ./passfile domains/domain1
The passfile contains the passwords for the instance:

AS_ADMIN_USER=admin
AS_ADMIN_PASSWORD=
AS_ADMIN_MASTERPASSWORD=

After this, there is a SMF-Service with the name of the domain created.
The service can be started/stopped with svcadm.