org.jboss.shrinkwrap.api.Archive.getId()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(115)

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

Archive.getId介绍

[英]Obtains a globally-unique identifier for this Archive
[中]获取此存档的全局唯一标识符

代码示例

代码示例来源:origin: oracle/helidon

@Override
public void undeploy(Archive<?> archive) {
  RunContext context = contexts.remove(archive.getId());
  if (null == context) {
    LOGGER.severe("Undeploying an archive that was not deployed. ID: " + archive.getId());
    return;

代码示例来源:origin: oracle/helidon

contexts.put(archive.getId(), context);

代码示例来源:origin: wildfly/wildfly-arquillian

@Override
public String getId() {
  return delegate.getId();
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

/**
 * {@inheritDoc}
 *
 * @see org.jboss.shrinkwrap.api.Archive#getId()
 */
@Override
public String getId() {
  return this.getArchive().getId();
}

代码示例来源:origin: shrinkwrap/shrinkwrap

/**
 * {@inheritDoc}
 *
 * @see org.jboss.shrinkwrap.api.Archive#getId()
 */
@Override
public String getId() {
  return this.getArchive().getId();
}

代码示例来源:origin: shrinkwrap/shrinkwrap

/**
 * Constructs a new {@link URI} with the form:
 *
 * <code>shrinkwrap://{archive.getId()}/</code>
 *
 * @param archive
 * @return
 * @throws IllegalArgumentException
 *             If the archive is not specified
 */
public static URI getRootUri(final Archive<?> archive) throws IllegalArgumentException {
  if (archive == null) {
    throw new IllegalArgumentException("Archive must be specified");
  }
  final StringBuilder sb = new StringBuilder();
  sb.append(PROTOCOL);
  sb.append(URI_PROTOCOL_SUFFIX);
  sb.append(archive.getId());
  sb.append('/');
  final URI uri = URI.create(sb.toString());
  return uri;
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-nio2

/**
 * {@inheritDoc}
 *
 * @see java.nio.file.attribute.BasicFileAttributes#fileKey()
 */
@Override
public Object fileKey() {
  return this.getArchive().getId() + "/" + this.path.toString();
}

代码示例来源:origin: shrinkwrap/shrinkwrap

/**
 * {@inheritDoc}
 *
 * @see java.nio.file.attribute.BasicFileAttributes#fileKey()
 */
@Override
public Object fileKey() {
  return this.getArchive().getId() + "/" + this.path.toString();
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

/**
 * Creates a new instance, wrapping the specified {@link Archive}
 */
public ZipSerializableViewImpl(final Archive<?> archive) {
  Validate.notNull(archive, "Archive must be specified");
  final String name = archive.getName();
  Validate.notNullOrEmpty(name, "Name of archive must be specified");
  this.archive = archive;
  this.name = name;
  this.id = archive.getId();
}

代码示例来源:origin: shrinkwrap/shrinkwrap

/**
 * Creates a new instance, wrapping the specified {@link Archive}
 */
public ZipSerializableViewImpl(final Archive<?> archive) {
  Validate.notNull(archive, "Archive must be specified");
  final String name = archive.getName();
  Validate.notNullOrEmpty(name, "Name of archive must be specified");
  this.archive = archive;
  this.name = name;
  this.id = archive.getId();
}

代码示例来源:origin: shrinkwrap/shrinkwrap

private void testCurrentFields(final Archive<?> payload, final Archive<?> roundtrip) {
  this.testOriginalFields(payload, roundtrip);
  Assert.assertEquals("ID not as expected after serialization", payload.getId(), roundtrip.getId());
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-nio2

archive = Archive.class.cast(archiveArg);
    if (!archive.getId().equals(id)) {
      throw new IllegalArgumentException("Specified archive " + archive.toString()
        + " does not have name matching the host of specified URI: " + uri.toString());
final ShrinkWrapFileSystem existsFs = this.createdFileSystems.get(archive.getId());
if (existsFs != null && existsFs.isOpen()) {
  throw new FileSystemAlreadyExistsException("File System for URI " + uri.toString() + " already exists: "
  log.fine("Created new filesystem: " + newFs.toString() + " for URI " + uri.toString());
this.createdFileSystems.put(archive.getId(), newFs);

代码示例来源:origin: shrinkwrap/shrinkwrap

archive = Archive.class.cast(archiveArg);
    if (!archive.getId().equals(id)) {
      throw new IllegalArgumentException("Specified archive " + archive.toString()
        + " does not have name matching the host of specified URI: " + uri.toString());
final ShrinkWrapFileSystem existsFs = this.createdFileSystems.get(archive.getId());
if (existsFs != null && existsFs.isOpen()) {
  throw new FileSystemAlreadyExistsException("File System for URI " + uri.toString() + " already exists: "
  log.fine("Created new filesystem: " + newFs.toString() + " for URI " + uri.toString());
this.createdFileSystems.put(archive.getId(), newFs);

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
public void toUri() {
  final Path path = fileSystem.getPath("/toplevel/second");
  final URI uri = path.toUri();
  final String expected = ShrinkWrapFileSystems.PROTOCOL + "://" + fileSystem.getArchive().getId()
    + path.toString();
  Assert.assertEquals("toUri did not return form as expected", expected, uri.toString());
}

代码示例来源:origin: wildfly-swarm-archive/ARCHIVE-wildfly-swarm

@Override
public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
  StartupTimeout startupTimeout = this.testClass.getAnnotation(StartupTimeout.class);
  if (startupTimeout != null) {
    setTimeout(startupTimeout.value());
  }
  if (this.testClass.getAnnotation(InVM.class) != null) {
    this.delegateContainer = new InVMSimpleContainer(this.testClass);
  } else {
    this.delegateContainer = new UberjarSimpleContainer(this.testClass);
  }
  try {
    this.delegateContainer
        .requestedMavenArtifacts(this.requestedMavenArtifacts)
        .start(archive);
    // start wants to connect to the remote container, which isn't up until now, so
    // we override start above and call it here instead
    super.start();
    ProtocolMetaData metaData = new ProtocolMetaData();
    metaData.addContext(createDeploymentContext(archive.getId()));
    return metaData;
  } catch (Exception e) {
    throw new DeploymentException(e.getMessage(), e);
  }
}

代码示例来源:origin: io.thorntail/arquillian-adapter

@Override
public synchronized ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
  BootstrapUtil.convertSwarmSystemPropertiesToThorntail();
  StartupTimeout startupTimeout = this.testClass.getAnnotation(StartupTimeout.class);
  if (startupTimeout != null) {
    setTimeout(startupTimeout.value());
  }
  this.delegateContainer = new UberjarSimpleContainer(this.containerContext.get(), this.deploymentContext.get(), this.testClass);
  try {
    this.delegateContainer
        .setJavaVmArguments(this.getJavaVmArguments())
        .requestedMavenArtifacts(this.requestedMavenArtifacts)
        .start(archive);
    // start wants to connect to the remote container, which isn't up until now, so
    // we override start above and call it here instead
    super.start();
    ProtocolMetaData metaData = new ProtocolMetaData();
    metaData.addContext(createDeploymentContext(archive.getId()));
    return metaData;
  } catch (Throwable e) {
    if (e instanceof LifecycleException) {
      e = e.getCause();
    }
    throw new DeploymentException(e.getMessage(), e);
  }
}

相关文章