1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 09:45:39 +02:00

[186363] get rid of obsolete calls to ISubSystem.connect()

This commit is contained in:
David McKnight 2007-11-05 15:56:00 +00:00
parent f9dc5456f5
commit 92ff8a6a0a
9 changed files with 49 additions and 38 deletions

View file

@ -17,7 +17,8 @@
* Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes
* David McKnight (IBM) - [202822] need to enable spiriting on the server side
* David McKnight (IBM) - [199565] taking out synchronize for internalConnect
* David McKnight (IBM) - [205986] attempt SSL before non-SSL for daemon connect
* David McKnight (IBM) - [205986] attempt SSL before non-SSL for daemon connect
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
********************************************************************************/
package org.eclipse.rse.connectorservice.dstore;
@ -33,6 +34,7 @@ import javax.net.ssl.SSLHandshakeException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.dstore.core.client.ClientConnection;
import org.eclipse.dstore.core.client.ConnectionStatus;
import org.eclipse.dstore.core.java.IRemoteClassInstance;
@ -178,7 +180,15 @@ public class DStoreConnectorService extends StandardConnectorService implements
{
try
{
getPrimarySubSystem().connect();
ISubSystem ss = getPrimarySubSystem();
if (ss != null)
{
if (Display.getCurrent() == null) {
ss.connect(new NullProgressMonitor(), false);
} else {
ss.connect(false, null);
}
}
}
catch (Exception e)
{

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [187218] Fix error reporting for connect()
* David McKnight (IBM) - [207095] Implicit connect needs to run in the same job as caller
* David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect()
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -358,16 +359,6 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
*/
public boolean isOffline();
/**
* Connect to the remote system.
* Does not force a prompt for a password. Works from UI or non-UI thread.
*
* @deprecated use {@link #connect(IProgressMonitor, boolean)} from background
* thread, or {@link #connect(boolean, IRSECallback) from UI thread.
* @throws Exception an exception if there is a failure to connect.
* Typically, this will be a {@link SystemMessageException}.
*/
public void connect() throws Exception;
/**
* Synchronously connect to the remote system.

View file

@ -20,6 +20,7 @@
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [187130] New Folder/File, Move and Rename should be available for read-only folders
* Kevin Doyle (IBM) - [197976] Changing a file to read-only when it is open doesn't update local copy
* David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect()
********************************************************************************/
package org.eclipse.rse.files.ui.resources;
@ -421,7 +422,11 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
{
try
{
subsystem.connect();
if (Display.getCurrent() == null) {
subsystem.connect(new NullProgressMonitor(), false);
} else {
subsystem.connect(false, null);
}
}
catch (Exception e)
{
@ -691,7 +696,11 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
if (!subsystem.isConnected())
{
subsystem.connect();
if (Display.getCurrent() == null) {
subsystem.connect(new NullProgressMonitor(), false);
} else {
subsystem.connect(false, null);
}
}
subsystem.upload(localPath, remoteFile, SystemEncodingUtil.ENCODING_UTF_8, null);

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods
* David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect()
********************************************************************************/
package org.eclipse.rse.files.ui.widgets;
@ -51,6 +52,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@ -611,7 +613,11 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
{
try
{
ss.connect(); // will throw exception if fails.
if (Display.getCurrent() == null) {
ss.connect(new NullProgressMonitor(), false);
} else {
ss.connect(false, null);
}
} catch (InterruptedException exc)
{
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED);

View file

@ -14,6 +14,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* David McKnight (IBM) - [173518] [refresh] Read only changes are not shown in RSE until the parent folder is refreshed
* David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect()
*******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems;
@ -44,6 +45,7 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
import org.eclipse.rse.subsystems.files.core.model.SystemFileTransferModeRegistry;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Display;
/**
* A remote file represents a named file on a remote file system. This class
@ -107,7 +109,13 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
try
{
// deduce active shell from display
context.getParentRemoteFileSubSystem().connect();
IRemoteFileSubSystem ss = context.getParentRemoteFileSubSystem();
if (Display.getCurrent() == null) {
ss.connect(new NullProgressMonitor(), false);
} else {
ss.connect(false, null);
}
} catch (Exception exc) {}
}

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes
* Rupen Mardirossian (IBM) - [187713] Check to see if target is null before attempting to retrieve targetAdapter in tranferRSEResources method (line 248)
* Martin Oberhuber (Wind River) - [200682] Fix drag&drop for elements just adaptable to IResource, like CDT elements
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
@ -573,7 +574,7 @@ public class SystemDNDTransferRunnable extends WorkspaceJob
{
try
{
targetSubSystem.connect();
targetSubSystem.connect(monitor, false);
}
catch (Exception e)
{

View file

@ -25,6 +25,7 @@
* Martin Oberhuber (Wind River) - [187218] Fix error reporting for connect()
* Xuan Chen (IBM) - [187342] Open in New Window expand failed error when not connected
* David McKnight (IBM) - [186363] remove deprecated calls in checkIsConnected
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -2201,24 +2202,7 @@ public abstract class SubSystem extends RSEModelObject
public void uninitializeSubSystem(IProgressMonitor monitor) {
}
/**
* Attempt to connect to the remote system when a Shell is not available.
* You do not need to override this, as it does the progress monitor and error message
* displaying for you.
* <p>
* Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor).
*
* @deprecated
*/
public void connect() throws Exception {
if (!isConnected()) {
if (Display.getCurrent() == null) {
connect(new NullProgressMonitor(), false);
} else {
connect(false, null);
}
}
}
/*
* Connect to a remote system with a monitor.

View file

@ -9,6 +9,7 @@
* David Dykstal (IBM) - initial contribution.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
********************************************************************************/
package org.eclipse.rse.tests.core.connection;
@ -118,7 +119,7 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
cause = null;
try {
subsystem.connect();
subsystem.connect(false, null);
} catch(Exception e) {
exception = e;
cause = e.getLocalizedMessage();
@ -164,7 +165,7 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
cause = null;
try {
subsystem.connect();
subsystem.connect(false, null);
} catch(Exception e) {
exception = e;
cause = e.getLocalizedMessage();

View file

@ -8,6 +8,7 @@
* Contributors:
* Uwe Stieber (Wind River) - initial API and implementation.
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
*******************************************************************************/
package org.eclipse.rse.tests.subsystems.files;
@ -122,7 +123,7 @@ public class FTPFileSubsystemTestCase extends RSEBaseConnectionTestCase {
// we expect that the subsystem is not connected yet
assertFalse("ftp.files subsystem is unexpectedly connected!", subSystem.isConnected()); //$NON-NLS-1$
try {
subSystem.connect();
subSystem.connect(false, null);
} catch(Exception e) {
exception = e;
cause = e.getLocalizedMessage();