Search in sources :

Example 6 with WebEvent

use of org.ops4j.pax.web.service.spi.WebEvent in project karaf by apache.

the class WebContainerServiceImpl method start.

public void start(List<Long> bundleIds) throws Exception {
    if (bundleIds != null && !bundleIds.isEmpty()) {
        for (long bundleId : bundleIds) {
            if (webEventHandler.getBundleEvents().containsKey(bundleId)) {
                WebEvent webEvent = webEventHandler.getBundleEvents().get(bundleId);
                Bundle bundle = webEvent.getBundle();
                if (bundle != null) {
                    // deploy
                    warManager.start(bundleId, null);
                } else {
                    System.out.println("Bundle ID " + bundleId + " is invalid");
                    LOGGER.warn("Bundle ID {} is invalid", bundleId);
                }
            }
        }
    }
}
Also used : WebBundle(org.apache.karaf.web.WebBundle) Bundle(org.osgi.framework.Bundle) WebEvent(org.ops4j.pax.web.service.spi.WebEvent)

Aggregations

WebEvent (org.ops4j.pax.web.service.spi.WebEvent)6 WebBundle (org.apache.karaf.web.WebBundle)3 Bundle (org.osgi.framework.Bundle)3 ArrayList (java.util.ArrayList)2 BundleStartLevel (org.osgi.framework.startlevel.BundleStartLevel)1