Package org.xmlBlaster.contrib

Examples of org.xmlBlaster.contrib.I_Info


    * @throws Exception Can be of any type
    */
   private void pollingExample(Preferences prefs) throws Exception {
      log.info("Start polling test");
     
      I_Info info = new Info(prefs);
      DbWatcher processor = new DbWatcher(info);
      processor.startAlertProducers();

      boolean interactive = info.getBoolean("interactive", true);
      if (interactive) {
         // Manually trigger db checking ...
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         while (true) {
            System.out.print("Hit 'q' to exit, 't' to trigger an event > ");
View Full Code Here


         }
         if (System.getProperty("db.password", null) == null) {
            System.setProperty("db.password", "");
         }

         I_Info info = new PropertiesInfo(System.getProperties());
         boolean forceCreationAndInit = true;
         I_DbSpecific specific = ReplicationConverter.getDbSpecific(info, forceCreationAndInit);
         pool = (I_DbPool) info.getObject("db.pool");
         conn = pool.reserve();
         conn.setAutoCommit(true);
         String schema = info.get("wipeout.schema", null);
         String version = info.get("replication.version", "0.0");
         if (schema == null) {
            String initialUpdateFile = info.get("initialUpdate.file", null);
            if (initialUpdateFile != null) {
               specific.initialCommand(null, initialUpdateFile, version);
            }
            else
               specific.cleanup(conn, true);
View Full Code Here

         else {
            System.err.println("Using properties file '" + propFile + "'");
            props = new Properties(System.getProperties());
            props.load(new FileInputStream(propFile));
         }
         I_Info info = new PropertiesInfo(props);
        
         if (args.length < 2) {
            System.err.println("Usage: " + SqlDescription.class.getName() + " oldFile.xml newFile.xml");
            System.exit(-1);
         }
View Full Code Here

         }
         if (System.getProperty("db.password", null) == null) {
            System.setProperty("db.password", "xbl");
         }
         SpecificOracle oracle = new SpecificOracle();
         I_Info info = new PropertiesInfo(System.getProperties());
         oracle.init(info);
         I_DbPool pool = (I_DbPool) info.getObject("db.pool");
         Connection conn = pool.reserve();
         String objectTypes = info.get("objectTypes", null);
         String schema = info.get("schema", "AIS");
         String referencedSchema = info.get("referencedSchema", null);
         oracle.cleanupSchema(schema, objectTypes, referencedSchema);
         conn = SpecificDefault.releaseIntoPool(conn, COMMIT_NO, pool);
      }
      catch (Throwable e) {
         System.err.println("SEVERE: " + e.toString());
View Full Code Here

   public static DbWriter createSingleDbWriter(I_Info masterInfo, String loginName, String password) throws Exception {
      if (loginName == null || loginName.length() < 0) {
         log.warning("The configuration contains no 'mom.loginName' property, will only use one instance of DbWriter based on other configuration parameters");
         return new DbWriter(masterInfo);
      }
      I_Info instanceInfo = new PropertiesInfo(new Properties()); // could be another implementation too
      InfoHelper.fillInfoWithEntriesFromInfo(instanceInfo, masterInfo);
      instanceInfo.put("mom.loginName", loginName);
      instanceInfo.put("mom.password", password);
      log.fine("instancing a DbWriter for mom.loginName '" + loginName + "' with password='" + password + "'");
      return new DbWriter(instanceInfo);
   }
View Full Code Here

         return srcData;
      return this.transformerCache.transform(replPrefix, srcVersion, destVersion, destination, srcData, null);
   }
  
   public byte[] transformVersion(String replPrefix, String destVersion, String destination, byte[] content) throws Exception {
      I_Info tmpInfo = (I_Info)this.replications.get(replPrefix);
      if (tmpInfo == null)
         throw new Exception("The replication with replication.prefix='" + replPrefix + "' was not found");
      String srcVersion = tmpInfo.get("replication.version", "0.0").trim();
      if (srcVersion.length() < 1)
         throw new Exception("The replication '" + replPrefix + "' has no version defined");
      return transformVersion(replPrefix, srcVersion, destVersion, destination, content);
   }
View Full Code Here

         throw new Exception("The replication '" + replPrefix + "' has no version defined");
      return transformVersion(replPrefix, srcVersion, destVersion, destination, content);
   }
  
   public String transformVersion(String replPrefix, String destVersion, String destination, String is) throws Exception {
      I_Info tmpInfo = (I_Info)this.replications.get(replPrefix);
      if (tmpInfo == null)
         throw new Exception("The replication with replication.prefix='" + replPrefix + "' was not found");
      String srcVersion = tmpInfo.get("replication.version", "0.0").trim();
      if (srcVersion.length() < 1)
         throw new Exception("The replication '" + replPrefix + "' has no version defined");
      return new String(transformVersion(replPrefix, srcVersion, destVersion, destination, is.getBytes()));
   }
