pt.moredata.programlaunch
Class AbstractCommandRunner

java.lang.Object
  extended bypt.moredata.programlaunch.AbstractCommandRunner
All Implemented Interfaces:
pt.moredata.programlaunch.CommandRunner

public abstract class AbstractCommandRunner
extends java.lang.Object
implements pt.moredata.programlaunch.CommandRunner

AbstractCommandRunner.java Company MoreData

Version:
$Revision: 1.5 $
Author:
psfbc

Field Summary
protected  java.lang.String _arguments
          Arguments used to run the class.
protected  java.lang.String _command
          The commans send by the client.
protected  ServerProperties _serverProperties
          The server properties.
 
Constructor Summary
AbstractCommandRunner()
           
 
Method Summary
protected  java.lang.String[] getArgumentsArray()
          Creates a String[] with the arguments to the main method of the target class.
protected  void getClientData()
          Get client input data from client input stream.
 void run()
          Run each command send by the client.
protected abstract  void runCommand()
          Run one command send by the client.
protected  void sendOutputToTheClient(java.io.BufferedInputStream in, java.io.BufferedInputStream err)
          Sends output collected to the _stdoutFile and _stderrFile to the client.
 void setServerProperties(ServerProperties properties)
          Sets server properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_serverProperties

protected ServerProperties _serverProperties
The server properties.


_command

protected java.lang.String _command
The commans send by the client.


_arguments

protected java.lang.String _arguments
Arguments used to run the class.

Constructor Detail

AbstractCommandRunner

public AbstractCommandRunner()
Method Detail

runCommand

protected abstract void runCommand()
Run one command send by the client.


getClientData

protected void getClientData()
Get client input data from client input stream.


getArgumentsArray

protected java.lang.String[] getArgumentsArray()
Creates a String[] with the arguments to the main method of the target class.


sendOutputToTheClient

protected void sendOutputToTheClient(java.io.BufferedInputStream in,
                                     java.io.BufferedInputStream err)
Sends output collected to the _stdoutFile and _stderrFile to the client. TODO : Este metodo podia mandar para o log do servidor, o output que vai enviar ao cliente.


run

public void run()
Run each command send by the client.

Specified by:
run in interface pt.moredata.programlaunch.CommandRunner

setServerProperties

public void setServerProperties(ServerProperties properties)
Sets server properties.

Specified by:
setServerProperties in interface pt.moredata.programlaunch.CommandRunner
Parameters:
properties - The server properties.