RSE
Release 1.0

org.eclipse.rse.connectorservice.ssh
Class SshConnectorService.SessionLostHandler

java.lang.Object
  extended byorg.eclipse.rse.connectorservice.ssh.SshConnectorService.SessionLostHandler
All Implemented Interfaces:
IRunnableWithProgress, Runnable
Enclosing class:
SshConnectorService

public static class SshConnectorService.SessionLostHandler
extends Object
implements Runnable, IRunnableWithProgress

Handle session-lost events. This is generic for any sort of connector service. Most of this is extracted from dstore's ConnectionStatusListener. TODO should be refactored to make it generally available, and allow dstore to derive from it.


Constructor Summary
SshConnectorService.SessionLostHandler(IConnectorService cs)
           
 
Method Summary
protected  IRunnableContext getRunnableContext(Shell rshell)
          Get the progress monitor dialog for this operation.
 Shell getShell()
           
 boolean isSessionLost()
           
 void run()
           
 void run(IProgressMonitor monitor)
           
 void sessionLost()
          Notify that the connection has been lost.
protected  void showDisconnectCancelledMessage(Shell shell, String hostName, int port)
          Show an error message when the user cancels the disconnection.
protected  void showDisconnectErrorMessage(Shell shell, String hostName, int port, Exception exc)
          Show an error message when the disconnection fails.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshConnectorService.SessionLostHandler

public SshConnectorService.SessionLostHandler(IConnectorService cs)
Method Detail

sessionLost

public void sessionLost()
Notify that the connection has been lost. This may be called multiple times from multiple subsystems. The SessionLostHandler ensures that actual user feedback and disconnect actions are done only once, on the first invocation.


isSessionLost

public boolean isSessionLost()

run

public void run()
Specified by:
run in interface Runnable

run

public void run(IProgressMonitor monitor)
         throws InvocationTargetException,
                InterruptedException
Specified by:
run in interface IRunnableWithProgress
Throws:
InvocationTargetException
InterruptedException

getShell

public Shell getShell()

getRunnableContext

protected IRunnableContext getRunnableContext(Shell rshell)
Get the progress monitor dialog for this operation. We try to use one for all phases of a single operation, such as connecting and resolving.


showDisconnectErrorMessage

protected void showDisconnectErrorMessage(Shell shell,
                                          String hostName,
                                          int port,
                                          Exception exc)
Show an error message when the disconnection fails. Shows a common message by default. Overridable.


showDisconnectCancelledMessage

protected void showDisconnectCancelledMessage(Shell shell,
                                              String hostName,
                                              int port)
Show an error message when the user cancels the disconnection. Shows a common message by default. Overridable.


RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.