org.osgi.framework.Bundle.update()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(97)

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

Bundle.update介绍

[英]Updates this bundle.

This method performs the same function as calling #update(InputStream) with a null InputStream.
[中]更新此捆绑包。
此方法执行与使用空InputStream调用#update(InputStream)相同的功能。

代码示例

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

b.update();

代码示例来源:origin: org.apache.felix/org.apache.felix.webconsole

protected Bundle doRun( final InputStream bundleStream ) throws BundleException
{
  bundle.update( bundleStream );
  return bundle;
}

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

protected Bundle doRun( final InputStream bundleStream ) throws BundleException
{
  bundle.update( bundleStream );
  return bundle;
}

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public void update() throws BundleException {
  Bundle current = systemBundle;
  if (current == null)
    return;
  current.update();
}

代码示例来源:origin: org.jboss.osgi/jboss-osgi-spi

public void update(InputStream input) throws BundleException
  {
   bundle.update(input);
  }
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public void update() throws BundleException {
  Bundle current = systemBundle;
  if (current == null)
    return;
  current.update();
}

代码示例来源:origin: org.apache.karaf.shell/org.apache.karaf.shell.osgi

protected void doExecute(Bundle bundle) throws Exception {
  if (location != null) {
    InputStream is = new URL(location).openStream();
    bundle.update(is);
  } else {
    bundle.update();
  }
}

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

protected void doExecute(Bundle bundle) throws Exception {
  if (location != null) {
    InputStream is = new URL(location).openStream();
    bundle.update(is);
  } else {
    bundle.update();
  }
}

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

public void updateFromUrl(String url) throws MalformedURLException, BundleException, IOException {
  //TODO should we use url handler service?
  bundle.update(new URL(url).openStream());
  
}
public void refreshBundle() throws BundleNotAvailableException, ServiceNotAvailableException {

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

private void update(Bundle bundle, URL location) throws IOException, BundleException {
  try (InputStream is = location.openStream()) {
    if (raw) {
      bundle.update(is);
    } else {
      File file = BundleUtils.fixBundleWithUpdateLocation(is, location.toString());
      try (FileInputStream fis = new FileInputStream(file)) {
        bundle.update(fis);
      }
      file.delete();
    }
  }
}

代码示例来源:origin: apache/karaf-cellar

private void update(Bundle bundle, URL location) throws IOException, BundleException {
  try (InputStream is = location.openStream()) {
    File file = BundleUtils.fixBundleWithUpdateLocation(is, location.toString());
    try (FileInputStream fis = new FileInputStream(file)) {
      bundle.update(fis);
    }
    file.delete();
  }
}

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

public void update(Long [] id) {
 try {
  bc.getBundle(id[0].longValue()).update();
 } catch (BundleException e) {
  e.printStackTrace();
 }
}

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

public void updateBundleFromUrl(String bundleSymbolicName, String url)
    throws BundleException, BundleNotAvailableException,
    MalformedURLException, IOException {
  long id = InstrumentationSupport.getBundleId(bundleSymbolicName, ac);
  ac.getBundleContext().getBundle(id).update((new URL(url)).openStream());
}

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

@Override
public void updateBundle(Bundle bundle, String uri, InputStream is) throws BundleException {
  // We need to wrap the bundle to insert a Bundle-UpdateLocation header
  try {
    File file = BundleUtils.fixBundleWithUpdateLocation(is, uri);
    bundle.update(new FileInputStream(file));
    file.delete();
  } catch (IOException e) {
    throw new BundleException("Unable to update bundle", e);
  }
}

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

public void updateBundle(String bundleSymbolicName) throws BundleException,
    BundleNotAvailableException {
  long id = InstrumentationSupport.getBundleId(bundleSymbolicName, ac);
  ac.getBundleContext().getBundle(id).update();
}

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

public void restartFramework() throws NotImplementedException {
  try {
    ac.getBundleContext().getBundle(0).update();
  } catch (BundleException be) {
    throw new NotImplementedException(
        "Restarting not implemented in this framework", be);
  }
}

代码示例来源:origin: org.wisdom-framework/wisdom-monitor

@Override
  public Result call() throws Exception {
    try {
      logger().info("Updating bundle {} from {}", bundle.getSymbolicName(), bundle.getLocation());
      bundle.update();
      return ok();
    } catch (BundleException e) {
      logger().error("Cannot update bundle {}", bundle.getSymbolicName(), e);
      return badRequest(e);
    }
  }
});

代码示例来源:origin: org.apache.struts/struts2-osgi-admin-bundle

public String update() throws BundleException {
  Bundle bundle = osgiHost.getBundles().get(id);
  try {
    bundle.update();
  } catch (Exception e) {
    addActionError(e.toString());
  }
  return view();
}

代码示例来源:origin: com.sun.enterprise/osgi-adapter

public void refresh() {
  URI location = md.getLocations()[0];
  File f = new File(location);
  if (f.lastModified() > bundle.getLastModified()) {
    try {
      bundle.update();
      registry.getPackageAdmin().refreshPackages(new Bundle[]{bundle});
    } catch (BundleException e) {
      throw new RuntimeException(e);
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/osgi-adapter

public void refresh() {
  URI location = md.getLocations()[0];
  File f = new File(location);
  if (f.lastModified() > bundle.getLastModified()) {
    try {
      bundle.update();
      registry.getPackageAdmin().refreshPackages(new Bundle[]{bundle});
    } catch (BundleException e) {
      throw new RuntimeException(e);
    }
  }
}

相关文章