View Full Code Here

         return (I_ReplSlave)this.replSlaveMap.get(name);
      }
   }
  
   public String reInitiate(String replPrefix) {
      I_Info info = (I_Info)this.replications.get(replPrefix);
      I_ReplSlave[] slaves = (I_ReplSlave[])this.replSlaveMap.values().toArray(new I_ReplSlave[this.replSlaveMap.size()]);
      StringBuffer buf = new StringBuffer();
      for (int i=0; i < slaves.length; i++) {
         String thisReplPrefix = slaves[i].getReplPrefix();
         if (thisReplPrefix != null && thisReplPrefix.equals(replPrefix)) {
View Full Code Here

      // rebuild the cache
      Iterator iter = this.replications.values().iterator();
      boolean isFirst = true;
      StringBuffer buf = new StringBuffer();
      while (iter.hasNext()) {
         I_Info tmpInfo = (I_Info)iter.next();
         String tmp = tmpInfo.get(SUPPORTED_VERSIONS, null);
         log.info("replications : '" + tmp + "'");
         if (tmp != null) {
            if (!isFirst)
               buf.append(",");
            isFirst = false;
View Full Code Here

         log.info(ret);
        
         String replicationPrefix = VersionTransformerCache.stripReplicationPrefix(prefixWithVersion);
         String requestedVersion = VersionTransformerCache.stripReplicationVersion(prefixWithVersion);
        
         I_Info individualInfo = (I_Info)this.replications.get(replicationPrefix);
         if (individualInfo != null) {
           
            if (realInitialFilesLocation != null && realInitialFilesLocation.trim().length() > 0) {
               checkExistance(realInitialFilesLocation.trim());
               this.initialFilesLocation = realInitialFilesLocation.trim();
               individualInfo.put(INITIAL_FILES_LOCATION, this.initialFilesLocation);
            }
            else {
               // individualInfo.putObject(INITIAL_FILES_LOCATION, null);
               individualInfo.put(INITIAL_FILES_LOCATION, null);
            }
            individualInfo.put(REPL_VERSION, requestedVersion);
            individualInfo.putObject("org.xmlBlaster.engine.Global", this.global);
            I_ReplSlave slave = null;
            synchronized (this.replSlaveMap) {
               slave = (I_ReplSlave)this.replSlaveMap.get(slaveSessionName);
            }
            if (slave != null) {
               individualInfo.put("_replName", replicationPrefix);
               String dbWatcherSessionId = individualInfo.get(SENDER_SESSION, null);
               if (dbWatcherSessionId == null)
                  throw new Exception("ReplSlave '" + slave + "' constructor: the master Session Id (which is passed in the properties as '" + SENDER_SESSION + "' are not found. Can not continue with initial update");

               if (cascadeSlaveSessionName != null) {
                  // check to avoid loops
View Full Code Here

TOP

Related Classes of org.xmlBlaster.contrib.I_Info

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.