RSE
Release 3.2

org.eclipse.rse.connectorservice.dstore.util
Class StatusMonitor

java.lang.Object
  extended by org.eclipse.rse.connectorservice.dstore.util.StatusMonitor
All Implemented Interfaces:
org.eclipse.dstore.extra.IDomainListener, ICommunicationsListener

public class StatusMonitor
extends Object
implements org.eclipse.dstore.extra.IDomainListener, ICommunicationsListener


Nested Class Summary
protected  class StatusMonitor.FindShell
           
 
Field Summary
protected  List _cancelledStatuses
           
protected  org.eclipse.dstore.core.model.DataStore _dataStore
           
protected  List _doneStatuses
           
protected  boolean _networkDown
           
protected  Shell _shell
           
protected  IConnectorService _system
           
protected  List _workingStatuses
           
 
Constructor Summary
StatusMonitor(IConnectorService system, org.eclipse.dstore.core.model.DataStore dataStore)
          Construct a StatusChangeListener
StatusMonitor(IConnectorService system, org.eclipse.dstore.core.model.DataStore dataStore, ICommunicationsDiagnosticFactory factory)
          Construct a StatusChangeListener
 
Method Summary
 void communicationsStateChange(CommunicationsEvent e)
          This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes.
protected  boolean determineStatusDone(org.eclipse.dstore.core.model.DataElement status)
          Determines whether the status is done.
 void dispose()
           
 void domainChanged(org.eclipse.dstore.extra.DomainEvent event)
           
 org.eclipse.dstore.core.model.DataStore getDataStore()
           
 boolean isNetworkDown()
          Test if the StatusChangeListener returned because the network connection to the remote system was broken.
 boolean isPassiveCommunicationsListener()
          This method determines if the communications listener is a passive or active listener.
 boolean listeningTo(org.eclipse.dstore.extra.DomainEvent event)
           
 void reInit()
           
 void setCancelled(org.eclipse.dstore.core.model.DataElement status)
           
 void setDone(org.eclipse.dstore.core.model.DataElement status)
          setDone(boolean)
 void setWorking(org.eclipse.dstore.core.model.DataElement status)
           
 org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status)
           
 org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status, int wait)
           
 org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status, IProgressMonitor monitor)
           
 org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status, IProgressMonitor monitor, int wait)
           
 boolean wasCancelled(org.eclipse.dstore.core.model.DataElement status)
           
 ICommunicationsDiagnostic whatIsGoingOn(ICommunicationsDiagnosticFactory factory, boolean quiet, org.eclipse.dstore.core.model.DataElement target)
          Start diagnostic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_shell

protected Shell _shell

_system

protected IConnectorService _system

_networkDown

protected boolean _networkDown

_workingStatuses

protected List _workingStatuses

_cancelledStatuses

protected List _cancelledStatuses

_doneStatuses

protected List _doneStatuses

_dataStore

protected org.eclipse.dstore.core.model.DataStore _dataStore
Constructor Detail

StatusMonitor

public StatusMonitor(IConnectorService system,
                     org.eclipse.dstore.core.model.DataStore dataStore,
                     ICommunicationsDiagnosticFactory factory)
Construct a StatusChangeListener

Parameters:
system - the system associated with this monitor
dataStore - the dataStore associated with this monitor
factory - the diagnostic factory for this monitor

StatusMonitor

public StatusMonitor(IConnectorService system,
                     org.eclipse.dstore.core.model.DataStore dataStore)
Construct a StatusChangeListener

Parameters:
system - the system associated with this monitor
dataStore - the dataStore associated with this monitor
Method Detail

reInit

public void reInit()

getDataStore

public org.eclipse.dstore.core.model.DataStore getDataStore()

dispose

public void dispose()

listeningTo

public boolean listeningTo(org.eclipse.dstore.extra.DomainEvent event)
Specified by:
listeningTo in interface org.eclipse.dstore.extra.IDomainListener
See Also:
IDomainListener.listeningTo(DomainEvent)

domainChanged

public void domainChanged(org.eclipse.dstore.extra.DomainEvent event)
Specified by:
domainChanged in interface org.eclipse.dstore.extra.IDomainListener
See Also:
IDomainListener.domainChanged(DomainEvent)

determineStatusDone

protected boolean determineStatusDone(org.eclipse.dstore.core.model.DataElement status)
Determines whether the status is done.

Returns:
true if status done, false otherwise.

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()
Description copied from interface: ICommunicationsListener
This method determines if the communications listener is a passive or active listener. Typically a passive listener registers with the communications system and responds to events as they occur. An active listener typically registers with the communications system only for the duration of the task (i.e. user editing a file, or outstanding communications request.) The user will be prompted on a disconnect if there are any active communication listeners registered.

Specified by:
isPassiveCommunicationsListener in interface ICommunicationsListener
Returns:
false if the communications listener is an active listener, true if the communications listener is a passive listener.
See Also:
ICommunicationsListener.isPassiveCommunicationsListener()

setDone

public void setDone(org.eclipse.dstore.core.model.DataElement status)
setDone(boolean)


setCancelled

public void setCancelled(org.eclipse.dstore.core.model.DataElement status)

setWorking

public void setWorking(org.eclipse.dstore.core.model.DataElement status)

wasCancelled

public boolean wasCancelled(org.eclipse.dstore.core.model.DataElement status)

communicationsStateChange

public void communicationsStateChange(CommunicationsEvent e)
Description copied from interface: ICommunicationsListener
This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes. The state field in CommunicationsEvent determines which state change is about to or has occurred.

Specified by:
communicationsStateChange in interface ICommunicationsListener
See Also:
ICommunicationsListener.communicationsStateChange(CommunicationsEvent)

isNetworkDown

public boolean isNetworkDown()
Test if the StatusChangeListener returned because the network connection to the remote system was broken.


waitForUpdate

public org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status)
                                                        throws InterruptedException
Throws:
InterruptedException

waitForUpdate

public org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status,
                                                               IProgressMonitor monitor)
                                                        throws InterruptedException
Throws:
InterruptedException

waitForUpdate

public org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status,
                                                               int wait)
                                                        throws InterruptedException
Throws:
InterruptedException

waitForUpdate

public org.eclipse.dstore.core.model.DataElement waitForUpdate(org.eclipse.dstore.core.model.DataElement status,
                                                               IProgressMonitor monitor,
                                                               int wait)
                                                        throws InterruptedException
Throws:
InterruptedException

whatIsGoingOn

public ICommunicationsDiagnostic whatIsGoingOn(ICommunicationsDiagnosticFactory factory,
                                               boolean quiet,
                                               org.eclipse.dstore.core.model.DataElement target)
                                        throws InterruptedException
Start diagnostic

Parameters:
factory - is the an implementation of ICommunicationsDiagnostic
quiet - is the flag to indicate if user should be prompted - true for no prompt
Returns:
ICommunciationsDiagnostic class instance
Throws:
InterruptedException

RSE
Release 3.2

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