Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66587 Details for
Bug 186162
[New IAC] Change IAC executable on Linux IA32
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
patch_186162.txt (text/plain), 9.00 KB, created by
Navid Mehregani
on 2007-05-09 19:54:31 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Navid Mehregani
Created:
2007-05-09 19:54:31 EDT
Size:
9.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.iac.administrator >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java,v >retrieving revision 1.10 >diff -u -r1.10 AutoStartStop.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java 8 May 2007 04:20:39 -0000 1.10 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java 9 May 2007 23:52:06 -0000 >@@ -13,6 +13,7 @@ > package org.eclipse.tptp.platform.iac.administrator.internal.startstop; > > import java.io.BufferedReader; >+import java.io.File; > import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; >@@ -78,15 +79,17 @@ > > /* Do we need to generate IAC's configuration file? */ > if (!AdminUtil.isConfigurationValid()) >+ { > AdminUtil.generateConfigFile(); > >- /* If configuration is still invalid, return an error */ >- if (!AdminUtil.isConfigurationValid()) >- { >- Status status = new Status(Status.ERROR, AdminPlugin.PLUGIN_ID, "IAC could not be started due to invalid configuration files."); >- AdminPlugin.getDefault().getLog().log(status); >- return 1; >- } >+ /* If configuration is still invalid, return an error */ >+ if (!AdminUtil.isConfigurationValid()) >+ { >+ Status status = new Status(Status.ERROR, AdminPlugin.PLUGIN_ID, "IAC could not be started due to invalid configuration files."); >+ AdminPlugin.getDefault().getLog().log(status); >+ return 1; >+ } >+ } > > Runtime rt = Runtime.getRuntime(); > String acExecutable = AdminUtil.getIACExecutable(); >@@ -95,7 +98,7 @@ > { > /* Run the 'RAServer' command. We can't use the CommandExecutor class here because that class > * waits until its error/output threads are terminated */ >- process = rt.exec(acExecutable); >+ process = rt.exec(acExecutable, null, new File(AdminUtil.getIACBinFolder())); > > new AutoStartStop().new ProcessOutputReader(process.getErrorStream(), "Error Stream").start(); > new AutoStartStop().new ProcessOutputReader(process.getInputStream(), "Output Stream").start(); >@@ -181,11 +184,11 @@ > > /* Use the 'RAServer -shutdown' command to forcibly kill IAC */ > CommandExecutor commandExecutor = new CommandExecutor(); >- String command = AdminUtil.getIACExecutable() + " -shutdown"; >+ String command = AdminUtil.getShutdownCommand(); > StringBuffer stdOut = new StringBuffer(); > StringBuffer stdErr = new StringBuffer(); >- >- commandExecutor.executeCommand(command, null, null, stdOut, stdErr); >+ >+ commandExecutor.executeCommand(command, null, AdminUtil.getIACBinFolder(), stdOut, stdErr); > > if (stdErr.length() != 0) > { >@@ -295,9 +298,12 @@ > try { > > while ((line = reader.readLine()) != null){ >- line = line.trim() + CommonConstants.LINE_SEPARATOR; >- Status status = new Status(Status.ERROR, AdminPlugin.PLUGIN_ID, "[startIAC: " + streamName + "] RAServer generated the following output: " + line); >- AdminPlugin.getDefault().getLog().log(status); >+ if ((line.indexOf("started successfully") == -1) && (line.indexOf("Starting Agent Controller") == -1) && (line.indexOf("ACServer stopped") == -1)) >+ { >+ line = line.trim() + CommonConstants.LINE_SEPARATOR; >+ Status status = new Status(Status.ERROR, AdminPlugin.PLUGIN_ID, "[startIAC: " + streamName + "] RAServer generated the following output: " + line); >+ AdminPlugin.getDefault().getLog().log(status); >+ } > } > } > catch (IOException e) { >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/preference/VMChangeListener.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/preference/VMChangeListener.java,v >retrieving revision 1.3 >diff -u -r1.3 VMChangeListener.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/preference/VMChangeListener.java 8 May 2007 04:20:39 -0000 1.3 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/preference/VMChangeListener.java 9 May 2007 23:52:06 -0000 >@@ -44,7 +44,7 @@ > /* Indicates whether it's necessary to restart IAC */ > boolean restartIAC = false; > >- if (AutoStartStop.isIACRunning()) >+ if (AutoStartStop.getIACStarted()) > { > /* Confirm whether the user wants to restart IAC */ > final Display currentDisplay = adminPlugin.getWorkbench().getDisplay(); >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java,v >retrieving revision 1.12 >diff -u -r1.12 AdminUtil.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java 5 May 2007 04:10:36 -0000 1.12 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java 9 May 2007 23:52:06 -0000 >@@ -445,20 +445,54 @@ > } > > /** >- * @return Absolute location of IAC's executable (i.e. RAServer.exe) >+ * @return Absolute location of IAC's executable (e.g. RAServer.exe). Null if IAC executable can't be resolved > */ > public static String getIACExecutable() > { >- // TODO: Not sure if RAServer on Linux will work. Might have to pass in RAStart.sh >- String iacHome = getIACHome(); >- if (iacHome == null) >- return iacHome; >+ String iacExecutable = getIACBinFolder(); >+ if (iacExecutable == null) >+ return iacExecutable; >+ >+ if (CommonConstants.OPERATING_SYSTEM.indexOf("linux") != -1) >+ iacExecutable = iacExecutable + CommonConstants.FILE_SEPARATOR + "ACStart.sh"; >+ else if (CommonConstants.OPERATING_SYSTEM.indexOf("windows") != -1) >+ iacExecutable = iacExecutable + CommonConstants.FILE_SEPARATOR + "ACServer"; >+ else >+ { >+ Status status = new Status(Status.ERROR, AdminPlugin.PLUGIN_ID, "Unrecognizable operating system " + CommonConstants.OPERATING_SYSTEM); >+ AdminPlugin.getDefault().getLog().log(status); >+ iacExecutable = null; >+ } >+ > >- String iacExecutable = iacHome + CommonConstants.FILE_SEPARATOR + "bin" + CommonConstants.FILE_SEPARATOR + "RAServer"; > return iacExecutable; > } > > /** >+ * @return The shutdown command that should be used to terminate IAC >+ */ >+ public static String getShutdownCommand() >+ { >+ String command = getIACBinFolder(); >+ if (command == null) >+ return command; >+ >+ if (CommonConstants.OPERATING_SYSTEM.indexOf("linux") != -1) >+ command = command + CommonConstants.FILE_SEPARATOR + "ACStop.sh"; >+ else if (CommonConstants.OPERATING_SYSTEM.indexOf("windows") != -1) >+ command = command + CommonConstants.FILE_SEPARATOR + "ACServer -shutdown"; >+ else >+ { >+ Status status = new Status(Status.ERROR, AdminPlugin.PLUGIN_ID, "Unrecognizable operating system " + CommonConstants.OPERATING_SYSTEM); >+ AdminPlugin.getDefault().getLog().log(status); >+ command = null; >+ } >+ >+ return command; >+ >+ } >+ >+ /** > * @return Absolute location of IAC's config file > */ > public static String getIACConfigFile() >@@ -572,7 +606,12 @@ > } > > /** >- * @return True iff the main config file as well as the config file of the execution framework are valid; false otherwise >+ * This function checks to see whether the main config file and the config file for the execution framework are valid. >+ * It also checks to see whether the Workbench JVM matches the JVM specified in IAC's config file. This is done to make >+ * sure that IAC's config file is never in an invalid state. >+ * >+ * @return True iff the main config file and the config file for the execution framework are valid AND >+ * workbench JVM matches the JVM specified in IAC's config file; false otherwise > */ > public static boolean isConfigurationValid() > { >@@ -597,8 +636,17 @@ > { > Status status = new Status(Status.WARNING, AdminPlugin.PLUGIN_ID, "Execution framework config file is invalid"); > AdminPlugin.getDefault().getLog().log(status); >+ return false; > } > >+ /* Now see if worbench JVM matches the JVM in IAC's config file */ >+ Document document = AdminUtil.parseFile(getIACConfigFile(), false); >+ String iacJVM = AdminUtil.getAttributeWithMoreDetails(document, "Variable", "name", "JAVA_PATH", "value"); >+ String workbenchJVM = getJVMExecutable(); >+ >+ if (!iacJVM.equals(workbenchJVM)) >+ return false; >+ > return valid; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 186162
:
66587
|
66694