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

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

本文整理了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

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

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

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

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

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

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

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

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

public static boolean isFragment(Resource resource)
{
  if (resource instanceof BundleRevision)
    return isFragment((BundleRevision) resource);
  else
    return false;
}

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

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

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

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

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

public Class getClassByDelegation(String name) throws ClassNotFoundException
{
  if (!m_exportNames.contains(Util.getClassPackage(name)))
  {
    throw new ClassNotFoundException(name);
  }
  return getClass().getClassLoader().loadClass(name);
}

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

public URL getResource(String name) throws ResourceNotFoundException
{
  // Get the package of the target class.
  String pkgName = Util.getResourcePackage(name);
  ResolvedPackage rp = (ResolvedPackage) m_pkgMap.get(pkgName);
  if (rp != null)
  {
    URL url = m_exporter.getResourceByDelegation(name);
    if (url != null)
    {
      return url;
    }
    // Don't throw ResourceNotFoundException because module
    // dependencies support split packages.
  }
  return null;
}

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

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

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

@Override
public List<URL> findEntries(String path, String filePattern, int options)
{
  if (isInUse())
  {
    if (!Util.isFragment(m_revision))
    {
      Enumeration<URL> e =
          m_revision.getBundle().getFramework()
          .findBundleEntries(m_revision, path, filePattern,
              (options & BundleWiring.FINDENTRIES_RECURSE) > 0);
      List<URL> entries = new ArrayList<URL>();
      while ((e != null) && e.hasMoreElements())
      {
        entries.add(e.nextElement());
      }
      return  Util.newImmutableList(entries);
    }
    return Collections.EMPTY_LIST;
  }
  return null;
}

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

synchronized void addRevision(BundleRevision br)
{
  // Always attempt to remove the revision, since
  // this method can be used for re-indexing a revision
  // after it has been resolved.
  removeRevision(br);
  m_revisions.add(br);
  // Add singletons to the singleton map.
  boolean isSingleton = Util.isSingleton(br);
  if (isSingleton)
  {
    // Index the new singleton.
    addToSingletonMap(m_singletons, br);
  }
  // We always need to index non-singleton bundle capabilities, but
  // singleton bundles only need to be index if they are resolved.
  // Unresolved singleton capabilities are only indexed before a
  // resolve operation when singleton selection is performed.
  if (!isSingleton || (br.getWiring() != null))
  {
    if (Util.isFragment(br))
    {
      m_fragments.add(br);
    }
    indexCapabilities(br);
  }
}

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

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

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

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

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

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

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

public boolean isIncluded(String name)
{
  if ((m_includeFilter == null) && (m_excludeFilter == null))
  {
    return true;
  }
  // Get the class name portion of the target class.
  String className = Util.getClassName(name);
  // If there are no include filters then all classes are included
  // by default, otherwise try to find one match.
  boolean included = (m_includeFilter == null);
  for (int i = 0;
    (!included) && (m_includeFilter != null) && (i < m_includeFilter.size());
    i++)
  {
    included = SimpleFilter.compareSubstring(m_includeFilter.get(i), className);
  }
  // If there are no exclude filters then no classes are excluded
  // by default, otherwise try to find one match.
  boolean excluded = false;
  for (int i = 0;
    (!excluded) && (m_excludeFilter != null) && (i < m_excludeFilter.size());
    i++)
  {
    excluded = SimpleFilter.compareSubstring(m_excludeFilter.get(i), className);
  }
  return included && !excluded;
}

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

@Override
public ClassLoader getClassLoader()
{
  if (m_isDisposed || Util.isFragment(m_revision))
  {
    return null;
  }
  return getClassLoaderInternal();
}

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

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

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

public Class getClass(String name) throws ClassNotFoundException
{
  // Get the package of the target class.
  String pkgName = Util.getClassPackage(name);
  ResolvedPackage rp = (ResolvedPackage) m_pkgMap.get(pkgName);
  if (rp != null)
  {
    try
    {
      Class clazz = m_exporter.getClassByDelegation(name);
      if (clazz != null)
      {
        return clazz;
      }
    }
    catch (ClassNotFoundException ex)
    {
      // Do not throw the exception here, since we want
      // to continue search other package sources and
      // ultimately the module's own content.
    }
  }
  return null;
}

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

public Enumeration getResources(String name) throws ResourceNotFoundException
{
  // Get the package of the target class.
  String pkgName = Util.getResourcePackage(name);
  // See if we have a resolved package for the resource's package.
  // If so, loop through all package sources and aggregate any
  // matching resource enumerations.
  ResolvedPackage rp = (ResolvedPackage) m_pkgMap.get(pkgName);
  if (rp != null)
  {
    Enumeration urls = m_exporter.getResourcesByDelegation(name);
    if (urls != null)
    {
      return urls;
    }
    // Don't throw ResourceNotFoundException because module
    // dependencies support split packages.
  }
  return null;
}

相关文章