Package org.apache.karaf.web

Examples of org.apache.karaf.web.WebBundle


                if (contextPath == null) {
                    // the bundle is not a web bundle
                    continue;
                }
               
                WebBundle webBundle = new WebBundle();
                contextPath.trim();
               
                // get the bundle name
                String name = (String) bundle.getHeaders().get(Constants.BUNDLE_NAME);
                // if there is no name, then default to symbolic name
                name = (name == null) ? bundle.getSymbolicName() : name;
                // if there is no symbolic name, resort to location
                name = (name == null) ? bundle.getLocation() : name;
                // get the bundle version
                String version = (String) bundle.getHeaders().get(Constants.BUNDLE_VERSION);
                name = ((version != null)) ? name + " (" + version + ")" : name;
                long bundleId = bundle.getBundleId();
                int level = bundle.adapt(BundleStartLevel.class).getStartLevel();
                if (!contextPath.startsWith("/")) {
                    contextPath = "/" + contextPath;
                }
               
                webBundle.setBundleId(bundleId);
                webBundle.setName(name);
                webBundle.setContextPath(contextPath);
                webBundle.setLevel(level);
                webBundle.setState(getStateString(bundle));
                webBundle.setWebState(state(bundle.getBundleId()));
               
                webBundles.add(webBundle);
            }
        }
       
View Full Code Here

TOP

Related Classes of org.apache.karaf.web.WebBundle

Copyright © 2018 www.massapicom. 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.