|
Lines 12-18
Link Here
|
| 12 |
|
12 |
|
| 13 |
package org.eclipse.tptp.trace.arm.internal.agent; |
13 |
package org.eclipse.tptp.trace.arm.internal.agent; |
| 14 |
|
14 |
|
| 15 |
import java.io.File; |
|
|
| 16 |
import java.net.InetAddress; |
15 |
import java.net.InetAddress; |
| 17 |
import java.net.UnknownHostException; |
16 |
import java.net.UnknownHostException; |
| 18 |
import java.util.Calendar; |
17 |
import java.util.Calendar; |
|
Lines 54-61
Link Here
|
| 54 |
|
53 |
|
| 55 |
private static final String IP_ADDRESS_OVERRIDE = "org.eclipse.tptp.trace.arm.ip"; |
54 |
private static final String IP_ADDRESS_OVERRIDE = "org.eclipse.tptp.trace.arm.ip"; |
| 56 |
|
55 |
|
| 57 |
private final static boolean _isNativesAvailable; |
|
|
| 58 |
|
| 59 |
private static boolean _isRACActive; |
56 |
private static boolean _isRACActive; |
| 60 |
|
57 |
|
| 61 |
/* |
58 |
/* |
|
Lines 84-139
Link Here
|
| 84 |
|
81 |
|
| 85 |
private Object _monitorActiveSynch = new Object(); |
82 |
private Object _monitorActiveSynch = new Object(); |
| 86 |
|
83 |
|
| 87 |
/* |
|
|
| 88 |
* The following is duplicated from the RemoteComponentSkeleton class. The |
| 89 |
* reason for this is because when you call RemoteComponentSkeleton's |
| 90 |
* intialize method, it will throw an AgentControllerUnavailableException if |
| 91 |
* either the native libraries can't be loaded, or if the RAC hasn't come up |
| 92 |
* yet. In the latter case, we can simply wait for the RAC to come up. But |
| 93 |
* in the former case, there's a problem with the system path, which is a |
| 94 |
* fatal error. |
| 95 |
*/ |
| 96 |
static { |
| 97 |
boolean nativesLoadable = false; |
| 98 |
String osName = (String) System.getProperties().get("os.name"); |
| 99 |
String ext = (osName.toUpperCase().startsWith("WIN") ? ".dll" : ".so"); |
| 100 |
String acLibraryPath = System.getProperty(RemoteComponentSkeleton.AC_LIBRARY_PATH, null); |
| 101 |
if (acLibraryPath != null && !acLibraryPath.endsWith(File.separator)) { |
| 102 |
acLibraryPath = acLibraryPath.concat(File.separator); |
| 103 |
} |
| 104 |
|
| 105 |
try { |
| 106 |
if (acLibraryPath != null) { |
| 107 |
// Bug 112749 begins |
| 108 |
System.load(acLibraryPath+"hcclco"+ext); //$NON-NLS-1$ |
| 109 |
System.load(acLibraryPath+"hccls"+ext); //$NON-NLS-1$ |
| 110 |
System.load(acLibraryPath+"hcbnd"+ext); //$NON-NLS-1$ |
| 111 |
System.load(acLibraryPath+"hcclsm"+ext); //$NON-NLS-1$ |
| 112 |
System.load(acLibraryPath+"hccldt"+ext); //$NON-NLS-1$ |
| 113 |
// Bug 112749 ends |
| 114 |
System.load(acLibraryPath+"hcjbnd"+ext); //$NON-NLS-1$ |
| 115 |
nativesLoadable = true; |
| 116 |
} |
| 117 |
|
| 118 |
if (!nativesLoadable) { |
| 119 |
// Bug 112749 begins |
| 120 |
System.loadLibrary("hcclco"); |
| 121 |
System.loadLibrary("hccls"); |
| 122 |
System.loadLibrary("hcbnd"); |
| 123 |
System.loadLibrary("hcclsm"); |
| 124 |
System.loadLibrary("hccldt"); |
| 125 |
// Bug 112749 ends |
| 126 |
System.loadLibrary("hcjbnd"); |
| 127 |
nativesLoadable = true; |
| 128 |
} |
| 129 |
} catch (Throwable e) { |
| 130 |
_logger.logReport(ARMLogger.SEV_CRIT, "IWAT0886E", //$NON-NLS-1$ |
| 131 |
ArmRuntimeMessages.getString("AgentNotReg_ERROR_"), //$NON-NLS-1$ |
| 132 |
ARMLogger.LOG, e); |
| 133 |
} |
| 134 |
_isNativesAvailable = nativesLoadable; |
| 135 |
} |
| 136 |
|
| 137 |
/** |
84 |
/** |
| 138 |
* Serves as an interface to the RAC and ultimately the workbench. |
85 |
* Serves as an interface to the RAC and ultimately the workbench. |
| 139 |
*/ |
86 |
*/ |
|
Lines 183-191
Link Here
|
| 183 |
_agent.initialize(); |
130 |
_agent.initialize(); |
| 184 |
_isRACActive = true; |
131 |
_isRACActive = true; |
| 185 |
} catch (AgentControllerUnavailableException e) { |
132 |
} catch (AgentControllerUnavailableException e) { |
| 186 |
if (!_isNativesAvailable) { |
133 |
throw new NativesUnavailableException(e); |
| 187 |
throw new NativesUnavailableException(); |
|
|
| 188 |
} |
| 189 |
} |
134 |
} |
| 190 |
|
135 |
|
| 191 |
_logger.logDebug(ARMLogger.SEV_DEBUG_MIN, |
136 |
_logger.logDebug(ARMLogger.SEV_DEBUG_MIN, |