How can I programmatically deploy applications to Virgo?

This can be achieved using the MBeans registered by Virgo. It's best to explore them first using something like JConsole. The deployer MBean can be used to specify an artifact with a URI that should be deployed (installed and started). Prefixes "file:" and "repository:" can be used. In the case of repository a URL of the form "repository://type/name /version" will refer to an artifact in a provisioning repository. The square brackets indicate that the trailing "/version" is optional, in which case Virgo uses the highest version available, and are not part of the URL. In the case of a bundle, "type" is "bundle" and "name" is the bundle symbolic name (and if "version" is specified, it is the bundle version).

Note that you can also install bundles using <tt>BundleContext.installBundle</tt> and they will be installed in the same region as the bundle whose bundle context was used to perform the install. However, bundles installed in this way will not pass through the Virgo deployment pipeline and will not be subject to the transformations normally applied to bundles as they are deployed in Virgo.