Class ServerTaskManager

java.lang.Object
  |
  +--ServerTaskManager
All Implemented Interfaces:
java.util.EventListener, net.jxta.pipe.OutputPipeListener

public class ServerTaskManager
extends java.lang.Object
implements net.jxta.pipe.OutputPipeListener

This class is used to implement the Task Manager that manages the query tasks by maintaining a HashMap structure and manipulating it


Constructor Summary
ServerTaskManager(net.jxta.pipe.PipeService pipeService)
          Constructor : Constructs the task manager
 
Method Summary
 java.lang.String fileToString(java.lang.String fileName)
          Converts a file to string.
 void getTMKeys()
          Reads from file TModelKeys and assigns to inputTModelKey and outputTModelKey
 void inputTask(byte[] im, java.util.HashMap pt)
          Synchronously adds task to the HashMap to execute them.
static void main(java.lang.String[] args)
           
 void outputPipeEvent(net.jxta.pipe.OutputPipeEvent event)
          The OutputPipeListener event that is triggered when an OutputPipe is resolved by the call to PipeService.createOutputPipe.
 void performTasks()
          Synchronously executes the task queries and the response is stored in HashMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerTaskManager

public ServerTaskManager(net.jxta.pipe.PipeService pipeService)
Constructor : Constructs the task manager

Parameters:
pipeService - PipeService created in Server.java
Method Detail

outputPipeEvent

public void outputPipeEvent(net.jxta.pipe.OutputPipeEvent event)
The OutputPipeListener event that is triggered when an OutputPipe is resolved by the call to PipeService.createOutputPipe.

Specified by:
outputPipeEvent in interface net.jxta.pipe.OutputPipeListener
Parameters:
event - the event to use to extract the resolved output pipe.

inputTask

public void inputTask(byte[] im,
                      java.util.HashMap pt)
Synchronously adds task to the HashMap to execute them.


performTasks

public void performTasks()
Synchronously executes the task queries and the response is stored in HashMap.


fileToString

public java.lang.String fileToString(java.lang.String fileName)
Converts a file to string.

Returns:
String String that is generate from the contents of the file.

main

public static void main(java.lang.String[] args)

getTMKeys

public void getTMKeys()
Reads from file TModelKeys and assigns to inputTModelKey and outputTModelKey