org.xmlecho.palomar.core
Class XProcessorImpl

java.lang.Object
  extended byorg.xmlecho.palomar.core.XProcessorImpl
All Implemented Interfaces:
XProcessor
Direct Known Subclasses:
XProcessorHTTPClientImpl

public class XProcessorImpl
extends java.lang.Object
implements XProcessor

The ECHO language processor configured with mappings from Element names to classes which implement the commands' semantics.


Field Summary
protected static int _activeProcesses
           
protected  javax.xml.parsers.DocumentBuilder _db
           
protected  org.w3c.dom.Document _doc
           
protected  org.apache.log4j.Logger _logger
           
protected  org.xmlecho.palomar.dom.ElementFactory _myElementFactory
           
protected  org.xmlecho.palomar.dom.ElementFactory _myResponseFactory
           
protected static java.util.Hashtable _processTable
           
protected  ECHORequest _request
           
protected  java.lang.String _urlString
           
 
Constructor Summary
XProcessorImpl()
           
XProcessorImpl(org.xmlecho.palomar.dom.ElementFactory factory)
           
 
Method Summary
 ECHORequest compile(org.xml.sax.XMLReader reader, org.xml.sax.InputSource src)
           
 ECHOContext createContext()
          create an initial context for a request
 void eval(ECHOContext context, ECHORequest request, org.xml.sax.ContentHandler responseTarget)
          evaluate the request
 void eval(ECHOContext context, org.xml.sax.XMLReader reader, org.xml.sax.InputSource src, org.xml.sax.ContentHandler responseTarget)
          evaluate the request
 org.w3c.dom.Element evalToResponse(ECHOContext ctx, ECHORequest request)
          evaluate the request, constructing a DOM result with the default ElementFactory
 org.w3c.dom.Element evalToResponse(ECHOContext ctx, org.xml.sax.XMLReader reader, org.xml.sax.InputSource src)
          evaluate the request, constructing a DOM result with the default ElementFactory
 int getActiveProcessCount()
          returns the number of ECHO processes which are being processed by instances of this class at this moment
 void interruptProcess(java.lang.String processName, java.lang.String processId)
          interrupts a running process
 void listProcesses(org.xml.sax.ContentHandler ch)
          lists the running processes by emitting a SAX event stream to the target ContentHandler
 void setRequestFactory(org.xmlecho.palomar.dom.ElementFactory fact)
           
 void setResponseFactory(org.xmlecho.palomar.dom.ElementFactory fact)
           
 void setThreadProperty(java.lang.String propName, java.lang.Object value)
          record state information for a thread
 void setURL(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_doc

protected org.w3c.dom.Document _doc

_db

protected javax.xml.parsers.DocumentBuilder _db

_logger

protected org.apache.log4j.Logger _logger

_request

protected ECHORequest _request

_myElementFactory

protected org.xmlecho.palomar.dom.ElementFactory _myElementFactory

_myResponseFactory

protected org.xmlecho.palomar.dom.ElementFactory _myResponseFactory

_activeProcesses

protected static int _activeProcesses

_processTable

protected static java.util.Hashtable _processTable

_urlString

protected java.lang.String _urlString
Constructor Detail

XProcessorImpl

public XProcessorImpl()

XProcessorImpl

public XProcessorImpl(org.xmlecho.palomar.dom.ElementFactory factory)
Parameters:
factory - an ElementFactory for the ECHO Command objects appropriate to ECHO element names
Method Detail

setRequestFactory

public void setRequestFactory(org.xmlecho.palomar.dom.ElementFactory fact)

setResponseFactory

public void setResponseFactory(org.xmlecho.palomar.dom.ElementFactory fact)

setURL

public void setURL(java.lang.String url)

createContext

public ECHOContext createContext()
create an initial context for a request

Specified by:
createContext in interface XProcessor

getActiveProcessCount

public int getActiveProcessCount()
returns the number of ECHO processes which are being processed by instances of this class at this moment

Specified by:
getActiveProcessCount in interface XProcessor

eval

public void eval(ECHOContext context,
                 ECHORequest request,
                 org.xml.sax.ContentHandler responseTarget)
          throws java.lang.Exception
evaluate the request

Specified by:
eval in interface XProcessor
Throws:
java.lang.Exception

compile

public ECHORequest compile(org.xml.sax.XMLReader reader,
                           org.xml.sax.InputSource src)
                    throws org.xml.sax.SAXException,
                           TransformException,
                           java.io.IOException
Specified by:
compile in interface XProcessor
Throws:
org.xml.sax.SAXException
TransformException
java.io.IOException

eval

public void eval(ECHOContext context,
                 org.xml.sax.XMLReader reader,
                 org.xml.sax.InputSource src,
                 org.xml.sax.ContentHandler responseTarget)
          throws java.lang.Exception
evaluate the request

Specified by:
eval in interface XProcessor
Throws:
java.lang.Exception

evalToResponse

public org.w3c.dom.Element evalToResponse(ECHOContext ctx,
                                          ECHORequest request)
                                   throws java.lang.Exception
evaluate the request, constructing a DOM result with the default ElementFactory

Throws:
java.lang.Exception

evalToResponse

public org.w3c.dom.Element evalToResponse(ECHOContext ctx,
                                          org.xml.sax.XMLReader reader,
                                          org.xml.sax.InputSource src)
                                   throws java.lang.Exception
evaluate the request, constructing a DOM result with the default ElementFactory

Throws:
java.lang.Exception

setThreadProperty

public void setThreadProperty(java.lang.String propName,
                              java.lang.Object value)
Description copied from interface: XProcessor
record state information for a thread

Specified by:
setThreadProperty in interface XProcessor

listProcesses

public void listProcesses(org.xml.sax.ContentHandler ch)
                   throws org.xml.sax.SAXException
Description copied from interface: XProcessor
lists the running processes by emitting a SAX event stream to the target ContentHandler

Specified by:
listProcesses in interface XProcessor
Throws:
org.xml.sax.SAXException

interruptProcess

public void interruptProcess(java.lang.String processName,
                             java.lang.String processId)
                      throws java.lang.Exception
interrupts a running process

Specified by:
interruptProcess in interface XProcessor
Throws:
java.lang.Exception