@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { if (deploymentHasPersistenceProvider(phaseContext.getDeploymentUnit())) { // finish registration of persistence provider PersistenceProviderHandler.finishDeploy(phaseContext); } // only install PUs with property Configuration.JPA_CONTAINER_CLASS_TRANSFORMER = false (since // they weren't started before) // this allows @DataSourceDefinition to work (which don't start until the Install phase) PersistenceUnitServiceHandler.deploy(phaseContext, false, platform); }
@Override public void undeploy(DeploymentUnit context) { PersistenceUnitServiceHandler.undeploy( context); // always uninstall persistent unit services from here }