1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-12 03:25:22 +02:00

[272882] [api] Handle exceptions in IService.initService()

This commit is contained in:
David McKnight 2009-04-28 14:49:47 +00:00
parent 16104932d0
commit d1c500e76b
23 changed files with 79 additions and 49 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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,

View file

@ -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);

View file

@ -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);

View file

@ -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,17 +1125,11 @@ 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$
}
}
public void uninitService(IProgressMonitor monitor) {
Activator.trace("SftpFileService.uninitService"); //$NON-NLS-1$

View file

@ -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 <code>super.initService(monitor)</code> as the first call in
* their implementation.
*/
public void initService(IProgressMonitor monitor) {
public void initService(IProgressMonitor monitor) throws SystemMessageException {
// Do nothing by default
}

View file

@ -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

View file

@ -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);
}

View file

@ -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);

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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,

View file

@ -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$

View file

@ -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);

View file

@ -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);
}

View file

@ -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,8 +3403,13 @@ 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
try {
initializeSubSystem(new NullProgressMonitor());
}
catch (SystemMessageException e){
SystemBasePlugin.logError(e.getMessage(), e);
}
}
// commit the subsystem

View file

@ -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$