org.apache.felix.framework.util.Util类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(191)

本文整理了Java中org.apache.felix.framework.util.Util类的一些代码示例,展示了Util类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util类的具体详情如下:
包路径:org.apache.felix.framework.util.Util
类名称:Util

Util介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-roo

  1. Util.substVars(props.getProperty(name), name, null, null));

代码示例来源:origin: nroduit/Weasis

  1. public static URLConnection getAdaptedConnection(URL url) throws IOException {
  2. URLConnection connection = url.openConnection();
  3. // Prevent caching of Java WebStart.
  4. connection.setUseCaches(false);
  5. // Support for http proxy authentication.
  6. String auth = System.getProperty("http.proxyAuth", null); //$NON-NLS-1$
  7. if ((auth != null) && (auth.length() > 0)) {
  8. if ("http".equals(url.getProtocol()) || "https".equals(url.getProtocol())) { //$NON-NLS-1$ //$NON-NLS-2$
  9. String base64 = Util.base64Encode(auth);
  10. connection.setRequestProperty("Proxy-Authorization", "Basic " + base64); //$NON-NLS-1$ //$NON-NLS-2$
  11. }
  12. }
  13. return connection;
  14. }

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. public static String base64Encode(String s) throws IOException
  2. {
  3. return encode(s.getBytes(), 0);
  4. }

代码示例来源:origin: apache/felix

  1. private boolean isFiltered(String name)
  2. String pkgName = Util.getClassPackage(name);
  3. List<List<String>> includeFilters = m_includedPkgFilters.get(pkgName);
  4. List<List<String>> excludeFilters = m_excludedPkgFilters.get(pkgName);
  5. String className = Util.getClassName(name);

代码示例来源:origin: apache/felix

  1. public static boolean isFragment(Resource resource)
  2. {
  3. if (resource instanceof BundleRevision)
  4. return isFragment((BundleRevision) resource);
  5. else
  6. return false;
  7. }

代码示例来源:origin: apache/felix

  1. Util.getClassPackage(className);
  2. BundleWire requesterWire = Util.getWire(requesterRevision, pkgName);
  3. BundleCapability requesterCap = Util.getPackageCapability(requesterRevision, pkgName);
  4. BundleWire providerWire = Util.getWire(providerRevision, pkgName);
  5. BundleCapability providerCap = Util.getPackageCapability(providerRevision, pkgName);

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. ? Util.getClassPackage(name)
  2. : Util.getResourcePackage(name);

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. public Class getClassByDelegation(String name) throws ClassNotFoundException
  2. {
  3. if (!m_exportNames.contains(Util.getClassPackage(name)))
  4. {
  5. throw new ClassNotFoundException(name);
  6. }
  7. return getClass().getClassLoader().loadClass(name);
  8. }

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. public URL getResource(String name) throws ResourceNotFoundException
  2. {
  3. // Get the package of the target class.
  4. String pkgName = Util.getResourcePackage(name);
  5. ResolvedPackage rp = (ResolvedPackage) m_pkgMap.get(pkgName);
  6. if (rp != null)
  7. {
  8. URL url = m_exporter.getResourceByDelegation(name);
  9. if (url != null)
  10. {
  11. return url;
  12. }
  13. // Don't throw ResourceNotFoundException because module
  14. // dependencies support split packages.
  15. }
  16. return null;
  17. }

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. Util.getClassPackage(className);
  2. IModule requesterModule = ((BundleImpl) requester).getCurrentModule();
  3. IWire requesterWire = Util.getWire(requesterModule, pkgName);
  4. IWire providerWire = Util.getWire(providerModule, pkgName);

代码示例来源:origin: apache/felix

  1. @Override
  2. public List<URL> findEntries(String path, String filePattern, int options)
  3. {
  4. if (isInUse())
  5. {
  6. if (!Util.isFragment(m_revision))
  7. {
  8. Enumeration<URL> e =
  9. m_revision.getBundle().getFramework()
  10. .findBundleEntries(m_revision, path, filePattern,
  11. (options & BundleWiring.FINDENTRIES_RECURSE) > 0);
  12. List<URL> entries = new ArrayList<URL>();
  13. while ((e != null) && e.hasMoreElements())
  14. {
  15. entries.add(e.nextElement());
  16. }
  17. return Util.newImmutableList(entries);
  18. }
  19. return Collections.EMPTY_LIST;
  20. }
  21. return null;
  22. }

