@Override public URL getResource( final String name ) { final String normalizedname = Path.normalizeResourcePath( name ); return getBundle().getResource( normalizedname ); }
/** * Create the executor used to start extensions asynchronously. * * @return an */ protected ExecutorService createExecutor() { return Executors.newScheduledThreadPool(3, new NamedThreadFactory("paxweb-extender")); }
bundles.add(bundle); bundles.addAll(wiredBundles); this.bundleClassLoader = new ResourceDelegatingBundleClassLoader( bundles); this.serverController = srvController;
List<Bundle> bundles = ((ResourceDelegatingBundleClassLoader) classLoader).getBundles(); BundleClassLoader parentClassLoader = new BundleClassLoader(bundle); ResourceDelegatingBundleClassLoader containerSpecificClassLoader = new ResourceDelegatingBundleClassLoader(bundles, parentClassLoader); context.setClassLoader(containerSpecificClassLoader); if (!context.isStarted()) {
private URL getResource(Bundle bundle, final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource [" + normalizedname + "]"); return bundle.getResource(normalizedname); }
bundles.add(webApp.getBundle()); bundles.addAll(wiredBundles); bundleClassLoader = new ResourceDelegatingBundleClassLoader(bundles); httpContext = new WebAppWebContainerContext( webContainer.createDefaultHttpContext(), webApp.getRootPath(),
/** * {@inheritDoc} */ @Override public URL getResource(final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource [" + normalizedname + "]"); return bundle.getResource(normalizedname); }
private Set<String> getResourcePaths(Bundle bundle, final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource paths of [" + normalizedname + "]"); final Enumeration<String> entryPaths = bundle .getEntryPaths(normalizedname); if (entryPaths == null || !entryPaths.hasMoreElements()) { return null; } Set<String> foundPaths = new HashSet<>(); while (entryPaths.hasMoreElements()) { foundPaths.add(entryPaths.nextElement()); } return foundPaths; }
/** * Search resource paths within the bundle jar. {@inheritDoc} */ @Override public Set<String> getResourcePaths(final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource paths of [" + normalizedname + "]"); final Enumeration<String> entryPaths = bundle .getEntryPaths(normalizedname); if (entryPaths == null || !entryPaths.hasMoreElements()) { return null; } Set<String> foundPaths = new HashSet<>(); while (entryPaths.hasMoreElements()) { foundPaths.add(entryPaths.nextElement()); } return foundPaths; }