Package org.xmlBlaster.client.qos

Examples of org.xmlBlaster.client.qos.ConnectQos


            this.pool = initializePersistentInfo();
        
         I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
         this.user = get("mom.user", this.user);
         this.password = get("mom.password", this.password);
         ConnectQos connectQos = new ConnectQos(this.global, this.user, this.password);
         boolean persistentConnection = true;
         boolean persistentSubscription = true;
         connectQos.setPersistent(persistentConnection);
         connectQos.setMaxSessions(1);
         connectQos.setPtpAllowed(true);
         connectQos.setSessionTimeout(0L);
         String sessionName = REPL_MANAGER_SESSION;
         connectQos.setSessionName(new SessionName(this.global, sessionName));
         conn.connect(connectQos, this);
        
         // this is the instance passed from the outside, not a clone, otherwise
         // it will not find the plugin registry for the MIME plugin
         putObject("org.xmlBlaster.engine.Global", global);
View Full Code Here


  
   public static void main(String[] args) {
      try {
         Global global = new Global(args);
         I_XmlBlasterAccess conn = global.getXmlBlasterAccess();
         ConnectQos connectQos = new ConnectQos(global);
         conn.connect(connectQos, new ReplManagerPlugin()); // just a fake
        
         String cmd = global.getProperty().get("cmd", (String)null);
         if (cmd == null)
            mainUsage();
View Full Code Here

      this.timeout = this.glob.getProperty().get("timeout", timeout);
      this.consuming = this.glob.getProperty().get("consuming", consuming);
      this.queueOid = this.glob.getProperty().get("queueOid", "topic/Hello");
     
      try {
         ConnectQos qos = new ConnectQos(glob);
         con.connect(qos, null)// Login to xmlBlaster
        
         Thread thread = new Thread(new Runnable() {
            public void run() {
               while (true) {
View Full Code Here

         // Check if other login name or password was given on command line:
         // (This is redundant as it is done by ConnectQos already)
         String name = glob.getProperty().get("session.name", "HelloWorld3");
         String passwd = glob.getProperty().get("passwd", "secret");

         ConnectQos qos = new ConnectQos(glob, name, passwd);
         con.connect(qos, this)// Login to xmlBlaster, register for updates


         PublishKey pk = new PublishKey(glob, "HelloWorld3", "text/xml", "1.0");
         pk.setClientTags("<org.xmlBlaster><demo/></org.xmlBlaster>");
View Full Code Here

      try {

         {  // setup the sender client ...
            sender = glob.getXmlBlasterAccess();

            ConnectQos qos = new ConnectQos(sender.getGlobal(), senderName, "secret");
            ConnectReturnQos conRetQos = sender.connect(qos, null); // Login to xmlBlaster

            log.info("Sender connected to xmlBlaster " + conRetQos.getSessionName().getRelativeName());
         }


         {  // setup the receiver client which processes the request (usually another process) ...
            Global globReceiver = glob.getClone(null);
            receiver = globReceiver.getXmlBlasterAccess();

            ConnectQos qos = new ConnectQos(receiver.getGlobal(), receiverName, "secret");
            ConnectReturnQos conRetQos = receiver.connect(qos, new I_Callback() {
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  log.info(receiverName+": Receiving asynchronous message '" + updateKey.getOid() + "' in receiver default handler");
                  log.info(receiverName+": Received: " + updateKey.toXml() + "\n <content>" + new String(content) + "</content>" + updateQos.toXml());
View Full Code Here

{
   public HelloWorld2(final Global glob) {
      try {
         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();

         ConnectQos qos = new ConnectQos(glob);
         con.connect(qos, this)// Login to xmlBlaster, register for updates

         con.subscribe("<key oid='HelloWorld2'/>", "<qos/>");
        
         // A similar subscription with XPATH:
View Full Code Here

     
      I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess();
     
      try {
         ConnectQos qos = new ConnectQos(glob);

         // '-dispatch/connection/doSendConnect false' on command line would do the same
         qos.doSendConnect(false);
        
         // Initializes everything but does NOT send connect message
         con.connect(qos, this);

         log.info("Waiting now for updates ...");
View Full Code Here

            }
         });

         // ConnectQos checks -session.name and -passwd from command line
         log.info("============= CreatingConnectQos");
         ConnectQos qos = new ConnectQos(glob);
         if (connectPersistent) {
            qos.setPersistent(connectPersistent);
         }
         // "__remoteProperties"
         qos.getData().addClientProperty(Constants.CLIENTPROPERTY_REMOTEPROPERTIES, true);
         if (connectQosClientPropertyMap != null) {
            Iterator it = connectQosClientPropertyMap.keySet().iterator();
            while (it.hasNext()) {
               String key = (String)it.next();
               qos.addClientProperty(key, connectQosClientPropertyMap.get(key).toString());
            }
         }
         log.info("ConnectQos is " + qos.toXml());
         ConnectReturnQos crq = con.connect(qos, new I_Callback() {
      public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException {
        try {
          log.info("Received '" + updateKey.getOid() + "':" + new String(content, "UTF-8"));
        } catch (UnsupportedEncodingException e) {
View Full Code Here

      catch (Exception ex) {
         ex.printStackTrace();
         assertTrue("exception in constructor when starting naming service", false);
      }

      this.qos = new ConnectQos(this.glob);
      this.qos.addClientProperty("one", "1");
      this.qos.setPersistent(true);
      this.qos.setMaxSessions(100000);
      this.env = new Hashtable();
      this.env.put(XBPropertyNames.CONNECT_QOS, qos.toXml());
View Full Code Here

   public void testConnectionFactory() {
      try {

         InitialContext ctx = new InitialContext(this.env);
         XBConnectionFactory factory = (XBConnectionFactory)ctx.lookup(CONNECTION_FACTORY);
         ConnectQos qos1 = factory.getConnectQos();

         if (log.isLoggable(Level.FINE)) {
            System.out.println("--------------------------------------");
            System.out.println(qos.toXml());
            System.out.println("--------------------------------------");
            System.out.println(qos1.toXml());
            System.out.println("--------------------------------------");
         }
        
         assertXMLEqual(qos.toXml(), qos1.toXml());
      }
      catch (Exception ex) {
         ex.printStackTrace();
         assertTrue("naming exception", false);
      }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.qos.ConnectQos

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.