代码示例来源:origin: apache/felix

  1. synchronized void addRevision(BundleRevision br)
  2. {
  3. // Always attempt to remove the revision, since
  4. // this method can be used for re-indexing a revision
  5. // after it has been resolved.
  6. removeRevision(br);
  7. m_revisions.add(br);
  8. // Add singletons to the singleton map.
  9. boolean isSingleton = Util.isSingleton(br);
  10. if (isSingleton)
  11. {
  12. // Index the new singleton.
  13. addToSingletonMap(m_singletons, br);
  14. }
  15. // We always need to index non-singleton bundle capabilities, but
  16. // singleton bundles only need to be index if they are resolved.
  17. // Unresolved singleton capabilities are only indexed before a
  18. // resolve operation when singleton selection is performed.
  19. if (!isSingleton || (br.getWiring() != null))
  20. {
  21. if (Util.isFragment(br))
  22. {
  23. m_fragments.add(br);
  24. }
  25. indexCapabilities(br);
  26. }
  27. }

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. String pkgName = Util.getClassPackage(name);
  2. long impId = Util.getBundleIdFromModuleId(module.getId());
  3. wires[i].getCapability().getProperties().get(ICapability.PACKAGE_PROPERTY).equals(pkgName))
  4. long expId = Util.getBundleIdFromModuleId(wires[i].getExporter().getId());
  5. long expId = Util.getBundleIdFromModuleId(exporters[0].m_module.getId());

代码示例来源:origin: apache/felix

  1. if (Util.isFragment(br))
  2. if (wiring != null)
  3. List<BundleRevision> fragments = Util.getFragments(wiring);
  4. if (fragments != null)

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. Util.isExtensionBundle(
  2. bundle.getCurrentModule().getHeaders()))
  3. if ((oldState == Bundle.ACTIVE) && Util.isFragment(bundle.getCurrentModule()))

代码示例来源:origin: apache/felix

  1. public boolean isIncluded(String name)
  2. {
  3. if ((m_includeFilter == null) && (m_excludeFilter == null))
  4. {
  5. return true;
  6. }
  7. // Get the class name portion of the target class.
  8. String className = Util.getClassName(name);
  9. // If there are no include filters then all classes are included
  10. // by default, otherwise try to find one match.
  11. boolean included = (m_includeFilter == null);
  12. for (int i = 0;
  13. (!included) && (m_includeFilter != null) && (i < m_includeFilter.size());
  14. i++)
  15. {
  16. included = SimpleFilter.compareSubstring(m_includeFilter.get(i), className);
  17. }
  18. // If there are no exclude filters then no classes are excluded
  19. // by default, otherwise try to find one match.
  20. boolean excluded = false;
  21. for (int i = 0;
  22. (!excluded) && (m_excludeFilter != null) && (i < m_excludeFilter.size());
  23. i++)
  24. {
  25. excluded = SimpleFilter.compareSubstring(m_excludeFilter.get(i), className);
  26. }
  27. return included && !excluded;
  28. }

代码示例来源:origin: apache/felix

  1. @Override
  2. public ClassLoader getClassLoader()
  3. {
  4. if (m_isDisposed || Util.isFragment(m_revision))
  5. {
  6. return null;
  7. }
  8. return getClassLoaderInternal();
  9. }

代码示例来源:origin: apache/felix

  1. String pkgName = (isClass) ? Util.getClassPackage(name) : Util.getResourcePackage(name);

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. public Class getClass(String name) throws ClassNotFoundException
  2. {
  3. // Get the package of the target class.
  4. String pkgName = Util.getClassPackage(name);
  5. ResolvedPackage rp = (ResolvedPackage) m_pkgMap.get(pkgName);
  6. if (rp != null)
  7. {
  8. try
  9. {
  10. Class clazz = m_exporter.getClassByDelegation(name);
  11. if (clazz != null)
  12. {
  13. return clazz;
  14. }
  15. }
  16. catch (ClassNotFoundException ex)
  17. {
  18. // Do not throw the exception here, since we want
  19. // to continue search other package sources and
  20. // ultimately the module's own content.
  21. }
  22. }
  23. return null;
  24. }

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

  1. public Enumeration getResources(String name) throws ResourceNotFoundException
  2. {
  3. // Get the package of the target class.
  4. String pkgName = Util.getResourcePackage(name);
  5. // See if we have a resolved package for the resource's package.
  6. // If so, loop through all package sources and aggregate any
  7. // matching resource enumerations.
  8. ResolvedPackage rp = (ResolvedPackage) m_pkgMap.get(pkgName);
  9. if (rp != null)
  10. {
  11. Enumeration urls = m_exporter.getResourcesByDelegation(name);
  12. if (urls != null)
  13. {
  14. return urls;
  15. }
  16. // Don't throw ResourceNotFoundException because module
  17. // dependencies support split packages.
  18. }
  19. return null;
  20. }

相关文章