muskel
Class DiscoveryThread

java.lang.Object
  extended by java.lang.Thread
      extended by muskel.DiscoveryThread
All Implemented Interfaces:
java.lang.Runnable

public class DiscoveryThread
extends java.lang.Thread

The discovery Thread always looks for new workers. Every time a worker is discovered, its name is issued to the Discovery Service that provides storing it properly in the data structure holding all the available processing resources.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DiscoveryThread(DiscoveryService s)
          constructor
 
Method Summary
 void run()
          this is to find workers with the discovery mechanism instead.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscoveryThread

public DiscoveryThread(DiscoveryService s)
constructor

Parameters:
s - the discovery service to be used to store the (possibly new) workers found
Method Detail

run

public void run()
this is to find workers with the discovery mechanism instead. Assumes that the fastest responders will be the best ones and therefore put them in front of the list.
The TTL of the multicast socket used to send discovery messages is currently set to a very large value, in order to be able to reach the larger number of nodes possible.
Take into account that usually firewalls of autonomous systems will filter out the discovery messages, being directed to an ephimeral port outside the ports that are usually "open" in most frameworks.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread