Package org.osgi.service.deploymentadmin

Examples of org.osgi.service.deploymentadmin.DeploymentPackage.uninstall()


                    try
                    {
                        final DeploymentPackage pck = admin.getDeploymentPackage(pckId);
                        if (pck != null)
                        {
                            pck.uninstall();
                        }
                    }
                    catch ( /*Deployment*/Exception e)
                    {
                        throw new ServletException("Unable to undeploy package.", e);
View Full Code Here


                }
            }
        } else { // uninstall
            if ( dp != null ) {
                try {
                    dp.uninstall();
                } catch (final DeploymentException e) {
                    logger.error("Unable to uninstall deployment package {} from resource {}", symbolicName, tr);
                }
            } else {
                logger.info("Unable to find deployment package with symbolic name {} for uninstalling.",
View Full Code Here

        assertTrue(isBundleActive(dp.getBundle(getSymbolicName("bundle1"))));
        assertFalse(isBundleActive(dp.getBundle(getSymbolicName("fragment1"))));

        // Should succeed...
        dp.uninstall();

        assertEquals("Expected no deployment package?!", 0, countDeploymentPackages());

        // Both bundles should be uninstalled...
        assertBundleNotExists(getSymbolicName("bundle1"), "1.0.0");
View Full Code Here

        assertBundleExists(getSymbolicName("bundle3"), "1.0.0");

        assertEquals("Expected a single deployment package?!", 1, countDeploymentPackages());

        // Should succeed...
        dp.uninstall();

        assertEquals("Expected no deployment package?!", 0, countDeploymentPackages());

        assertBundleNotExists(getSymbolicName("rp1"), "1.0.0");
        assertBundleNotExists(getSymbolicName("bundle3"), "1.0.0");
View Full Code Here

        assertEquals("Expected no deployment package?!", 1, countDeploymentPackages());
       
        System.setProperty("rp1", "commit");

        dp.uninstall();

        assertTrue("No bundles should be started! " + getCurrentBundles(), getCurrentBundles().isEmpty());

        assertEquals("Expected no deployment package?!", 0, countDeploymentPackages());
    }
View Full Code Here

        assertEquals("Expected no deployment package?!", 1, countDeploymentPackages());
       
        System.setProperty("rp1", "dropAllResources");

        try {
            dp.uninstall();
            fail("Expected uninstall to fail and rollback!");
        }
        catch (DeploymentException exception) {
            // Ok; expected
            assertDeploymentException(CODE_OTHER_ERROR, exception);
View Full Code Here

        assertEquals("Expected no deployment package?!", 1, countDeploymentPackages());
       
        System.setProperty("rp1", "prepare");

        try {
            dp.uninstall();
            fail("Expected uninstall to fail and rollback!");
        }
        catch (DeploymentException exception) {
            // Ok; expected
            assertDeploymentException(CODE_COMMIT_ERROR, exception);
View Full Code Here

        assertBundleExists(getSymbolicName("bundle3"), "1.0.0");

        System.setProperty("bundle3", "stop");
       
        dp.uninstall(); // should succeed.

        // FELIX-4484: only after a successful uninstall, the DP should be marked as stale...
        assertTrue(dp.isStale());

        awaitRefreshPackagesEvent();
View Full Code Here

        assertTrue("One bundle should be started!", getCurrentBundles().size() == 1);

        assertEquals("Expected no deployment package?!", 1, countDeploymentPackages());

        try {
            dp.uninstall();
            fail("Expected uninstall to fail and rollback!");
        }
        catch (DeploymentException exception) {
            // Ok; expected
            assertDeploymentException(CODE_PROCESSOR_NOT_FOUND, exception);
View Full Code Here

        assertBundleExists(getSymbolicName("bundle1"), "1.0.0");
        assertBundleExists(getSymbolicName("bundle2"), "1.0.0");

        // Uninstall the deployment package; should yield the original situation again...
        dp2.uninstall();

        awaitRefreshPackagesEvent();

        assertEquals("Expected no deployment package?!", 0, countDeploymentPackages());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.