org.xmlecho.palomar.core
Class ECHOConnectionImpl

java.lang.Object
  extended byorg.xmlecho.palomar.core.ECHOConnectionImpl
All Implemented Interfaces:
ECHOConnection

public class ECHOConnectionImpl
extends java.lang.Object
implements ECHOConnection

maintains state for a connection to an ECHO XProcessor


Constructor Summary
ECHOConnectionImpl(XProcessor xProcessor, java.lang.String userName, java.lang.String userCredential)
           
 
Method Summary
 void evalECHOString(java.lang.String request, org.xml.sax.ContentHandler response, ECHOContext context)
          evaluates the ECHO script in the given request String.
 void evalECHOToSAX(org.xml.sax.XMLReader reader, org.xml.sax.InputSource src, org.xml.sax.ContentHandler result, ECHOContext context)
          evaluates the ECHO request with the current context.
 ECHOContext getBaseContext()
          returns the original context, with bindings for the connection parameters.
 User getConnectedUser()
           
 XProcessor getECHO()
          return the ECHO XProcessor for this connection.
 ECHOContext getExtendedContext()
          returns a newly extended context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECHOConnectionImpl

public ECHOConnectionImpl(XProcessor xProcessor,
                          java.lang.String userName,
                          java.lang.String userCredential)
                   throws ECHOException
Method Detail

getConnectedUser

public User getConnectedUser()
Specified by:
getConnectedUser in interface ECHOConnection
Returns:
the User associated with this connection

getECHO

public XProcessor getECHO()
Description copied from interface: ECHOConnection
return the ECHO XProcessor for this connection.

Specified by:
getECHO in interface ECHOConnection

getExtendedContext

public ECHOContext getExtendedContext()
returns a newly extended context

Specified by:
getExtendedContext in interface ECHOConnection

getBaseContext

public ECHOContext getBaseContext()
Description copied from interface: ECHOConnection
returns the original context, with bindings for the connection parameters. Bindings made in this context persist for for the lifetime of this connection.

Specified by:
getBaseContext in interface ECHOConnection

evalECHOString

public void evalECHOString(java.lang.String request,
                           org.xml.sax.ContentHandler response,
                           ECHOContext context)
                    throws java.lang.Exception
evaluates the ECHO script in the given request String. This method binds the empty namespace to the ECHOHome NAMESPACE, parses the string as XML into an abstract syntax tree model of the script, then evaluates the script under the given Context. The XML result of the evaluation are streamed as SAX events to the provided response ContentHandler.

Specified by:
evalECHOString in interface ECHOConnection
Throws:
java.lang.Exception

evalECHOToSAX

public void evalECHOToSAX(org.xml.sax.XMLReader reader,
                          org.xml.sax.InputSource src,
                          org.xml.sax.ContentHandler result,
                          ECHOContext context)
                   throws ECHOException
evaluates the ECHO request with the current context. writing the result as to the given ContentHandler

Specified by:
evalECHOToSAX in interface ECHOConnection
Throws:
ECHOException