ami
Class AMIServiceReader

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--ami.AMIServiceReader
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, Runnable

class AMIServiceReader
extends org.xml.sax.helpers.DefaultHandler
implements Runnable

Thread used to read and check incoming AIS ( AMI Input Services )

Singleton

Version:
1.0
Author:
Bertrand Florat

Field Summary
private  AMIServiceProcessor asp
           
private static AMIServiceReader asr
          Self instance used for signleton pattern
private static boolean bStop
           
private  Hashtable hCurrentAIS
           
private  int iCheckInterval
           
private  String sCurrentCriteriaProtocol
           
private  Thread tThread
           
private  Vector vAISPacket
          vector vAISPacket contains n hashtable hCurrentAIS hashtable hCurrentAIS contains attributes entries and an object ( vector or string ) if any subelements -- AR case: Hashtable ar contains n vectors vParam Each vParam vector contains n sParam string array sParam array contains entries of the param ( "name", "value", "and" ) -- EAI case: "eai" -> hEAI hEAI hashtable contains EAI properties
 
Constructor Summary
private AMIServiceReader(AMIServiceProcessor asp)
          Constructor for the AMIServiceReader object
 
Method Summary
static AMIServiceReader getInstance(AMIServiceProcessor asp)
          Return a self instance Implementation of the singleton pattern
 void run()
          Main processing method for the AMIServiceReader object
 void startDocument()
          Called at the beginning of the query
 void startElement(String sUri, String sName, String sQName, org.xml.sax.Attributes attributes)
          Called when we start an element
 void startPrefixMapping(String sPrefix, String sUri)
          Called to process namespaces
(package private) static void stop()
          Finalize the service reader
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

tThread

private Thread tThread

iCheckInterval

private int iCheckInterval

vAISPacket

private Vector vAISPacket

vector vAISPacket contains n hashtable hCurrentAIS

hashtable hCurrentAIS contains attributes entries and an object ( vector or string ) if any subelements

-- AR case:

Hashtable ar contains n vectors vParam

Each vParam vector contains n sParam string array

sParam array contains entries of the param ( "name", "value", "and" )

-- EAI case: "eai" -> hEAI

hEAI hashtable contains EAI properties


hCurrentAIS

private Hashtable hCurrentAIS

sCurrentCriteriaProtocol

private String sCurrentCriteriaProtocol

asp

private AMIServiceProcessor asp

bStop

private static volatile boolean bStop

asr

private static AMIServiceReader asr
Self instance used for signleton pattern
Constructor Detail

AMIServiceReader

private AMIServiceReader(AMIServiceProcessor asp)
Constructor for the AMIServiceReader object
Method Detail

getInstance

public static AMIServiceReader getInstance(AMIServiceProcessor asp)
Return a self instance

Implementation of the singleton pattern


run

public void run()
Main processing method for the AMIServiceReader object
Specified by:
run in interface Runnable

startPrefixMapping

public void startPrefixMapping(String sPrefix,
                               String sUri)
                        throws org.xml.sax.SAXException
Called to process namespaces
Overrides:
startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
Parameters:
sPrefix - Description of Parameter
sUri - Description of Parameter
Throws:
org.xml.sax.SAXException - Description of Exception

startDocument

public void startDocument()
Called at the beginning of the query
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(String sUri,
                         String sName,
                         String sQName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Called when we start an element
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
sUri - Description of Parameter
sName - Description of Parameter
sQName - Description of Parameter
attributes - Description of Parameter
Throws:
org.xml.sax.SAXException - Description of Exception

stop

static void stop()
Finalize the service reader