Package client.net.sf.saxon.ce.client

Examples of client.net.sf.saxon.ce.client.HTTPHandler


            if (asyncSourceURI != null) {
              final String URI = asyncSourceURI;
              final Node transformTarget = target;

              logger.log(Level.FINE, "Aynchronous GET for: " + asyncSourceURI);
              final HTTPHandler hr = new HTTPHandler();

             hr.doGet(asyncSourceURI, new RequestCallback() {
              
               public void onError(Request request, Throwable exception) {
                 //hr.setErrorMessage(exception.getMessage());
                 String msg = "HTTP Error " + exception.getMessage() + " for URI " + URI;
                 handleException (new RuntimeException(msg), "onError");
               }
 
               public void onResponseReceived(Request request, Response response) {
                 int statusCode = response.getStatusCode();
                   if (statusCode == 200) {
                     Logger.getLogger("ResponseReceived").fine("GET Ok for: " + URI);
                     Node responseNode;
                     try {
                     responseNode = (Node)XMLDOM.parseXML(response.getText());
                     } catch(Exception e) {
                      handleException (new RuntimeException(e.getMessage()), "onResponseReceived");
                      return;
                     }
                     DocumentInfo responseDoc = config.wrapXMLDocument(responseNode, URI);
                     // now document is here, we can transform it
                     Node result = invokeTransform(responseDoc, transformTarget);
                     hr.setResultNode(result); // TODO: This isn't used yet
                       // handle OK response from the server
                   } else if (statusCode < 400) {
                     // transient
                   } else {
                     String msg = "HTTP Error " + statusCode + " " + response.getStatusText() + " for URI " + URI;
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.client.HTTPHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.