Codota Logo
JobContext.close
Code IndexAdd Codota to your IDE (free)

How to use
close
method
in
org.springframework.batch.core.scope.context.JobContext

Best Java code snippets using org.springframework.batch.core.scope.context.JobContext.close (Showing top 9 results out of 315)

  • Common ways to obtain JobContext
private void myMethod () {
JobContext j =
  • Codota IconJobSynchronizationManager.register(JobExecution)
  • Codota IconJobSynchronizationManager.getContext()
  • Codota IconJobExecution jobExecution;new JobContext(jobExecution)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-batch

  @Override
  protected void close(JobContext context) {
    context.close();
  }
};
origin: spring-projects/spring-batch

@Test
public void testDestructionCallbackMissingAttribute() throws Exception {
  context.registerDestructionCallback("foo", new Runnable() {
    @Override
    public void run() {
      list.add("bar");
    }
  });
  context.close();
  // Yes the callback should be called even if the attribute is missing -
  // for inner beans
  assertEquals(1, list.size());
}
origin: spring-projects/spring-batch

@Test
public void testDestructionCallbackSunnyDay() throws Exception {
  context.setAttribute("foo", "FOO");
  context.registerDestructionCallback("foo", new Runnable() {
    @Override
    public void run() {
      list.add("bar");
    }
  });
  context.close();
  assertEquals(1, list.size());
  assertEquals("bar", list.get(0));
}
origin: spring-projects/spring-batch

@Test
public void testRegisterDestructionCallback() {
  final List<String> list = new ArrayList<>();
  context.setAttribute("foo", "bar");
  scope.registerDestructionCallback("foo", new Runnable() {
    @Override
    public void run() {
      list.add("foo");
    }
  });
  assertEquals(0, list.size());
  // When the context is closed, provided the attribute exists the
  // callback is called...
  context.close();
  assertEquals(1, list.size());
}
origin: spring-projects/spring-batch

@Test
public void testRegisterAnotherDestructionCallback() {
  final List<String> list = new ArrayList<>();
  context.setAttribute("foo", "bar");
  scope.registerDestructionCallback("foo", new Runnable() {
    @Override
    public void run() {
      list.add("foo");
    }
  });
  scope.registerDestructionCallback("foo", new Runnable() {
    @Override
    public void run() {
      list.add("bar");
    }
  });
  assertEquals(0, list.size());
  // When the context is closed, provided the attribute exists the
  // callback is called...
  context.close();
  assertEquals(2, list.size());
}
origin: spring-projects/spring-batch

context.close();
fail("Expected RuntimeException");
origin: org.springframework.batch/spring-batch-core

  @Override
  protected void close(JobContext context) {
    context.close();
  }
};
origin: apache/servicemix-bundles

  @Override
  protected void close(JobContext context) {
    context.close();
  }
};
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

  @Override
  protected void close(JobContext context) {
    context.close();
  }
};
org.springframework.batch.core.scope.contextJobContextclose

Javadoc

Clean up the context at the end of a step execution. Must be called once at the end of a step execution to honour the destruction callback contract from the StepScope.

Popular methods of JobContext

  • getJobExecutionContext
  • getJobParameters
  • <init>
  • getAttribute
  • getId
  • registerDestructionCallback
    Allow clients to register callbacks for clean up on close.
  • setAttribute
  • removeAttribute
    Override base class behaviour to ensure destruction callbacks are unregistered as well as the defaul
  • unregisterDestructionCallbacks
  • attributeNames
  • equals
    Extend the base class method to include the job execution itself as a key (i.e. two contexts are onl
  • getJobExecution
    The current JobExecution that is active in this context.
  • equals,
  • getJobExecution,
  • getJobName,
  • getSystemProperties,
  • hasAttribute

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • Kernel (java.awt.image)
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JComboBox (javax.swing)
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