Initializing JVending

WAR Configuration

JVending is deployed from a WAR file within a Servlet container.

Starting the ProvisioningContext

The ProvisioningContextImpl class implements the javax.provisioning.AdapterContext and the javax.provisioning.ProvisioningContext interfaces, making it the central class within the application. It also implements the ServletContextListener interface so that the ServletContainer will initialize it upon start up.

During the initialization, the class does the following:

  1. Loads the RepositoryRegistry with all the configuration information, including:
    • adapters.xml
    • matchers.xml
    • devices.xml
    • deliverables.xml
    • stocking-handlers.xml
    • connections.xml
  2. Configures the Hibernate DAO Registry
  3. Intializes the javax.provisioning.DeliveryComponent
  4. Sets the following atttributes which can then be accessed from the ServletContext
    1. javax.provisioning.ProvisioningContext
    2. org.jvending.registry.RepositoryRegistry
    3. org.jvending.registry.hibernate.HibernateDAORegistry
  5. Intializes the org.jvending.provisioning.stocking.StockingContext. This, in turn:
    • Initializes the org.jvending.provisioning.stocking.StockingComponent
    • Places the org.jvending.provisioning.stocking.StockingContext as an attribute in the ServletContext