Examples of LazyActivationDescription


Examples of org.papoose.core.descriptions.LazyActivationDescription

    }

    @Test
    public void testParseLazyActivationDescription() throws Exception
    {
        LazyActivationDescription pojo = new LazyActivationDescription(true);

        Util.parseLazyActivationDescription("include:=\"com.acme.service.base,com.acme.service.help\"", pojo);

        Assert.assertEquals(2, pojo.getInclude().size());
        Assert.assertTrue(pojo.getInclude().contains("com.acme.service.base"));
        Assert.assertTrue(pojo.getInclude().contains("com.acme.service.help"));

        pojo = new LazyActivationDescription(true);

        Util.parseLazyActivationDescription("exclude:=\"com.acme.service.base,com.acme.service.help\"", pojo);

        Assert.assertEquals(2, pojo.getExclude().size());
        Assert.assertTrue(pojo.getExclude().contains("com.acme.service.base"));
        Assert.assertTrue(pojo.getExclude().contains("com.acme.service.help"));

        try
        {
            Util.parseLazyActivationDescription("include:=\"1com.acme.service.base,com.acme.service.help\"", pojo);
            Assert.fail("1com.acme.service.base is a bad path");
View Full Code Here

Examples of org.papoose.core.descriptions.LazyActivationDescription

            if (bundleGeneration.getState() == Bundle.ACTIVE) return;

            BundleController bundleController = bundleGeneration.getBundleController();
            ArchiveStore archiveStore = bundleGeneration.getArchiveStore();
            LazyActivationDescription lazyActivationDescription = archiveStore.getLazyActivationDescription();
            if (options != Bundle.START_TRANSIENT)
            {
                if (lazyActivationDescription.isLazyActivation())
                {
                    bundleController.setAutostart(AutostartSetting.ACTIVATION_POLICY);
                }
                else
                {
                    bundleController.setAutostart(AutostartSetting.EAGER);
                }
            }

            if (bundleGeneration.getState() == Bundle.INSTALLED && !resolve(bundleGeneration.getBundleController())) throw new BundleException("Unable to resolve bundle");

            if (lazyActivationDescription.isLazyActivation())
            {
                if (bundleGeneration.getState() != Bundle.STARTING)
                {
                    bundleGeneration.setState(Bundle.STARTING);
View Full Code Here

Examples of org.papoose.core.descriptions.LazyActivationDescription

        return result;
    }

    private static LazyActivationDescription obtainLazyActivationDescription(Attributes headers) throws BundleException
    {
        LazyActivationDescription lazyActivationDescription;

        if (headers.containsKey(Constants.BUNDLE_ACTIVATIONPOLICY))
        {
            lazyActivationDescription = new LazyActivationDescription(true);

            String description = headers.getValue(Constants.BUNDLE_ACTIVATIONPOLICY);
            int index = description.indexOf(';');

            if (index != -1)
            {
                Util.parseLazyActivationDescription(description.substring(index + 1), lazyActivationDescription);
            }
        }
        else
        {
            lazyActivationDescription = new LazyActivationDescription(false);
        }

        return lazyActivationDescription;
    }
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.