Skip to content

Modify to use the ConfigurableApplicationContext in reference document #796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/asciidoc/core-beans.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3212,19 +3212,19 @@ singleton beans so that all resources are released. Of course, you must still co
and implement these destroy callbacks correctly.

To register a shutdown hook, you call the `registerShutdownHook()` method that is
declared on the `AbstractApplicationContext` class:
declared on the `ConfigurableApplicationContext` interface:

[source,java,indent=0]
[subs="verbatim,quotes"]
----
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public final class Boot {

public static void main(final String[] args) throws Exception {

AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
new String []{"beans.xml"});

// add a shutdown hook for the above context...
Expand Down