[Esbox-commits] r2288 - trunk/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters

topulkki at garage.maemo.org topulkki at garage.maemo.org
Fri Oct 9 14:14:47 EEST 2009


Author: topulkki
Date: 2009-10-09 14:14:46 +0300 (Fri, 09 Oct 2009)
New Revision: 2288

Modified:
   trunk/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java
Log:
Update the getHostIPAddressForDeviceConnection -method with the mica interface change

Modified: trunk/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java
===================================================================
--- trunk/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java	2009-10-09 07:42:37 UTC (rev 2287)
+++ trunk/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/scratchbox/adapters/ESBoxSBRSHLaunchAdapter.java	2009-10-09 11:14:46 UTC (rev 2288)
@@ -25,7 +25,6 @@
 import org.maemo.mica.common.core.machine.MachineRegistry;
 import org.maemo.mica.common.core.preferences.CorePreferenceManager;
 import org.maemo.mica.common.core.process.ShellTemplateSubstitutor;
-import org.maemo.mica.common.core.sdk.IDeviceSDKTarget;
 import org.maemo.mica.common.core.sdk.ISDKTarget;
 import org.maemo.mica.internal.api.protocol.launch.sbrsh.ISBRSHLaunchAdapter;
 import org.maemo.mica.internal.api.protocol.launch.sbrsh.SBRSHLaunchProtocolType;
@@ -278,42 +277,34 @@
 	/* (non-Javadoc)
 	 * @see org.maemo.mica.internal.api.protocol.launch.sbrsh.ISBRSHLaunchAdapter#getHostIPAddressForDeviceNetwork(org.maemo.mica.protocol.ssh.ISSHMachine)
 	 */
-	public String getHostIPAddressForDeviceConnection(IDeviceSDKTarget deviceTarget)
+	public String getHostIPAddressForDeviceConnection(ISSHMachine sshMachine)
 			throws MicaException {
-		//HACK: ESbox should use the build machine host IP instead the "local machine" address.
-		
+		// HACK: ESbox should use the build machine host IP instead the
+		// "local machine" address.
+
 		String hostAddress = null;
-		
-		if (deviceTarget.getMachine() instanceof ISSHMachine) {
 
-			if (buildMachine instanceof ISSHMachine) {
-				hostAddress = ((ISSHMachine) deviceTarget.getMachine())
-						.getSshConfiguration().getHostAddress();
-				String ts = ((ISSHMachine) deviceTarget.getMachine())
-						.getSshConfiguration().getTargetAddress();
+		if (buildMachine instanceof ISSHMachine) {
+			hostAddress = sshMachine.getSshConfiguration().getHostAddress();
 
-				ISSHMachine buildMachine = (ISSHMachine) this.buildMachine;
+			ISSHMachine buildMachine = (ISSHMachine) this.buildMachine;
 
-				String machineHostingESboxIP = buildMachine
-						.getSshConfiguration().getHostAddress();
-				String esboxBuildMachineIP = buildMachine.getSshConfiguration()
-						.getTargetAddress();
+			String machineHostingESboxIP = buildMachine.getSshConfiguration()
+					.getHostAddress();
+			String esboxBuildMachineIP = buildMachine.getSshConfiguration()
+					.getTargetAddress();
 
-				// if device tries to access the local machine on the same
-				// network of build machine
-				if (hostAddress.equals(machineHostingESboxIP)) {
-					hostAddress = esboxBuildMachineIP; // switch to ESbox Build
-														// Machine address
-					// In the case of a Virtual machine, this only works if
-					// the user rightly configured the Bridge Network
-				}
-			} else {
-				hostAddress = ((ISSHMachine) deviceTarget.getMachine())
-						.getSshConfiguration().getHostAddress();
+			// if device tries to access the local machine on the same
+			// network of build machine
+			if (hostAddress.equals(machineHostingESboxIP)) {
+				hostAddress = esboxBuildMachineIP; // switch to ESbox Build
+				// Machine address
+				// In the case of a Virtual machine, this only works if
+				// the user rightly configured the Bridge Network
 			}
+		} else {
+			hostAddress = sshMachine.getSshConfiguration().getHostAddress();
 		}
-		
-		
 		return hostAddress;
 	}
 



More information about the Esbox-commits mailing list