Here is a diagram which illustrates the various steps in the provisioning of services initiated by application deployment :
Here are the main stages of these process :
- The user deploys the application via the CLI or the console
- The application archive undergoes introspection, and services required by this application are discovered. The discovery is either explicit as in read from the definitions in the glassfish-services.xml or implictly discovered from application metadata specified either as annotations or in the deployment descriptions. At the end of this stage, the typical data discovered, consists of size of the GlassFish cluster, a database as a service or MQ as service and / or a Loadbalancer service front-ending this cluster.
- glassfish-services.xml is used to define the service definition meta-data
- glassfish-resources.xml is used to define the resources ( JDBC /JMS) required by the application.
- The next stage is to delegate the provisioning of these services to the appropriate "service plugins" installed with the CPAS.
- The service plugins work with the underlying IMS ( IaaS Management Service) system to provision these services from the VM templates picked up from the template repository.
- Once the provisioning is complete, the application is associated with the service thus provisioned. What this means in layman terms is that , we point the JDBC datasource or JMS resource to the newly provisioned Database service or MQ service. The definitions in the glassfish-resource.xml are used to associate the applications' resources to the services provisioned.