diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java index 5e5d89146d7..faf47bf020e 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2009 IBM Corporation and others. + * Copyright (c) 2002, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,6 +38,7 @@ * David McKnight (IBM) - [267236] [dstore] Can't connect after a wrong password * David McKnight (IBM) - [274688] [api][dstore] DStoreConnectorService.internalConnect() needs to be cleaned up * David McKnight (IBM) - [258529] Unable to display connection failure error message + * David McKnight (IBM) - [306989] [dstore] workspace in strange condition if expanding projects during logon *******************************************************************************/ package org.eclipse.rse.connectorservice.dstore; @@ -1300,54 +1301,58 @@ public class DStoreConnectorService extends StandardConnectorService implements } _isConnecting = true; - Boolean alertedNONSSL = new Boolean(false); - - // set A_PLUGIN_PATH so that dstore picks up the property - setPluginPathProperty(); - - // Fire comm event to signal state about to change - fireCommunicationsEvent(CommunicationsEvent.BEFORE_CONNECT); - - ConnectionStatus connectStatus = null; - ConnectionStatus launchStatus = null; - - clientConnection = new ClientConnection(getPrimarySubSystem().getHost().getAliasName()); - - clientConnection.setHost(getHostName()); - clientConnection.setPort(Integer.toString(getPort())); - - getPrimarySubSystem(); - IRemoteServerLauncher serverLauncher = getDStoreServerLauncher(); - - ServerLaunchType serverLauncherType = null; - if (serverLauncher != null){ - serverLauncherType = serverLauncher.getServerLaunchType(); - } - - SystemSignonInformation info = getSignonInformation(); - if (serverLauncherType == ServerLaunchType.REXEC_LITERAL){ // start the server via REXEC - connectStatus = connectWithREXEC(info, serverLauncher, monitor); - } - else if (serverLauncherType == ServerLaunchType.DAEMON_LITERAL) { // start the server via the daemon - - ConnectionStatusPair connectStatusPair = connectWithDaemon(info, serverLauncher, alertedNONSSL, monitor); - connectStatus = connectStatusPair.getConnectStatus(); - launchStatus = connectStatusPair.getLaunchStatus(); - } - else if (serverLauncherType == ServerLaunchType.RUNNING_LITERAL){ // connect to running server - connectStatus = connectWithRunning(monitor); - } - else { // server launcher type is unknown - connectStatus = connectWithOther(clientConnection, info, serverLauncher, monitor); - } - - if (connectStatus != null && connectStatus.isConnected()){ // connected - initializeConnection(launchStatus, connectStatus, alertedNONSSL, monitor); - } - else { // diagnosis, reconnection and other connection failure handling - handleConnectionFailure(launchStatus, connectStatus, serverLauncher, serverLauncherType, monitor); - } + try{ + Boolean alertedNONSSL = new Boolean(false); + + // set A_PLUGIN_PATH so that dstore picks up the property + setPluginPathProperty(); + + // Fire comm event to signal state about to change + fireCommunicationsEvent(CommunicationsEvent.BEFORE_CONNECT); + + ConnectionStatus connectStatus = null; + ConnectionStatus launchStatus = null; + + clientConnection = new ClientConnection(getPrimarySubSystem().getHost().getAliasName()); + + clientConnection.setHost(getHostName()); + clientConnection.setPort(Integer.toString(getPort())); + + getPrimarySubSystem(); + IRemoteServerLauncher serverLauncher = getDStoreServerLauncher(); + + ServerLaunchType serverLauncherType = null; + if (serverLauncher != null){ + serverLauncherType = serverLauncher.getServerLaunchType(); + } + + SystemSignonInformation info = getSignonInformation(); + if (serverLauncherType == ServerLaunchType.REXEC_LITERAL){ // start the server via REXEC + connectStatus = connectWithREXEC(info, serverLauncher, monitor); + } + else if (serverLauncherType == ServerLaunchType.DAEMON_LITERAL) { // start the server via the daemon + + ConnectionStatusPair connectStatusPair = connectWithDaemon(info, serverLauncher, alertedNONSSL, monitor); + connectStatus = connectStatusPair.getConnectStatus(); + launchStatus = connectStatusPair.getLaunchStatus(); + } + else if (serverLauncherType == ServerLaunchType.RUNNING_LITERAL){ // connect to running server + connectStatus = connectWithRunning(monitor); + } + else { // server launcher type is unknown + connectStatus = connectWithOther(clientConnection, info, serverLauncher, monitor); + } + + if (connectStatus != null && connectStatus.isConnected()){ // connected + initializeConnection(launchStatus, connectStatus, alertedNONSSL, monitor); + } + else { // diagnosis, reconnection and other connection failure handling + handleConnectionFailure(launchStatus, connectStatus, serverLauncher, serverLauncherType, monitor); + } + } + finally { _isConnecting = false; + } } protected boolean isPortOutOfRange(String message)