use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project webtools.servertools by eclipse.
the class ServerPerformanceTestCase method createRuntime.
protected IRuntimeWorkingCopy createRuntime(String runtimeTypeId, String runtimeTypeLocation) throws CoreException {
if (runtimeTypeId == null)
throw new IllegalArgumentException();
IRuntimeWorkingCopy runtimeCopy = ServerCore.findRuntimeType(runtimeTypeId).createRuntime(runtimeTypeId, null);
runtimeCopy.setLocation(new Path(runtimeTypeLocation));
runtimeCopy.setReadOnly(false);
runtimeCopy.save(false, null);
return runtimeCopy;
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project mdw-designer by CenturyLinkCloud.
the class ServiceMixRuntimeWizardFragment method isComplete.
@Override
public boolean isComplete() {
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
if (runtime == null)
return false;
IStatus status = runtime.validate(null);
return (status == null || status.getSeverity() != IStatus.ERROR);
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project eclipse-integration-commons by spring-projects.
the class ServerHandler method createRuntime.
private IRuntime createRuntime(IServerType st, IPath path, IProgressMonitor monitor, IOverwriteQuery query) throws CoreException {
IRuntime runtime = ServerCore.findRuntime(runtimeName);
if (runtime != null) {
if (!query(query, NLS.bind("A runtime with the name ''{0}'' already exists. Replace the existing runtime?", runtimeName))) {
monitor.worked(1);
return runtime;
} else {
runtime.delete();
}
}
IRuntimeWorkingCopy wc = st.getRuntimeType().createRuntime(runtimeName, new SubProgressMonitor(monitor, 1));
wc.setName(runtimeName);
if (path != null) {
wc.setLocation(path);
}
IStatus validationResult = wc.validate(monitor);
if (!validationResult.isOK()) {
throw new CoreException(validationResult);
}
runtime = wc.save(true, new SubProgressMonitor(monitor, 1));
return runtime;
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project webtools.servertools by eclipse.
the class HttpRuntimeWizardFragment method enter.
/*
* @see org.eclipse.wst.server.ui.wizard.WizardFragment#enter()
*/
public void enter() {
if (comp != null) {
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
comp.setRuntime(runtime);
}
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project webtools.servertools by eclipse.
the class HttpRuntimeLocator method getRuntimeFromDir.
protected static IRuntimeWorkingCopy getRuntimeFromDir(File dir, IProgressMonitor monitor) {
for (String rt : runtimeTypes) {
try {
IRuntimeType runtimeType = ServerCore.findRuntimeType(rt);
String absolutePath = dir.getAbsolutePath();
String id = absolutePath.replace(File.separatorChar, '_').replace(':', '-');
IRuntimeWorkingCopy runtime = runtimeType.createRuntime(id, monitor);
runtime.setName(dir.getName());
runtime.setLocation(new Path(absolutePath).append("htdocs"));
IStatus status = runtime.validate(monitor);
if (status == null || status.getSeverity() != IStatus.ERROR)
return runtime;
Trace.trace(Trace.FINER, "False runtime found at " + dir.getAbsolutePath() + ": " + status.getMessage());
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Could not find runtime", e);
}
}
return null;
}
Aggregations