|
Lines 17-23
Link Here
|
| 17 |
import java.util.ArrayList; |
17 |
import java.util.ArrayList; |
| 18 |
import java.util.Hashtable; |
18 |
import java.util.Hashtable; |
| 19 |
|
19 |
|
|
|
20 |
import org.eclipse.core.filesystem.EFS; |
| 21 |
import org.eclipse.core.filesystem.IFileStore; |
| 22 |
import org.eclipse.core.runtime.IPath; |
| 20 |
import org.eclipse.core.runtime.IStatus; |
23 |
import org.eclipse.core.runtime.IStatus; |
|
|
24 |
import org.eclipse.core.runtime.Platform; |
| 21 |
import org.eclipse.hyades.internal.execution.local.common.CustomCommand; |
25 |
import org.eclipse.hyades.internal.execution.local.common.CustomCommand; |
| 22 |
import org.eclipse.hyades.internal.execution.local.common.DataProcessor; |
26 |
import org.eclipse.hyades.internal.execution.local.common.DataProcessor; |
| 23 |
import org.eclipse.hyades.internal.execution.local.control.Agent; |
27 |
import org.eclipse.hyades.internal.execution.local.control.Agent; |
|
Lines 26-35
Link Here
|
| 26 |
import org.eclipse.hyades.internal.execution.local.control.InactiveAgentException; |
30 |
import org.eclipse.hyades.internal.execution.local.control.InactiveAgentException; |
| 27 |
import org.eclipse.hyades.internal.execution.local.control.InactiveProcessException; |
31 |
import org.eclipse.hyades.internal.execution.local.control.InactiveProcessException; |
| 28 |
import org.eclipse.hyades.internal.execution.local.control.Process; |
32 |
import org.eclipse.hyades.internal.execution.local.control.Process; |
|
|
33 |
import org.eclipse.swt.widgets.Display; |
| 29 |
import org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin; |
34 |
import org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin; |
| 30 |
import org.eclipse.tptp.monitoring.managedagent.internal.Constants; |
35 |
import org.eclipse.tptp.monitoring.managedagent.internal.Constants; |
| 31 |
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandSerializer; |
36 |
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandSerializer; |
| 32 |
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandWrapper; |
37 |
import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandWrapper; |
|
|
38 |
import org.eclipse.ui.IWorkbenchPage; |
| 39 |
import org.eclipse.ui.IWorkbenchWindow; |
| 40 |
import org.eclipse.ui.PartInitException; |
| 41 |
import org.eclipse.ui.PlatformUI; |
| 42 |
import org.eclipse.ui.ide.IDE; |
| 33 |
|
43 |
|
| 34 |
/** |
44 |
/** |
| 35 |
* An abstract class that implements the TPTP Agent interface and allows follows the custom command API defined for managed agents. |
45 |
* An abstract class that implements the TPTP Agent interface and allows follows the custom command API defined for managed agents. |
|
Lines 445-454
Link Here
|
| 445 |
sendResponse(_command); |
455 |
sendResponse(_command); |
| 446 |
}catch(Exception ex){ |
456 |
}catch(Exception ex){ |
| 447 |
throwException(ex); |
457 |
throwException(ex); |
|
|
458 |
openErrorLog(ex); |
| 448 |
} |
459 |
} |
| 449 |
}catch(Exception e){ |
460 |
}catch(Exception e){ |
| 450 |
ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedResourceAgent.CANT_SERICE_CUSTOM_COMMAND.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$ |
461 |
ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedResourceAgent.CANT_SERICE_CUSTOM_COMMAND.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$ |
| 451 |
setActive(false); |
462 |
setActive(false); |
| 452 |
} |
463 |
} |
| 453 |
} |
464 |
} |
|
|
465 |
|
| 466 |
private void openErrorLog(Exception ex) |
| 467 |
{ |
| 468 |
// Ignore the warning message "IWAT0753I Found and instantiated Apache Muse Runtime WSDM runtime" |
| 469 |
boolean museFoundMessage = ex.getMessage().indexOf("IWAT0753I")!=-1; |
| 470 |
// Ignore the warning message "IWAT0761I This resource is not a service group" |
| 471 |
boolean sgMessage = ex.getMessage().indexOf("IWAT0761I")!=-1 || ex.getMessage().indexOf("IWAT0762E")!=-1; |
| 472 |
if(museFoundMessage || sgMessage) |
| 473 |
return; |
| 474 |
|
| 475 |
IPath logPath = Platform.getLogFileLocation(); |
| 476 |
final IFileStore fileStore = EFS.getLocalFileSystem().getStore(logPath); |
| 477 |
if(!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) |
| 478 |
{ |
| 479 |
Display display = PlatformUI.getWorkbench().getDisplay(); |
| 480 |
display.asyncExec(new Runnable(){ |
| 481 |
|
| 482 |
public void run() { |
| 483 |
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
| 484 |
IWorkbenchPage page = window.getActivePage(); |
| 485 |
try |
| 486 |
{ |
| 487 |
IDE.openEditorOnFileStore(page, fileStore); |
| 488 |
} |
| 489 |
catch(PartInitException _ex) |
| 490 |
{ |
| 491 |
_ex.printStackTrace(); |
| 492 |
} |
| 493 |
}}); |
| 494 |
} |
| 495 |
} |
| 496 |
|
| 454 |
} |
497 |
} |