Package org.xmlBlaster.contrib

Examples of org.xmlBlaster.contrib.I_ChangePublisher


      this.dbWatcher = initializeDbWatcher(readerInfo, this.dbWriter);
      boolean autoSub = false;
      if (readerInfo != null)
         autoSub = readerInfo.getBoolean("_autoSubscribe", false);
      if (autoSub) {
         I_ChangePublisher publisher = (I_ChangePublisher)readerInfo.getObject("mom.publisher");
         if (publisher != null) {
           
            String prefix = readerInfo.get("replication.prefix", "repl_");
            String version = readerInfo.get("replication.version", "0.5");
            String prefixWithVersion = prefix + ReplicationConstants.VERSION_TOKEN + version;
View Full Code Here


      init(info);
   }

   public static I_ChangePublisher getChangePublisher(I_Info info) throws Exception {
      synchronized (info) {
         I_ChangePublisher publisher = (I_ChangePublisher)info.getObject("mom.publisher");
         if (publisher == null) {
            ClassLoader cl = DbWatcher.class.getClassLoader();
            String momClass = info.get("mom.class", "org.xmlBlaster.contrib.dbwatcher.mom.XmlBlasterPublisher").trim();
            if (momClass.length() > 0) {
               publisher = (I_ChangePublisher)cl.loadClass(momClass).newInstance();
               info.putObject("mom.publisher", publisher);
               if (log.isLoggable(Level.FINE))
                  log.fine(momClass + " created and initialized");
            }
            else
               log.severe("Couldn't initialize I_ChangePublisher, please configure 'mom.class'.");
         }
         publisher.init(info);
         return publisher;
      }
   }
View Full Code Here

                           ex = e;
                           response = "".getBytes();
                        }

                        if (true) { // TODO add here the possibility to block sending of messages
                           I_ChangePublisher momEngine = (I_ChangePublisher)this.info.getObject("org.xmlBlaster.contrib.dbwriter.mom.MomEventEngine");
                           if (momEngine == null)
                              throw new Exception("ReplicationWriter: the momEngine used can not handle publishes");
                           String statementId = getStringAttribute(STATEMENT_ID_ATTR, null, description);
                           String sqlTopic = getStringAttribute(SQL_TOPIC_ATTR, null, description);
                           HashMap map = new HashMap();
                           map.put(STATEMENT_ID_ATTR, statementId);
                           if (ex != null)
                              map.put(ReplicationConstants.EXCEPTION_ATTR, ex.getMessage());
                           momEngine.publish(sqlTopic, response, map);
                        }
                        else
                           log.info("statement '" + sql + "' resulted in response '" + new String(response));
                        if (ex != null) // now that we notified the server we can throw the exception
                           throw ex;
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.I_ChangePublisher

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.