Skip to content

Commit

Permalink
Added JBoss to Forge
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Apr 22, 2014
1 parent 939e41c commit 6b27d89
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public static void startFurnace() {
if (runtime == null || ForgeRuntimeState.RUNNING.equals(runtime.getState())) return;
createStartFurnaceJob().schedule();
}

public static void stopFurnace() {
final ForgeRuntime runtime = FurnaceRuntime.INSTANCE;
if (runtime == null || ForgeRuntimeState.STOPPED.equals(runtime.getState())) return;
Job job = new Job("Stopping Forge " + runtime.getVersion()) {
Job job = new Job("Stopping JBoss Forge " + runtime.getVersion()) {
@Override
protected IStatus run(IProgressMonitor monitor) {
runtime.stop(monitor);
Expand All @@ -32,33 +32,33 @@ protected IStatus run(IProgressMonitor monitor) {
};
job.schedule();
}

public static Job createStartFurnaceJob() {
final FurnaceRuntime runtime = FurnaceRuntime.INSTANCE;
final String version = runtime.getVersion();
WorkspaceJob job = new WorkspaceJob("Starting Forge " + version) {
WorkspaceJob job = new WorkspaceJob("Starting JBoss Forge " + version) {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException {
String taskName = "Please wait while Forge " + version + " is started.";
String taskName = "Please wait while JBoss Forge " + version + " is started.";
monitor.beginTask(taskName, IProgressMonitor.UNKNOWN);
runtime.start(monitor);
if (runtime.getErrorMessage() != null) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(
null,
"Forge Startup Error",
null,
"JBoss Forge Startup Error",
runtime.getErrorMessage());
}
}
});
}
return Status.OK_STATUS;
}
};
job.setUser(true);
job.setUser(true);
return job;
}

}

0 comments on commit 6b27d89

Please sign in to comment.