Tabnine Logo
JobContext.close
Code IndexAdd Tabnine 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)

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

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • JButton (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now