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

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

Introduction

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

Prototype

public void setDisplayName(String displayName) 

Source Link

Document

Set 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
 * //from  w  w w . j av  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();
}