All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.dispatcher.BargainerWorker

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----semper.dispatcher.BargainerWorker

public class BargainerWorker
extends Thread
implements BargainerTaskControl
This class is responsible for the setup of tx-connection between client and server bargainers

Author:
Kostas Tzelepis, Petros Pantis

Constructor Index

 o BargainerWorker(int, BargainerMonitor)
starts a new BargainerWorker, this is called at run time by the Monitor object when it feels more BargainerWorkers are needed to handle the load.

Method Index

 o Handler(Object)
Called from the Monitor object in order to associate a new client connection,or to create a new one, with a idle BargainerWorker object
 o run()
This method retrieves the requested BApp and associate this BA with a new created tx-connection in case of a server BApp.
 o SetPriority(int)
Method used to set the priority level of the current thread object
 o Stop()
Called from the Monitor object in order to destroys the BargainerWorker object

Constructors

 o BargainerWorker
 public BargainerWorker(int id,
                        BargainerMonitor dismnt)
starts a new BargainerWorker, this is called at run time by the Monitor object when it feels more BargainerWorkers are needed to handle the load.

Parameters:
id - the Id of the BargainerWorker object
dismnt - a reference to the Monitor object

Methods

 o Stop
 public void Stop()
Called from the Monitor object in order to destroys the BargainerWorker object

 o Handler
 public synchronized void Handler(Object conn)
Called from the Monitor object in order to associate a new client connection,or to create a new one, with a idle BargainerWorker object

Parameters:
conn - the new task description object
 o run
 public void run()
This method retrieves the requested BApp and associate this BA with a new created tx-connection in case of a server BApp. In case of a client BApp this method created the appropriated BApp object and starts them.

Overrides:
run in class Thread
 o SetPriority
 public void SetPriority(int prio)
Method used to set the priority level of the current thread object

Parameters:
prio - the new priority level

All Packages  Class Hierarchy  This Package  Previous  Next  Index