Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.subsystems.shells.core.model
Class RemoteCommandShellOperation


java.lang.Object
  extended by 
org.eclipse.rse.subsystems.shells.core.model.RemoteCommandShellOperation
All Implemented Interfaces:
EventListener, ISystemResourceChangeListener, ISystemShellProvider

public abstract class RemoteCommandShellOperation
extends Object
implements ISystemResourceChangeListener, ISystemShellProvider

Base class for command shell wrappers that use echo markers to parse command finish. This abstract class can be extended to provide a command shell wrapper. When running a shell, commands can be piped to the shell via the sendCommand() method. Echo commands are used to determine when each command is complete. Whenever a command completes, the handleCommandFinished() method is called.


Nested Class Summary
protected  class RemoteCommandShellOperation.CommandAlias
           
 
Field Summary
protected   IRemoteCmdSubSystem _cmdSubSystem
           
protected   IRemoteFile _pwd
           
protected   IRemoteCommandShell _remoteCmdShell
           
protected   Shell _shell
           
 
Constructor Summary
RemoteCommandShellOperation ( Shell shell, IRemoteCmdSubSystem cmdSubSystem, IRemoteFile pwd)
          Constructor
 
Method Summary
 void associateProject ( IProject project)
           
protected  boolean commandMatches ( String outputEcho, RemoteCommandShellOperation.CommandAlias firstCommand)
           
 void finish ()
          Called when a shell is complete.
  String getCurrentCommand ()
           
  IRemoteCommandShell getRemoteCommandShell ()
           
  Shell getShell ()
          This method will be called to return the shell for your viewer.
abstract  void handleCommandFinished ( String cmd)
          Called (on the main Thread) when the specified command is complete
abstract  void handleOutputChanged ( String command, Object output)
          Called (on the main Thread) whenever output has changed
 void handleShellFinished ()
          Called (on the main Thread) when the shell is complete
 boolean isActive ()
          Indicates whether the command shell is active or not
 void outputUpdated ()
          Called (on the main Thread) whenever output is retrieved from the host
  IRemoteCommandShell run ()
          Launches a new remote shell
 void sendCommand ( String cmd)
          Send a command to the running command shell.
 void sendInput ( String input)
          Send input to the running command shell.
 void setWorkingDirectory ( IRemoteFile pwd)
           
 void systemResourceChanged ( ISystemResourceChangeEvent event)
          This is the method in your class that will be called when a system resource changes.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cmdSubSystem

protected 
IRemoteCmdSubSystem _cmdSubSystem

_pwd

protected 
IRemoteFile _pwd

_shell

protected 
Shell _shell

_remoteCmdShell

protected 
IRemoteCommandShell _remoteCmdShell
Constructor Detail

RemoteCommandShellOperation

public RemoteCommandShellOperation(
Shell shell,
                                   
IRemoteCmdSubSystem cmdSubSystem,
                                   
IRemoteFile pwd)
Constructor

Method Detail

setWorkingDirectory

public void setWorkingDirectory(
IRemoteFile pwd)

run

public 
IRemoteCommandShell run()
Launches a new remote shell


getRemoteCommandShell

public 
IRemoteCommandShell getRemoteCommandShell()

associateProject

public void associateProject(
IProject project)

finish

public void finish()
Called when a shell is complete.


getCurrentCommand

public 
String getCurrentCommand()

sendCommand

public void sendCommand(
String cmd)
Send a command to the running command shell.

Parameters:
cmd - the command to run in the shell

sendInput

public void sendInput(
String input)
Send input to the running command shell. The input is treated as input to a running program - rather than a new command. As such, no echos are used and it's not logged for completion.

Parameters:
input - the input to send to the running program

getShell

public 
Shell getShell()
Description copied from interface: ISystemShellProvider
This method will be called to return the shell for your viewer.

Specified by:
getShell in interface ISystemShellProvider
Returns:
the shell for your viewer.

isActive

public boolean isActive()
Indicates whether the command shell is active or not

Returns:
true if the command shell is running

systemResourceChanged

public void systemResourceChanged(
ISystemResourceChangeEvent event)
Description copied from interface: ISystemResourceChangeListener
This is the method in your class that will be called when a system resource changes.

Specified by:
systemResourceChanged in interface ISystemResourceChangeListener
See Also:
ISystemResourceChangeEvent

outputUpdated

public void outputUpdated()
Called (on the main Thread) whenever output is retrieved from the host


commandMatches

protected boolean commandMatches(
String outputEcho,
                                 
RemoteCommandShellOperation.CommandAlias firstCommand)

handleShellFinished

public void handleShellFinished()
Called (on the main Thread) when the shell is complete


handleCommandFinished

public abstract void handleCommandFinished(
String cmd)
Called (on the main Thread) when the specified command is complete

Parameters:
cmd - the completed command

handleOutputChanged

public abstract void handleOutputChanged(
String command,
                                         
Object output)
Called (on the main Thread) whenever output has changed

Parameters:
command - the current command
output - the new output object

RSE
Release 3.0

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

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire