Package org.xmlBlaster.util.qos.address

Examples of org.xmlBlaster.util.qos.address.Destination


      System.out.println("***MsgQosTest: testDestination ...");

      MsgQosData qos = new MsgQosData(this.glob, MethodName.PUBLISH);
      assertEquals("", null, qos.getDestinations());
     
      Destination destination = new Destination("a@b", Constants.EXACT);

      assertNull("", qos.getDestinations());
      assertEquals("", 0, qos.getNumDestinations());
      assertEquals("", 0, qos.getDestinationArr().length);

View Full Code Here


         msgSequenceNumber++;
         String content = "" + msgSequenceNumber;
        
         PublishQos pq = new PublishQos(glob);
         for(int i=0; i<sessionNameArr.length; i++)
            pq.addDestination(new Destination(sessionNameArr[i]));
        
         MsgUnit msgUnit = new MsgUnit("<key oid='"+oid+"'/>", content.getBytes(), pq.toXml());

         PublishReturnQos rq = conHolder.con.publish(msgUnit);
        
View Full Code Here

     
      // String oid = "Message" + "-" + counter;
      log.info("Publishing a message " + toSessionName.getRelativeName() + " ...");
      PublishKey key = new PublishKey(this.glob, "testPtPDispatch");
     
      Destination destination = new Destination(this.glob, toSessionName);
      destination.forceQueuing(forceQueuing);
      PublishQos qos = new PublishQos(this.glob, destination);
      qos.setPersistent(persistent);
  
      String content = contentPrefix + "-" + this.counter;
      this.counter++;
View Full Code Here

         PublishQos publishQos = new PublishQos(glob);
         msgUnit = new MsgUnit(msgUnit, null, null, publishQos.getData());
         if (ptp) {
            PublishKey pk = new PublishKey(glob);
            PublishQos pq = new PublishQos(glob);
            pq.addDestination(new Destination(new SessionName(glob, secondName)));
            msgUnit = new MsgUnit(msgUnit, pk.getData(), null, pq.getData());
         }
         publishOid = callbackConnection.publish(msgUnit).getKeyOid();
         log.info("Success: Publish " + msgUnit.getKey() + " done");
         if (!ptp)
View Full Code Here

         }

         // Send a message to 'receiver' and block for the reply
         PublishKey pk = new PublishKey(sender.getGlobal(), "requestForEnlightenment");
         PublishQos pq = new PublishQos(sender.getGlobal());
         pq.addDestination(new Destination(new SessionName(sender.getGlobal(), receiverName)));
         MsgUnit msgUnit = new MsgUnit(pk, "Tell me the truth!", pq);
         MsgUnit[] replies = sender.request(msgUnit, 3000, 1);
         assertEquals("Missing reply message.", 1, replies.length);
         assertEquals("On doubt no ultimate truth, my dear.", replies[0].getContentStr());
         log.info(senderName+": Got " + replies.length + " reply :\n" + replies[0].toXml());
View Full Code Here

         for (int i=0; i<num; i++) {
            PublishKey pk = new PublishKey(glob, oid, "text/plain", "1.0");
            pk.setDomain("RUGBY_NEWS"); // heron is master: need for routing as heron is not directly connected to us
            PublishQos pq = new PublishQos(glob);
            SessionName sessionName = heronCon.getConnectReturnQos().getSessionName(); // destination client
            Destination destination = new Destination(sessionName);
            destination.forceQueuing(true);
            pq.addDestination(destination);
            log.info("Sending PtP message '" + oid + "' from bilbo to '" + sessionName + "' :" + pq.toXml());
            MsgUnit msgUnit = new MsgUnit(pk, (contentStr+"-"+i).getBytes(), pq);
            PublishReturnQos prq = bilboCon.publish(msgUnit);
            log.info("Published message to destination='" + sessionName +
View Full Code Here

      if (oid != null) key.setOid(oid);
      key.setClientTags("<airport/>");
      PublishQos qos = new PublishQos(glob);
      qos.setPersistent(true);
      qos.setVolatile(true);
      qos.addDestination(new Destination(new SessionName(this.glob, "joe")));
      MsgUnit msgUnit = new MsgUnit(key, content, qos);

      this.glob.getXmlBlasterAccess().publish(msgUnit);
      if (doGc) Util.gc(2);
      try {
View Full Code Here

    * <p />
    * You will receive the result set wrapped in XML with a asynchronous update().
    */
   public MsgUnit toMessage() throws XmlBlasterException
   {
      PublishQos qos = new PublishQos(glob, new Destination(new SessionName(Global.instance(), "__sys__jdbc")));
      PublishKey key = new PublishKey(glob, "", "text/xml", "SQL_QUERY");
      return new MsgUnit(key, toXml().getBytes(), qos);
   }
View Full Code Here

    */
   public SessionName getReceiver() {
      if (this.receiver == null) {
         ArrayList list = this.msgQosData.getDestinations();
         if (list != null && list.size() >0) {
            Destination d = (Destination) list.get(0);
            this.receiver = d.getDestination();
            if (list.size() > 1)
               log.warning("Ignoring other receivers with getReceiver()");
         }
      }
      return this.receiver;
View Full Code Here

      if (name.equalsIgnoreCase("destination")) {
         if (!inQos)
            return;
         inDestination = true;
         this.destination = new Destination();
         if (attrs != null) {
            int len = attrs.getLength();
            for (int i = 0; i < len; i++) {
               if( attrs.getQName(i).equalsIgnoreCase("queryType") ) {
                  String queryType = attrs.getValue(i).trim();
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.address.Destination

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.