org.apache.felix.framework.util.Util.getResourcePackage()方法的使用及代码示例

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

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

Util.getResourcePackage介绍

暂无

代码示例

代码示例来源: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;
}

代码示例来源: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

public Enumeration getResources(String name) throws ResourceNotFoundException
{
  Enumeration urls = null;
  // Get the package of the target class.
  String pkgName = Util.getResourcePackage(name);
  // Only check when the package of the target resource is
  // the same as the package for the wire.
  if (m_capability.getNamespace().equals(ICapability.PACKAGE_NAMESPACE) &&
    m_capability.getProperties().get(ICapability.PACKAGE_PROPERTY).equals(pkgName))
  {
    urls = m_exporter.getResourcesByDelegation(name);
    // If no resource was found, then we must throw an exception
    // since the exporter for this package did not contain the
    // requested class.
    if (urls == null)
    {
      throw new ResourceNotFoundException(name);
    }
  }
  return urls;
}

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

public URL getResource(String name) throws ResourceNotFoundException
{
  URL url = null;
  // Get the package of the target class.
  String pkgName = Util.getResourcePackage(name);
  // Only check when the package of the target resource is
  // the same as the package for the wire.
  if (m_capability.getNamespace().equals(ICapability.PACKAGE_NAMESPACE) &&
    m_capability.getProperties().get(ICapability.PACKAGE_PROPERTY).equals(pkgName))
  {
    // Delegate to the exporting module, rather than its
    // content, so that it can follow any internal wires it may have
    // (e.g., if the package has multiple sources).
    url = m_exporter.getResourceByDelegation(name);
    // If no resource was found, then we must throw an exception
    // since the exporter for this package did not contain the
    // requested class.
    if (url == null)
    {
      throw new ResourceNotFoundException(name);
    }
  }
  return url;
}

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

String pkgName = Util.getResourcePackage(name);

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

: Util.getResourcePackage(name);

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

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

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

String pkgName = Util.getResourcePackage(name);

相关文章