org.pricingnexus.worker
Class USSHttpFetcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.pricingnexus.worker.USSHttpFetcher
All Implemented Interfaces:
java.lang.Runnable

public class USSHttpFetcher
extends java.lang.Thread

The class belongs directly to the URLSourceServant class. As the later on controlls just the flow of URL price requests, i.e. handles new requests by distributing them to clients made from THIS class and flushes the requests on a regular basis, this class here makes the main work. It goes through all stored URLs and retreives data in respect to their individual refresh interval. It parses the HTTP source using XSLT and publishes the raw price information on JMS for further handling. Please note, that this is done serially for all URLs a individual instance of this object has to handle. If you want a more parallel handling then just increas the "URL_SOURCE_SERVANT_SUB_THREADS" parameter in the INI file. $Header$


Field Summary
 boolean shutdownProcess
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
USSHttpFetcher(java.util.Hashtable xsltTransformer, JmsWrapper rawPrice, int sessionID, LogSender myLogger)
          Default constructor
 
Method Summary
 void flushAll()
          call this to force a dump off all active URLs
 void newURL(int dbID, java.lang.String url, java.lang.String xssName, int refreshIntervall)
          Adds one new URL information.
 void run()
          The main part of it all: Creates connections to JMS and after that retreives continously HTTP sources from the URLs in respect to the refresh interval
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Field Detail

shutdownProcess

public boolean shutdownProcess
Constructor Detail

USSHttpFetcher

public USSHttpFetcher(java.util.Hashtable xsltTransformer,
                      JmsWrapper rawPrice,
                      int sessionID,
                      LogSender myLogger)
               throws javax.jms.JMSException
Default constructor
Parameters:
xsltTransformer - Hashtable reference with all XSLT transformations sessionID unique identifiert
Throws:
JMSException -  
Method Detail

newURL

public void newURL(int dbID,
                   java.lang.String url,
                   java.lang.String xssName,
                   int refreshIntervall)
Adds one new URL information. Please note that it is not checked if this URL is already in the cache so duplicate subscriptions can occur. That's the reason why we have a "flushAll" method defined ;-))

run

public void run()
The main part of it all: Creates connections to JMS and after that retreives continously HTTP sources from the URLs in respect to the refresh interval
Overrides:
run in class java.lang.Thread

flushAll

public void flushAll()
call this to force a dump off all active URLs