Refine search
/** * Builds a {@link ClassNotFoundException}. * * @param clsName Class name. * @return The exception. */ protected ClassNotFoundException classNotFoundException(String clsName) { String s = "Failed to resolve class [name=" + clsName + ", bundleId=" + bundle.getBundleId() + ", symbolicName=" + bundle.getSymbolicName() + ", fallbackClsLdr=" + clsLdr + ']'; return new ClassNotFoundException(s); } }
public Void run() { props.put("id", new Long(bundle.getBundleId())); props.put("location", bundle.getLocation()); String name = bundle.getSymbolicName(); if (name != null) { props.put("name", name); } SignerProperty signer = new SignerProperty(bundle); if (signer.isBundleSigned()) { props.put("signer", signer); } return null; } });
private void register(final Bundle bundle) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "checking bundle {0}", bundle.getBundleId()); } Map<String, Callable<List<Class<?>>>> map; lock.writeLock().lock(); try { map = factories.get(bundle.getBundleId()); if (map == null) { map = new ConcurrentHashMap<String, Callable<List<Class<?>>>>(); factories.put(bundle.getBundleId(), map); } } finally { lock.writeLock().unlock(); } final Enumeration<URL> e = findEntries(bundle, "META-INF/services/", "*", false); if (e != null) { while (e.hasMoreElements()) { final URL u = e.nextElement(); final String url = u.toString(); if (url.endsWith("/")) { continue; } final String factoryId = url.substring(url.lastIndexOf("/") + 1); map.put(factoryId, new BundleSpiProvidersLoader(factoryId, u, bundle)); } } }
private void register(final Bundle bundle) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.log(Level.FINEST, "checking bundle {0}", bundle.getBundleId()); } Map<String, Callable<List<Class<?>>>> map; lock.writeLock().lock(); try { map = factories.get(bundle.getBundleId()); if (map == null) { map = new ConcurrentHashMap<String, Callable<List<Class<?>>>>(); factories.put(bundle.getBundleId(), map); } } finally { lock.writeLock().unlock(); } final Enumeration<URL> e = findEntries(bundle, "META-INF/services/", "*", false); if (e != null) { while (e.hasMoreElements()) { final URL u = e.nextElement(); final String url = u.toString(); if (url.endsWith("/")) { continue; } final String factoryId = url.substring(url.lastIndexOf("/") + 1); map.put(factoryId, new BundleSpiProvidersLoader(factoryId, u, bundle)); } } }
public Void run() { props.put("id", new Long(bundle.getBundleId())); props.put("location", bundle.getLocation()); String name = bundle.getSymbolicName(); if (name != null) { props.put("name", name); } SignerProperty signer = new SignerProperty(bundle); if (signer.isBundleSigned()) { props.put("signer", signer); } return null; } });
@Override public void bundleChanged(final BundleEvent event) { if (event.getType() == BundleEvent.RESOLVED) { register(event.getBundle()); } else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) { final Bundle unregisteredBundle = event.getBundle(); lock.writeLock().lock(); try { factories.remove(unregisteredBundle.getBundleId()); if (unregisteredBundle.getSymbolicName().equals(CoreBundleSymbolicNAME)) { bundleContext.removeBundleListener(this); factories.clear(); } } finally { lock.writeLock().unlock(); } } }
for (int i = 0; i < bundles.length; i++) installedBundleMap.put(bundles[i].getLocation(), bundles[i]); if (b.getBundleId() != 0)
public Void run() { map.put("id", new Long(bundle.getBundleId())); map.put("location", bundle.getLocation()); String name = bundle.getSymbolicName(); if (name != null) { map.put("name", name); } SignerProperty signer = new SignerProperty(bundle); if (signer.isBundleSigned()) { map.put("signer", signer); } return null; } });
@Override public void bundleChanged(final BundleEvent event) { if (event.getType() == BundleEvent.RESOLVED) { register(event.getBundle()); } else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) { final Bundle unregisteredBundle = event.getBundle(); lock.writeLock().lock(); try { factories.remove(unregisteredBundle.getBundleId()); if (unregisteredBundle.getSymbolicName().equals(CoreBundleSymbolicNAME)) { bundleContext.removeBundleListener(this); factories.clear(); } } finally { lock.writeLock().unlock(); } } }
protected boolean findFaceletsConfigResources(Bundle bundle) { Enumeration<URL> metaInfEn = bundle.findEntries("META-INF/", "*.taglib.xml", false); if (metaInfEn == null) { return false; } List<URL> faceletsConfigResources = new ArrayList<URL>(); while (metaInfEn.hasMoreElements()) { faceletsConfigResources.add(metaInfEn.nextElement()); } bundleIdFaceletsConfigResourcesMap.put(bundle.getBundleId(), faceletsConfigResources); return true; }
public Void run() { map.put("id", new Long(bundle.getBundleId())); map.put("location", bundle.getLocation()); String name = bundle.getSymbolicName(); if (name != null) { map.put("name", name); } SignerProperty signer = new SignerProperty(bundle); if (signer.isBundleSigned()) { map.put("signer", signer); } return null; } });
/** * Returns a string representation of the plug-in, suitable * for debugging purposes only. */ @Override public String toString() { Bundle myBundle = getBundle(); if (myBundle == null) return ""; //$NON-NLS-1$ String name = myBundle.getSymbolicName(); return name == null ? new Long(myBundle.getBundleId()).toString() : name; }
@Override public CdiContainer createContainer(Bundle bundle, Collection<Bundle> extensions) { WeldCdiContainer container = new WeldCdiContainer(bundleContext.getBundle(), bundle, extensions); containers.put(bundle.getBundleId(), container); log.debug("Weld Container created"); return container; }
public Void run() { map.put("id", new Long(bundle.getBundleId())); map.put("location", bundle.getLocation()); String name = bundle.getSymbolicName(); if (name != null) { map.put("name", name); } SignerProperty signer = new SignerProperty(bundle); if (signer.isBundleSigned()) { map.put("signer", signer); } return null; } });
/** * Locates the bundle ID for this BundleSymbolicName, if available. * * @param context to search (required) * @return the ID (or null if cannot be found) */ public Long findBundleIdWithoutFail(final BundleContext context) { Validate.notNull(context, "Bundle context is unavailable"); final Bundle[] bundles = context.getBundles(); if (bundles == null) { throw new IllegalStateException("Bundle IDs cannot be retrieved as BundleContext unavailable"); } for (final Bundle b : bundles) { if (getKey().equals(b.getSymbolicName())) { return b.getBundleId(); } } throw new IllegalStateException("Bundle symbolic name '" + getKey() + "' has no local bundle ID at this time"); }
@Override public void blueprintEvent(BlueprintEvent blueprintEvent) { if (LOG.isDebugEnabled()) { BundleState state = getState(blueprintEvent); LOG.debug("Blueprint app state changed to " + state + " for bundle " + blueprintEvent.getBundle().getBundleId()); } states.put(blueprintEvent.getBundle().getBundleId(), blueprintEvent); }
public Object run() { map.put("id", new Long(bundle.getBundleId())); map.put("location", bundle.getLocation()); String name = bundle.getSymbolicName(); if (name != null) { map.put("name", name); } SignerProperty signer = new SignerProperty(bundle); if (signer.isBundleSigned()) { map.put("signer", signer); } return null; } });
UpdateHelper( final SimpleWebConsolePlugin plugin, final Bundle bundle, final File bundleFile, boolean refreshPackages ) { super( plugin, "Background Update " + bundle.getSymbolicName() + " (" + bundle.getBundleId() + ")", bundleFile, refreshPackages ); this.bundle = bundle; }
public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) { if (LOG.isDebugEnabled()) { BundleState state = mapEventToState(event); LOG.debug("Spring app state changed to " + state + " for bundle " + event.getBundle().getBundleId()); } states.put(event.getBundle().getBundleId(), event); }
@Override public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) { final List<Class<?>> scanned = new ClassScanner(bundle, bundleContext) .findClasses(bundleHeader, annotationClass); classes.remove(bundle.getBundleId()); if (scanned.size() > 0) { if (LOG.isDebugEnabled()) { LOG.debug("Updating classes ({}) from bundle: {}", scanned.size(), bundle.getSymbolicName()); } classes.put(bundle.getBundleId(), scanned); } }