Package com.xmultra.watcher

Examples of com.xmultra.watcher.FileRetryRecord


     */
    public synchronized static boolean incrementFileRetries(String filename,
                                                            int maxRetries,
                                                            int secsBetweenRetries) {

        FileRetryRecord fileRetryRecord = null;
        Object fileRetryRecordObj = retryRegistry.get(filename);

        // If the first retry, add a record.
        if (fileRetryRecordObj == null) {
            fileRetryRecord = new FileRetryRecord();
            fileRetryRecord.setMaxRetries(maxRetries);
            fileRetryRecord.setSecsBetweenRetries(secsBetweenRetries);
            retryRegistry.put(filename,fileRetryRecord);
        }
        else {
            fileRetryRecord = (FileRetryRecord)fileRetryRecordObj;
        }
        return fileRetryRecord.incrementRetries();
    }
View Full Code Here


            Object fileRetryRecordObj = retryRegistry.get(key);
            if (fileRetryRecordObj == null) {
                continue;
            }
             FileRetryRecord fileRetryRecord = (FileRetryRecord)fileRetryRecordObj;
             long lastRetryMS = fileRetryRecord.getLastRetryDate().getTime();
             long msBetweenRetries = fileRetryRecord.getSecsBetweenRetries() * 1000;

             // If the record is older than 5 times the retry time, remove it.
             if ((lastRetryMS + msBetweenRetries * 5) < currentTimeMS ) {
                 retryRegistry.remove(key);
             }
View Full Code Here

            CallbackRegistry.removeFromRetryRegistry(docFile.toString());
        }
        //Log the message that retrying
        else {
            // Get the record so we can log the number of retries so far.
            FileRetryRecord fileRetryRecord = CallbackRegistry.getFromRetryRegistry(docFile.toString());

            String errorMsg = "XformerProcessor Timed out. Previous error may have details. " +
                                fileRetryRecord.getRetryMessage();

            msgEntry.setAppContext("CleanUp()");
            msgEntry.setMessageText(errorMsg);
        }
View Full Code Here

                                              msgFile.toString(),
                                              this.maxNoRetries,
                                              this.secsBetweenRetries);

                // Get the record so we can log the number of retries so far.
                FileRetryRecord fileRetryRecord = CallbackRegistry.getFromRetryRegistry(msgFile.toString());

                String errorMsg = "Unable to send JMS message. Previous error may have details. " +
                                    fileRetryRecord.getRetryMessage();

                // If retried the maximum number of times, stop doing it.
                if (maxRetriesReached) {

                    // File error, move to the bad directory (unless a test mode is set).
View Full Code Here

     *
     * @return The effective or last modified time.
     */
    private long getLastModifiedOrRetryTime (File file) {

        FileRetryRecord fileRetryRecord =
              CallbackRegistry.getFromRetryRegistry(file.toString());

        // If null, then this file has no record of being retried.
        if (fileRetryRecord == null) {
            return file.lastModified();
        }

        long lastRetryMS = fileRetryRecord.getLastRetryDate().getTime();
        long msBetweenRetries = fileRetryRecord.getSecsBetweenRetries() * 1000l;

        return lastRetryMS + msBetweenRetries;
    }
View Full Code Here

                    requestFile.toString(),
                    this.maxNoRetries,
                    this.secsBetweenRetries);

                // Get the record so we can log the number of retries so far.
                FileRetryRecord fileRetryRecord = CallbackRegistry.getFromRetryRegistry(requestFile.toString());

                String errorMsg = "Web service error. Previous error may have details. " +
                    fileRetryRecord.getRetryMessage();

                // If retried the maximum number of times, stop doing it.
                if (maxRetriesReached) {

                    // File error, move to the bad directory (unless a test mode is set).
View Full Code Here

                    requestFile.toString(),
                    this.maxNoRetries,
                    this.secsBetweenRetries);

                // Get the record so we can log the number of retries so far.
                FileRetryRecord fileRetryRecord = CallbackRegistry.getFromRetryRegistry(requestFile.toString());

                String errorMsg = "Web service error. Previous error may have details. " +
                    fileRetryRecord.getRetryMessage();

                // If retried the maximum number of times, stop doing it.
                if (maxRetriesReached) {

                    // File error, move to the bad directory (unless a test mode is set).
View Full Code Here

TOP

Related Classes of com.xmultra.watcher.FileRetryRecord

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.