Codota Logo
Poller
Code IndexAdd Codota to your IDE (free)

How to use
Poller
in
org.springframework.batch.poller

Best Java code snippets using org.springframework.batch.poller.Poller (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-batch

Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);
origin: spring-projects/spring-batch

@Test
public void testWithError() throws Exception {
  Callable<String> callback = new Callable<String>() {
    @Override
    public String call() throws Exception {
      Set<String> executions = new HashSet<>(repository);
      if (executions.isEmpty()) {
        return null;
      }
      throw new RuntimeException("Expected");
    }
  };
  Poller<String> poller = new DirectPoller<>(100L);
  sleepAndCreateStringInBackground(500L);
  try {
    String value = poller.poll(callback).get(1000L, TimeUnit.MILLISECONDS);
    assertEquals(null, value);
    fail("Expected ExecutionException");
  }
  catch (ExecutionException e) {
    assertEquals("Expected", e.getCause().getMessage());
  }
}
origin: spring-cloud/spring-cloud-task

Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);
origin: org.springframework.cloud/spring-cloud-task-batch

Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);
org.springframework.batch.pollerPoller

Javadoc

Interface for polling a Callable instance provided by the user. Use when you need to put something in the background (e.g. a remote invocation) and wait for the result, e.g.
 
Poller<Result> poller = ... 
final long id = remoteService.execute(); // do something remotely 
Future<Result> future = poller.poll(new Callable<Result> { 
public Object call() { 
// Look for the result (null if not ready) 
return remoteService.get(id); 
} 
}); 
Result result = future.get(1000L, TimeUnit.MILLISECONDS); 

Most used methods

  • poll

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getContentResolver (Context)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now