contexts.put(archive.getId(), context);
@Override public String getId() { return delegate.getId(); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.Archive#getId() */ @Override public String getId() { return this.getArchive().getId(); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.Archive#getId() */ @Override public String getId() { return this.getArchive().getId(); }
/** * 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; }
/** * {@inheritDoc} * * @see java.nio.file.attribute.BasicFileAttributes#fileKey() */ @Override public Object fileKey() { return this.getArchive().getId() + "/" + this.path.toString(); }
/** * {@inheritDoc} * * @see java.nio.file.attribute.BasicFileAttributes#fileKey() */ @Override public Object fileKey() { return this.getArchive().getId() + "/" + this.path.toString(); }
/** * 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(); }
/** * 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(); }
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);
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);
@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()); }
@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); } }
@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); } }