Package org.xmlBlaster.client.script

Examples of org.xmlBlaster.client.script.XmlScriptClient


    if (xmlScript == null)
       xmlScript = new String(xmlScriptRaw, "UTF-8");
    log.info(id + " Processing script: " + xmlScript);
    java.io.Reader reader = new java.io.StringReader(xmlScript);
    java.io.ByteArrayOutputStream outStream = new java.io.ByteArrayOutputStream();
    XmlScriptClient interpreter = new XmlScriptClient(this.glob, this.xmlBlasterAccess, this,
        null, outStream);
    interpreter.setThrowAllExceptions(true);
    interpreter.parse(reader);
    byte[] bytes = outStream.toByteArray();
    out.write(new String(bytes, "UTF-8"));

    // Processing script: <xmlBlaster><disconnect><qos></qos></disconnect></xmlBlaster>
    // Unfortunately on disconnect() the toDead() is not triggered, so detect it here (Hack:)
View Full Code Here


         else if (actionType.equals("xmlScript")) {
            // Send xml encoded requests to the xmlBlaster server.
            // http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.script.html
            java.io.Reader reader = new java.io.StringReader(xmlRequest);
            java.io.OutputStream outStream = new java.io.ByteArrayOutputStream();
            XmlScriptClient interpreter =
                new XmlScriptClient(glob, xmlBlaster, pushHandler, null, outStream);
            interpreter.parse(reader);
            returnObject = outStream.toString();
         }

         else {
            String str = "Unknown or missing 'ActionType=" + actionType + "' please choose 'subscribe' 'unSubscribe' 'erase' etc.";
View Full Code Here

         if (this.outFileName != null && this.outFileName.length() > 0) {
            outStream = new FileOutputStream(this.outFileName);
            needsClosing = true;
         }

         XmlScriptClient interpreter =
            new XmlScriptClient(this.global, this.connection, outStream, outStream, null);

         InputStream in = this.scriptFileUrl.openStream();
         try {
            interpreter.parse(new InputStreamReader(in));
         }
         finally {
            try { in.close(); } catch(IOException e) { log.warning("Ignoring problem: " + e.toString()); }
            if (needsClosing) {
               try { outStream.close(); } catch(IOException e) { log.warning("Ignoring problem: " + e.toString()); }
View Full Code Here

             this.updateStream = this.responseStream;
          else {
             this.updateStream = new FileOutputStream(this.updateFile);
             closeUpdateStream = true;
          }
          this.interpreter = new XmlScriptClient(this.glob, this.glob.getXmlBlasterAccess(), this.updateStream, this.responseStream, null);

          if (this.prepareForPublish) {
             this.interpreter.registerMsgUnitCb(new I_MsgUnitCb() {
                public boolean intercept(MsgUnit msgUnit) {
                   msgUnit.getQosData().clearRoutes();
View Full Code Here

         }
         if (msgDelay > 0L || rateBytesPerSecond > 0L) {
            this.updStream = new OutputStreamWithDelay(this.updStream, msgDelay, rateBytesPerSecond);
         }
        
         this.interpreter = new XmlScriptClient(this.glob, this.glob.getXmlBlasterAccess(), this.outStream, this.updStream, null);

         if (this.prepareForPublish) {
            this.interpreter.registerMsgUnitCb(new I_MsgUnitCb() {
               public boolean intercept(MsgUnit msgUnit) {
                  msgUnit.getQosData().clearRoutes();
View Full Code Here

      this.accessor = new TestAccessor(global, doRemoteCalls);
      this.out = new ByteArrayOutputStream();
      this.attachments = new HashMap();
      String contentRef = "QmxhQmxhQmxh"; // this is used in testPublishArr
      this.attachments.put("attachment1", contentRef);
      this.interpreter = new XmlScriptClient(global, this.accessor, out, out, this.attachments);
      XMLUnit.setIgnoreWhitespace(true);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.script.XmlScriptClient

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.