Examples of RetryHandler


Examples of net.sf.sstk.retry.support.RetryHandler

  public Object doWithRetry(final ProceedingJoinPoint pjp, final Retry retry)
      throws Throwable {
    final RetryInvocation ri = new RetryInvocationJoinPointWrapper(pjp);
    final RetryDefinition rd = this.annotationDefinitionSource
        .createDefinition(retry, this.beanFactory);
    final RetryHandler rh = new RetryHandler();
    return rh.handleWithRetry(ri, rd);
  }
View Full Code Here

Examples of net.sf.urlchecker.commands.RetryHandler

        if (null == type) {
            type = HTTPMethods.HEAD;
        }
        final HttpMethod method = type.getMethod(source);
        method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                new RetryHandler());

        return method;
    }
View Full Code Here

Examples of net.sf.urlchecker.commands.RetryHandler

    /**
     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {
        retry = new RetryHandler();
        client = CommunicationFactory.getInstance().configureClient(true);
    }
View Full Code Here

Examples of org.apache.james.util.retry.api.RetryHandler

     * Test method for .
     */
    @Test
    public final void testPostFailure() {
  final List<Exception> results = new ArrayList<Exception>();
  RetryHandler handler = new ExceptionRetryHandler(
    _exceptionClasses, _proxy, _schedule, 7) {

      @Override
      public void postFailure(Exception ex, int retryCount) {
    super.postFailure(ex, retryCount);
    results.add(ex);
      }

      @Override
      public Object operation() throws Exception {
    throw new Exception();
      }
  };
  try {
      handler.perform();
  } catch (Exception ex) {
      // no-op
  }
  assertEquals(7, results.size());
    }
View Full Code Here

Examples of org.apache.james.util.retry.api.RetryHandler

     * Test method for .
     * @throws Exception
     */
    @Test
    public final void testOperation() throws Exception {
  RetryHandler handler = new ExceptionRetryHandler(
    _exceptionClasses, _proxy, _schedule, 0) {

      @Override
      public Object operation() throws Exception {
    return "Hi!";
      }
  };
  assertEquals("Hi!", handler.operation());
    }
View Full Code Here

Examples of org.apache.tools.ant.util.RetryHandler

                if (!pd.exists()) {
                    pd.mkdirs();
                }
                bw = new BufferedWriter(new FileWriter(listing));
            }
            RetryHandler h = new RetryHandler(this.retriesAllowed, this);
            if (action == RM_DIR) {
                // to remove directories, start by the end of the list
                // the trunk does not let itself be removed before the leaves
                for (int i = dsfiles.length - 1; i >= 0; i--) {
                    final String dsfile = dsfiles[i];
View Full Code Here

Examples of org.apache.tools.ant.util.RetryHandler

            // If an initial command was configured then send it.
            // Some FTP servers offer different modes of operation,
            // E.G. switching between a UNIX file system mode and
            // a legacy file system.
            if (this.initialSiteCommand != null) {
                RetryHandler h = new RetryHandler(this.retriesAllowed, this);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                    public void execute() throws IOException {
                        doSiteCommand(lftp, FTP.this.initialSiteCommand);
                    }
                }, "initial site command: " + this.initialSiteCommand);
            }


            // For a unix ftp server you can set the default mask for all files
            // created.

            if (umask != null) {
                RetryHandler h = new RetryHandler(this.retriesAllowed, this);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                    public void execute() throws IOException {
                        doSiteCommand(lftp, "umask " + umask);
                    }
                }, "umask " + umask);
            }

            // If the action is MK_DIR, then the specified remote
            // directory is the directory to create.

            if (action == MK_DIR) {
                RetryHandler h = new RetryHandler(this.retriesAllowed, this);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                    public void execute() throws IOException {
                        makeRemoteDir(lftp, remotedir);
                    }
                }, remotedir);
            } else if (action == SITE_CMD) {
                    RetryHandler h = new RetryHandler(this.retriesAllowed, this);
                    final FTPClient lftp = ftp;
                    executeRetryable(h, new Retryable() {
                        public void execute() throws IOException {
                            doSiteCommand(lftp, FTP.this.siteCommand);
                        }
View Full Code Here

Examples of org.apache.tools.ant.util.RetryHandler

                if (!pd.exists()) {
                    pd.mkdirs();
                }
                bw = new BufferedWriter(new FileWriter(task.getListing()));
            }
            RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
            if (task.getAction() == FTPTask.RM_DIR) {
                // to remove directories, start by the end of the list
                // the trunk does not let itself be removed before the leaves
                for (int i = dsfiles.length - 1; i >= 0; i--) {
                    final String dsfile = dsfiles[i];
View Full Code Here

Examples of org.apache.tools.ant.util.RetryHandler

            // If an initial command was configured then send it.
            // Some FTP servers offer different modes of operation,
            // E.G. switching between a UNIX file system mode and
            // a legacy file system.
            if (task.getInitialSiteCommand() != null) {
                RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                        public void execute() throws IOException {
                            doSiteCommand(lftp, task.getInitialSiteCommand());
                        }
                    }, "initial site command: " + task.getInitialSiteCommand());
            }


            // For a unix ftp server you can set the default mask for all files
            // created.

            if (task.getUmask() != null) {
                RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                        public void execute() throws IOException {
                            doSiteCommand(lftp, "umask " + task.getUmask());
                        }
                    }, "umask " + task.getUmask());
            }

            // If the action is MK_DIR, then the specified remote
            // directory is the directory to create.

            if (task.getAction() == FTPTask.MK_DIR) {
                RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                        public void execute() throws IOException {
                            makeRemoteDir(lftp, task.getRemotedir());
                        }
                    }, task.getRemotedir());
            } else if (task.getAction() == FTPTask.SITE_CMD) {
                RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
                final FTPClient lftp = ftp;
                executeRetryable(h, new Retryable() {
                        public void execute() throws IOException {
                            doSiteCommand(lftp, task.getSiteCommand());
                        }
View Full Code Here

Examples of org.apache.tools.ant.util.RetryHandler

                if (!pd.exists()) {
                    pd.mkdirs();
                }
                bw = new BufferedWriter(new FileWriter(listing));
            }
            RetryHandler h = new RetryHandler(this.retriesAllowed, this);
            if (action == RM_DIR) {
                // to remove directories, start by the end of the list
                // the trunk does not let itself be removed before the leaves
                for (int i = dsfiles.length - 1; i >= 0; i--) {
                    final String dsfile = dsfiles[i];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.