proper.remote
Class JobClient

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.core.ArgumentObject
          extended by proper.app.Application
              extended by proper.remote.Server
                  extended by proper.remote.JobClient
All Implemented Interfaces:
CommandLineInterface, ProperInterface, XMLAccessInterface

public class JobClient
extends Server

This class acts as a client to a server distributing jobs to be carried out.
Every request the client sends to the server has the type of request in the first line, the port it is listening to in the second line and any other data after that.

For a complete list of commandline parameters just run it with the option "-help".

Version:
$Revision: 1.2 $
Author:
FracPete
See Also:
JobServer

Field Summary
static int PORT
          the standard port to bind to
 
Fields inherited from class proper.remote.Server
ALIVE_CHECK, LIST_CLIENTS, REQUEST_ISALIVE, REQUEST_NOP
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
JobClient()
           
 
Method Summary
 java.lang.String getOutput()
          returns the output directory where to store the logfiles
 boolean getRunning()
          whether the client is still runnning
 java.lang.String getServerHostName()
          returns the server to connect to
 int getServerPort()
          returns the server port to connect to
 boolean isOperational()
          this method determines whether the server should continue accepting connections or not
static void main(java.lang.String[] args)
          starts the application
 void printDescription()
          prints a short description of this class
 boolean register()
          registers it self at the server
 void setRunning(boolean running)
          can only set the running state of the client to FALSE
 boolean unregister()
          unregisters it self at the server
 
Methods inherited from class proper.remote.Server
addToAccessLog, addToErrorLog, checkClients, createMessage, createMessage, getClientList, getHostName, getPort
 
Methods inherited from class proper.app.Application
checkCommandLine, createInstance, fromXML, parameterError, printUsage, run, run, setArgs, setArgs, toString, toXML
 
Methods inherited from class proper.core.ArgumentObject
fixAdditionalArg
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PORT

public static final int PORT
the standard port to bind to

See Also:
Constant Field Values
Constructor Detail

JobClient

public JobClient()
Method Detail

printDescription

public void printDescription()
prints a short description of this class

Specified by:
printDescription in interface CommandLineInterface
Overrides:
printDescription in class Application

getRunning

public boolean getRunning()
whether the client is still runnning


setRunning

public void setRunning(boolean running)
can only set the running state of the client to FALSE


getServerHostName

public java.lang.String getServerHostName()
returns the server to connect to


getServerPort

public int getServerPort()
returns the server port to connect to


getOutput

public java.lang.String getOutput()
returns the output directory where to store the logfiles


register

public boolean register()
registers it self at the server


unregister

public boolean unregister()
unregisters it self at the server


isOperational

public boolean isOperational()
this method determines whether the server should continue accepting connections or not

Overrides:
isOperational in class Server

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
starts the application

Throws:
java.lang.Exception