diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java index 3dc8084649d..64768c628cb 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Wind River Systems, Inc. + * Copyright (c) 2006, 2009 Wind River Systems, Inc. * 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 @@ -11,6 +11,7 @@ * David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible * David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.examples.daytime.subsystems; @@ -35,6 +36,7 @@ import org.eclipse.rse.services.clientserver.messages.CommonMessages; import org.eclipse.rse.services.clientserver.messages.ICommonMessageIds; import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.model.ISystemRegistryUI; @@ -51,7 +53,7 @@ public class DaytimeSubSystem extends SubSystem { fDaytimeService = daytimeService; } - public void initializeSubSystem(IProgressMonitor monitor) { + public void initializeSubSystem(IProgressMonitor monitor)throws SystemMessageException { //This is called after connect - expand the daytime node. // Always called in worker thread. super.initializeSubSystem(monitor); diff --git a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java index 96ef6cb32a8..2982bbe0963 100644 --- a/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java +++ b/rse/examples/org.eclipse.rse.examples.dstore/src/org/eclipse/rse/examples/dstore/subsystems/SampleSubSystem.java @@ -9,7 +9,7 @@ * component that contains this file: David McKnight. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.examples.dstore.subsystems; @@ -20,6 +20,7 @@ import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.examples.dstore.services.IHostSampleContainer; import org.eclipse.rse.examples.dstore.services.IHostSampleObject; import org.eclipse.rse.examples.dstore.services.SampleService; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; public class SampleSubSystem extends SubSystem { @@ -104,7 +105,7 @@ public class SampleSubSystem extends SubSystem { } @Override - public void initializeSubSystem(IProgressMonitor monitor) { + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException{ super.initializeSubSystem(monitor); getSampleService().initService(monitor); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java index 15f7bfe0f70..6450425299b 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/AbstractConnectorService.java @@ -18,6 +18,7 @@ * David Dykstal (IBM) - [189483] fix spelling in initialize/uninitialize method signatures * David Dykstal (IBM) - [210474] Deny save password function missing * David McKnight (IBM) - [249222] [api] Access to communication listeners in AbstractConnectorService + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -32,6 +33,7 @@ import org.eclipse.rse.core.RSEPreferencesManager; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.RSEModelObject; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; /** * This is a base class to make it easier to create connector services. @@ -295,7 +297,7 @@ public abstract class AbstractConnectorService extends RSEModelObject implements * Initialize any subsystems just after connecting to the host. * @param monitor a progress monitor to report progress of initialization. */ - protected final void initializeSubSystems(IProgressMonitor monitor) { + protected final void initializeSubSystems(IProgressMonitor monitor) throws SystemMessageException { for (int i = 0; i < _registeredSubSystems.size(); i++) { ISubSystem ss = (ISubSystem)_registeredSubSystems.get(i); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java index f3c5ce798b0..50a9203635b 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2009 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 http://www.eclipse.org/legal/epl-v10.html @@ -20,6 +20,7 @@ * Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags * David Dykstal (IBM) - [225089][ssh][shells][api] Canceling connection leads to exception * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -99,8 +100,10 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I * during long-running operation. Cancellation is typically not * supported since it might leave the system in an inconsistent * state. + * + * @throws SystemMessageException if an error occurs during initialization. */ - public void initializeSubSystem(IProgressMonitor monitor); + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException; /** * Called on each subsystem associated with a particular diff --git a/rse/plugins/org.eclipse.rse.services.dstore/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.services.dstore/META-INF/MANIFEST.MF index 0282c113733..38c534c0fda 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.services.dstore/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rse.services.dstore -Bundle-Version: 3.0.100.qualifier +Bundle-Version: 3.1.0.qualifier Bundle-Activator: org.eclipse.rse.internal.services.dstore.Activator Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/processes/DStoreProcessService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/processes/DStoreProcessService.java index 590daad65a6..d186941f880 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/processes/DStoreProcessService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/processes/DStoreProcessService.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2009 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 http://www.eclipse.org/legal/epl-v10.html @@ -16,6 +16,7 @@ * David McKnight (IBM) - [159092] For to use correct process miner id * David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup * Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable and add Javadoc + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.internal.services.dstore.processes; @@ -40,7 +41,6 @@ import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor; import org.eclipse.rse.services.processes.AbstractProcessService; public class DStoreProcessService extends AbstractProcessService -// TODO implements IDStoreService ? { protected IDataStoreProvider _provider; protected DataElement _minerElement = null; @@ -272,7 +272,7 @@ public class DStoreProcessService extends AbstractProcessService return getDataStore().find(_minerElement, DE.A_NAME, "universal.killinfo"); //$NON-NLS-1$ } - public void initService(IProgressMonitor monitor) + public void initService(IProgressMonitor monitor) throws SystemMessageException { super.initService(monitor); initMiner(monitor); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java index 2c78c478483..399a81ed2f1 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/AbstractDStoreService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2009 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 @@ -18,6 +18,7 @@ * David McKnight (IBM) - [209593] [api] check for existing query to avoid duplicates * David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage() * Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.services.dstore; @@ -34,6 +35,7 @@ import org.eclipse.dstore.core.model.IDataStoreProvider; import org.eclipse.rse.internal.services.dstore.ServiceResources; import org.eclipse.rse.services.AbstractService; import org.eclipse.rse.services.clientserver.messages.SystemMessage; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.dstore.util.DStoreStatusMonitor; public abstract class AbstractDStoreService extends AbstractService implements IDStoreService @@ -412,7 +414,7 @@ public abstract class AbstractDStoreService extends AbstractService implements I } } - public void initService(IProgressMonitor monitor) + public void initService(IProgressMonitor monitor) throws SystemMessageException { super.initService(monitor); initMiner(monitor); diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java index 2f9d9ba61d8..e31143b0c7b 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java @@ -37,6 +37,7 @@ * Martin Oberhuber (Wind River) - [237616][ssh] Dont perform forced setLastModified during upload * Martin Oberhuber (Wind River) - [227135] Cryptic exception when sftp-server is missing * David McKnight (IBM) - [271244] [sftp files] "My Home" filter not working + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.internal.services.ssh.files; @@ -1124,16 +1125,10 @@ public class SftpFileService extends AbstractFileService implements ISshService, } } - public void initService(IProgressMonitor monitor) { + public void initService(IProgressMonitor monitor) throws SystemMessageException { Activator.trace("SftpFileService.initService"); //$NON-NLS-1$ super.initService(monitor); - try { - connect(); - } - catch (Exception e) - { - Activator.trace("SftpFileService.initService failed: "+e.toString()); //$NON-NLS-1$ - } + connect(); } public void uninitService(IProgressMonitor monitor) { diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/AbstractService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/AbstractService.java index aa86b33dd2f..61e62f34129 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/AbstractService.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/AbstractService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Wind River Systems, Inc. and others. + * Copyright (c) 2009 Wind River Systems, Inc. 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 @@ -7,12 +7,15 @@ * * Contributors: * Martin Oberhuber (Wind River) - initial API and implementation + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.services; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; + /** * Abstract default implementation of an RSE Service. Clients are expected to * extend this class. @@ -35,7 +38,7 @@ public abstract class AbstractService extends PlatformObject implements IService * must call super.initService(monitor) as the first call in * their implementation. */ - public void initService(IProgressMonitor monitor) { + public void initService(IProgressMonitor monitor) throws SystemMessageException { // Do nothing by default } diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java index dfa6b84599e..e2639b0cd34 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/IService.java @@ -14,6 +14,7 @@ * Contributors: * Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable and add Javadoc * David McKnight (IBM) - [271244] [sftp files] "My Home" filter not working + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.services; @@ -21,6 +22,8 @@ package org.eclipse.rse.services; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; + /** * IService is the base interface for any non-UI service contributions to RSE. * @@ -62,8 +65,10 @@ public interface IService extends IAdaptable * operation. There is no guarantee that cancellation is actually * supported by a Service since it would leave the service in a * potentially inconsistent, partially initialized state. + * + * @throws SystemMessageException if an error occurs during initialization. */ - public void initService(IProgressMonitor monitor); + public void initService(IProgressMonitor monitor) throws SystemMessageException; /** * Clean up this Service. This method is called by clients as part of a diff --git a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/terminals/AbstractDelegatingTerminalService.java b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/terminals/AbstractDelegatingTerminalService.java index 5fd83db8ee5..d79952c0f84 100644 --- a/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/terminals/AbstractDelegatingTerminalService.java +++ b/rse/plugins/org.eclipse.rse.services/src/org/eclipse/rse/services/terminals/AbstractDelegatingTerminalService.java @@ -52,7 +52,7 @@ public abstract class AbstractDelegatingTerminalService extends AbstractTerminal return RSEServicesMessages.AbstractDelegatingTerminalService_name; } - public void initService(IProgressMonitor monitor) { + public void initService(IProgressMonitor monitor) throws SystemMessageException { getRealTerminalService().initService(monitor); } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java index 0d77291d3eb..87120b3357a 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2009 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 @@ -43,6 +43,7 @@ * David McKnight (IBM) - [223461] [Refresh][api] Refresh expanded folder under filter refreshes Filter * Martin Oberhuber (Wind River) - [240704] Protect against illegal API use of getRemoteFileObject() with relative path as name * Martin Oberhuber (Wind River) - [234026] Clarify IFileService#createFolder() Javadocs + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.servicesubsystem; @@ -76,7 +77,6 @@ import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; import org.eclipse.rse.services.clientserver.messages.CommonMessages; import org.eclipse.rse.services.clientserver.messages.ICommonMessageIds; import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; -import org.eclipse.rse.services.clientserver.messages.SystemElementNotFoundException; import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.IFileService; @@ -1138,7 +1138,7 @@ public class FileServiceSubSystem extends RemoteFileSubSystem implements IFileSe return IFileService.class; } - public void initializeSubSystem(IProgressMonitor monitor) + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); getFileService().initService(monitor); diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java index ad15db9a931..c8d253897d3 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2008 IBM Corporation and others. + * Copyright (c) 2002, 2009 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 @@ -28,6 +28,7 @@ * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading * Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding() * David McKnight (IBM) - [225747] [dstore] Trying to connect to an "Offline" system throws an NPE + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.subsystems.files.core.subsystems; @@ -1250,7 +1251,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi return rc; } // end runCmd method - public void initializeSubSystem(IProgressMonitor monitor) + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); // load UI plugin for adapters right after successful connect diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.subsystems.processes.core/META-INF/MANIFEST.MF index ae5b6fa4c83..b9b5524b458 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rse.subsystems.processes.core;singleton:=true -Bundle-Version: 3.0.100.qualifier +Bundle-Version: 3.1.0.qualifier Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java index 4665c3736e5..007fefef15b 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2009 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 @@ -16,6 +16,7 @@ * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading * David McKnight (IBM) - [262930] Remote System Details view not restoring filter memento input + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.subsystems.processes.core.subsystem.impl; @@ -95,7 +96,7 @@ public abstract class RemoteProcessSubSystemImpl extends SubSystem implements /* (non-Javadoc) * @see org.eclipse.rse.core.subsystems.SubSystem#initializeSubSystem(org.eclipse.core.runtime.IProgressMonitor) */ - public void initializeSubSystem(IProgressMonitor monitor) + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); // load UI plugin for adapters right after successful connect diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java index e9c980363f2..43c7be8c6cd 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2009 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 http://www.eclipse.org/legal/epl-v10.html @@ -17,6 +17,7 @@ * David Dykstal (IBM) - [217556] remove service subsystem types * David McKnight (IBM) - [220524] internalSwitchServiceSubSystemConfiguration -> internalSwitchSubSystemConfiguration * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.subsystems.processes.servicesubsystem; @@ -177,7 +178,7 @@ public class ProcessServiceSubSystem extends RemoteProcessSubSystemImpl implemen /* (non-Javadoc) * @see org.eclipse.rse.subsystems.processes.core.subsystem.impl.RemoteProcessSubSystemImpl#initializeSubSystem(org.eclipse.core.runtime.IProgressMonitor) */ - public void initializeSubSystem(IProgressMonitor monitor) + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); getProcessService().initService(monitor); diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.shell.linux/src/org/eclipse/rse/internal/subsystems/processes/shell/linux/LinuxShellProcessService.java b/rse/plugins/org.eclipse.rse.subsystems.processes.shell.linux/src/org/eclipse/rse/internal/subsystems/processes/shell/linux/LinuxShellProcessService.java index 3c3e7f713e4..29aab2efcd6 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.shell.linux/src/org/eclipse/rse/internal/subsystems/processes/shell/linux/LinuxShellProcessService.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.shell.linux/src/org/eclipse/rse/internal/subsystems/processes/shell/linux/LinuxShellProcessService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 MontaVista Software, Inc. and others. + * Copyright (c) 2006, 2009 MontaVista Software, Inc. 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 @@ -13,6 +13,7 @@ * Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable and add Javadoc * Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error * Anna Dushistova (MontaVista) - [239159] The shell process subsystem not working without the shells subsystem present for the systemType + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.internal.subsystems.processes.shell.linux; @@ -187,7 +188,7 @@ public class LinuxShellProcessService extends AbstractProcessService { return LinuxShellProcessResources.LinuxRemoteProcessService_name; } - public void initService(final IProgressMonitor monitor) { + public void initService(final IProgressMonitor monitor) throws SystemMessageException { super.initService(monitor); linuxProcessHelper = new LinuxProcessHelper(); // initialize username /uid hashmap before getting any process diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.subsystems.shells.core/META-INF/MANIFEST.MF index f555e041ba8..888d065bee3 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rse.subsystems.shells.core -Bundle-Version: 3.0.100.qualifier +Bundle-Version: 3.1.0.qualifier Bundle-Activator: org.eclipse.rse.internal.subsystems.shells.core.Activator Bundle-Localization: plugin Require-Bundle: org.eclipse.ui, diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java index 74e68a4f9a5..cb3d1c6a551 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2008 IBM Corporation and others. + * Copyright (c) 2002, 2009 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 @@ -21,6 +21,7 @@ * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading * David McKnight (IBM) - [230285] [shells] Remote shells should be restored on quit and re-start of RSE * David McKnight (IBM) - [252708] Saving Profile Job happens when not changing Property Values on Connections + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.subsystems.shells.core.subsystems; @@ -82,7 +83,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd _cmdShells = new ArrayList(); } - public void initializeSubSystem(IProgressMonitor monitor) { + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); // load UI plugin for adapters right after successful connect Platform.getAdapterManager().loadAdapter(new RemoteOutput(null, ""), "org.eclipse.rse.ui.view.ISystemViewElementAdapter"); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java index 47d3ffc2dec..5346e3b868c 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2009 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 http://www.eclipse.org/legal/epl-v10.html @@ -20,6 +20,7 @@ * David McKnight (IBM) - [220524] internalSwitchServiceSubSystemConfiguration -> internalSwitchSubSystemConfiguration * Martin Oberhuber (Wind River) - [226301][api] IShellService should throw SystemMessageException on error * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; @@ -239,7 +240,7 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I return IShellService.class; } - public void initializeSubSystem(IProgressMonitor monitor) + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); getShellService().initService(monitor); diff --git a/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java index 05eed58d48c..f791a1f00ae 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.terminals.core/src/org/eclipse/rse/subsystems/terminals/core/TerminalServiceSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2008 MontaVista Software, Inc. and others. + * Copyright (c) 2008, 2009 MontaVista Software, Inc. 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 @@ -12,6 +12,7 @@ * Martin Oberhuber (Wind River) - [228577] [rseterminal] Further cleanup * Anna Dushistova (MontaVista) - [227569] [rseterminal][api] Provide a "generic" Terminal subsystem * Anna Dushistova (MontaVista) - [257638] [rseterminal] Terminal subsystem doesn't have service properties + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.subsystems.terminals.core; @@ -30,6 +31,7 @@ import org.eclipse.rse.core.subsystems.ICommunicationsListener; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.SubSystem; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.terminals.ITerminalService; import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement; import org.eclipse.swt.widgets.Display; @@ -195,7 +197,7 @@ public class TerminalServiceSubSystem extends SubSystem implements ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_REMOVED, null)); } - public void initializeSubSystem(IProgressMonitor monitor) { + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); getConnectorService().addCommunicationsListener(this); } diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java index b1dab18d77d..623d08cd563 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. + * Copyright (c) 2002, 2009 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 http://www.eclipse.org/legal/epl-v10.html @@ -46,6 +46,7 @@ * Don Yantzi (IBM) - [244807] Delay connecting if resolving filters while restoring from cache * David McKnight (IBM) - [226787] [services] Dstore processes subsystem is empty after switching from shell processes * David McKnight (IBM) - [262930] Remote System Details view not restoring filter memento input + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -2421,8 +2422,9 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider * during long-running operation. Cancellation is typically not * supported since it might leave the system in an inconsistent * state. + * @throws SystemMessageException if an error occurs during initialization. */ - public void initializeSubSystem(IProgressMonitor monitor) { + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { _isInitialized = true; } @@ -3401,7 +3403,12 @@ implements IAdaptable, ISubSystem, ISystemFilterPoolReferenceManagerProvider if (newConnectorService.isConnected()){ // make sure that the new service is initialized properly // since we're already connected and normally it's done as part of connect - initializeSubSystem(new NullProgressMonitor()); + try { + initializeSubSystem(new NullProgressMonitor()); + } + catch (SystemMessageException e){ + SystemBasePlugin.logError(e.getMessage(), e); + } } diff --git a/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/testsubsystem/TestSubSystem.java b/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/testsubsystem/TestSubSystem.java index e049edf2989..fc9957e0d65 100644 --- a/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/testsubsystem/TestSubSystem.java +++ b/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/testsubsystem/TestSubSystem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2009 Wind River Systems, Inc. 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 @@ -10,6 +10,7 @@ * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes * Martin Oberhuber (Wind River) - [218304] Improve deferred adapter loading + * David McKnight (IBM) - [272882] [api] Handle exceptions in IService.initService() *******************************************************************************/ package org.eclipse.rse.tests.internal.testsubsystem; @@ -20,6 +21,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.SubSystem; +import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.tests.testsubsystem.TestSubSystemContainerNode; import org.eclipse.rse.tests.testsubsystem.TestSubSystemNode; import org.eclipse.rse.tests.testsubsystem.interfaces.ITestSubSystem; @@ -47,7 +49,7 @@ public class TestSubSystem extends SubSystem implements ITestSubSystem { /* (non-Javadoc) * @see org.eclipse.rse.core.subsystems.SubSystem#initializeSubSystem(org.eclipse.core.runtime.IProgressMonitor) */ - public void initializeSubSystem(IProgressMonitor monitor) { + public void initializeSubSystem(IProgressMonitor monitor) throws SystemMessageException { super.initializeSubSystem(monitor); TestSubSystemContainerNode parent0 = new TestSubSystemContainerNode("0"); //$NON-NLS-1$ TestSubSystemContainerNode child0 = new TestSubSystemContainerNode("0:0"); //$NON-NLS-1$