Example usage for org.springframework.context.support FileSystemXmlApplicationContext getDisplayName

List of usage examples for org.springframework.context.support FileSystemXmlApplicationContext getDisplayName

Introduction

In this page you can find the example usage for org.springframework.context.support FileSystemXmlApplicationContext getDisplayName.

Prototype

@Override
public String getDisplayName() 

Source Link

Document

Return a friendly name for this context.

Usage

From source file:org.hbird.business.core.Starter.java

/**
 * Method to read the XML assembly file and run the main
 * // w w w  . j  a v  a 2 s . c o m
 * @throws Exception
 */
@SuppressWarnings("resource")
protected void boot() throws Exception {
    LOG.info("Starting Hummingbird based system.");

    Main main = new Main();
    main.enableHangupSupport();

    /* Read the configuration file as the first argument. If not set, then we try the default name. */
    String assemblyFile = System.getProperty("hbird.assembly") == null ? "classpath:main.xml"
            : System.getProperty("hbird.assembly");

    LOG.info("Reading assembly file '{}'", assemblyFile);

    FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(new String[] { assemblyFile },
            false);
    context.setDisplayName(CONTEXT_NAME + "-" + (++counter));
    LOG.info("Created Spring AppicationContext '{}'", context.getDisplayName());
    context.refresh();
    main.run();
}