brooklyn.entity.basic.Entities.newDownloader()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(107)

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

Entities.newDownloader介绍

暂无

代码示例

代码示例来源:origin: io.brooklyn/brooklyn-core

public static DownloadResolver newDownloader(EntityDriver driver) {
  return newDownloader(driver, ImmutableMap.<String,Object>of());
}

代码示例来源:origin: io.brooklyn/brooklyn-software-nosql

@Override
public void install() {
  DownloadResolver resolver = Entities.newDownloader(this);
  List<String> urls = resolver.getTargets();
  String saveAs = resolver.getFilename();
  expandedInstallDir = getInstallDir()+"/"+resolver.getUnpackedDirectoryName(format("redis-%s", getVersion()));
  List<String> commands = ImmutableList.<String>builder()
      .addAll(BashCommands.downloadUrlAs(urls, saveAs))
      .add(BashCommands.INSTALL_TAR)
      .add("tar xzfv " + saveAs)
      .add(format("cd redis-%s", getVersion()))
      .add("make clean && make")
      .build();
  newScript(INSTALLING)
      .failOnNonZeroResultCode()
      .body.append(commands).execute();
}

代码示例来源:origin: io.brooklyn/brooklyn-software-webapp

@Override
public void install() {
  DownloadResolver resolver = Entities.newDownloader(this);
  List<String> urls = resolver.getTargets();
  String saveAs = resolver.getFilename();
  expandedInstallDir = getInstallDir()+"/"+resolver.getUnpackedDirectoryName("apache-tomcat-"+getVersion());
  List<String> commands = new LinkedList<String>();
  commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs));
  commands.add(BashCommands.INSTALL_TAR);
  commands.add(format("tar xvzf %s",saveAs));
  newScript(INSTALLING)
      .failOnNonZeroResultCode()
      .body.append(commands).execute();
}

代码示例来源:origin: io.brooklyn/brooklyn-software-messaging

@Override
public void install() {
  DownloadResolver resolver = Entities.newDownloader(this);
  List<String> urls = resolver.getTargets();
  String saveAs = resolver.getFilename();
  expandedInstallDir = getInstallDir()+"/"+resolver.getUnpackedDirectoryName(format("kafka-%s-src", getVersion()));
  List<String> commands = new LinkedList<String>();
  commands.addAll(BashCommands.downloadUrlAs(urls, saveAs));
  commands.add(BashCommands.INSTALL_TAR);
  commands.add("tar xzfv "+saveAs);
  commands.add("cd "+expandedInstallDir);
  commands.add("./sbt update");
  commands.add("./sbt package");
  if (isV08()) {
    // target not known in v0.7.x but required in v0.8.0-beta1
    commands.add("./sbt assembly-package-dependency");
  }
  newScript(INSTALLING)
      .failOnNonZeroResultCode()
      .body.append(commands)
      .execute();
}

代码示例来源:origin: io.brooklyn/brooklyn-software-webapp

public void install() {
  DownloadResolver resolver = Entities.newDownloader(this);
  List<String> urls = resolver.getTargets();
  String saveAs = resolver.getFilename();
  expandedInstallDir = getInstallDir()+"/"+resolver.getUnpackedDirectoryName(format("jboss-as-%s", getVersion()));
  
  List<String> commands = new LinkedList<String>();
  commands.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs));
  commands.add(BashCommands.INSTALL_TAR);
  commands.add("tar xzfv " + saveAs);
  newScript(INSTALLING).
      failOnNonZeroResultCode().
      // don't set vars yet -- it resolves dependencies (e.g. DB) which we don't want until we start
      environmentVariablesReset().
      body.append(commands).execute();
}

代码示例来源:origin: io.brooklyn/brooklyn-software-base

DownloadResolver resolver = Entities.newDownloader(this, ImmutableMap.of("filename", "brooklyn-dist-"+getVersion()+"-dist.tar.gz"));
List<String> urls = resolver.getTargets();
String saveAs = resolver.getFilename();

相关文章