use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.
the class PmSession method getResolvedLocation.
public FeaturePackLocation getResolvedLocation(Path installation, String location) throws ProvisioningException {
final char endC = location.charAt(location.length() - 1);
if (endC == FeaturePackLocation.FREQUENCY_START || endC == FeaturePackLocation.BUILD_START) {
location = location.substring(0, location.length() - 1);
}
// A producer spec without any universe nor channel.
/*
if (!location.contains("" + FeaturePackLocation.UNIVERSE_START) && !location.contains("" + FeaturePackLocation.CHANNEL_START)) {
location = new FeaturePackLocation(universe.getDefaultUniverseSpec(installation), location, null, null, null).toString();
}
*/
FeaturePackLocation loc = FeaturePackLocation.fromString(location);
if (loc.getUniverse() == null) {
loc = loc.replaceUniverse(universe.getDefaultUniverseSpec(installation));
}
return getResolvedLocation(installation, loc);
}
use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.
the class PmSessionCommand method handleCommandExecutionException.
private static Throwable handleCommandExecutionException(Throwable t) {
if (t instanceof CommandExecutionException) {
CommandExecutionException cex = (CommandExecutionException) t;
if (cex.getPmSession() != null) {
// Handle default and named universes
if (cex.getCause() instanceof LatestVersionNotAvailableException) {
LatestVersionNotAvailableException cause = (LatestVersionNotAvailableException) cex.getCause();
FeaturePackLocation fpl = cex.getPmSession().getExposedLocation(null, cause.getLocation());
t = new LatestVersionNotAvailableException(fpl);
}
}
}
return t;
}
use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.
the class UniverseManager method resolveBuiltinUniverse.
/**
* Universe resolution is done in a separate thread to not impact startup
* time.
*/
synchronized void resolveBuiltinUniverse() {
if (closed) {
return;
}
Future<?> f = executorService.submit(() -> {
synchronized (UniverseManager.this) {
if (closed) {
return;
}
try {
List<FeaturePackLocation> deps = new ArrayList<>();
builtinUniverse = (MavenUniverse) universeResolver.getUniverse(builtinUniverseSpec, true);
if (closed) {
return;
}
// speed-up future completion and execution by retrieving producers and channels
for (Producer<?> p : builtinUniverse.getProducers()) {
final MavenProducer mvnProducer = (MavenProducer) p;
if (mvnProducer.isResolvedLocally()) {
mvnProducer.refresh();
}
if (closed) {
return;
}
for (Channel c : p.getChannels()) {
if (closed) {
return;
}
FeaturePackLocation ploc = new FeaturePackLocation(builtinUniverseSpec, p.getName(), c.getName(), null, null);
deps.add(ploc);
}
}
} catch (Exception ex) {
CliLogging.exceptionResolvingBuiltinUniverse(ex);
}
}
});
submited.add(f);
}
use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.
the class UniverseManager method getBuild.
private static String getBuild(UniverseSpec spec, Producer<?> producer, Channel channel, String freq) {
FeaturePackLocation loc = new FeaturePackLocation(spec, producer.getName(), channel.getName(), freq, null);
String build = null;
try {
build = channel.getLatestBuild(loc);
} catch (ProvisioningException ex) {
// OK, no build.
}
return build;
}
use of org.jboss.galleon.universe.FeaturePackLocation in project galleon by wildfly.
the class UniverseManager method getAllBuilds.
private static List<String> getAllBuilds(UniverseSpec spec, Producer<?> producer, Channel channel) {
FeaturePackLocation loc = new FeaturePackLocation(spec, producer.getName(), channel.getName(), null, null);
List<String> build = Collections.emptyList();
try {
build = channel.getAllBuilds(loc);
} catch (ProvisioningException ex) {
// OK, no build.
}
return build;
}
Aggregations