Search in sources :

Example 1 with SpringApplicationContext

use of com.hummer.core.SpringApplicationContext in project hummer-framework by hummer-team.

the class HummerApplicationContextInit method initialize.

/**
 * Initialize the given application context.
 *
 * @param applicationContext the application to configure
 */
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
    final long start = System.currentTimeMillis();
    // set application context
    SpringApplicationContext context = new SpringApplicationContext();
    context.setApplicationContext(applicationContext);
    PropertiesContainer.loadPropertyData(applicationContext.getEnvironment());
    LOGGER.info("......hummer init spring context container done,cost {} ms.....", System.currentTimeMillis() - start);
}
Also used : SpringApplicationContext(com.hummer.core.SpringApplicationContext)

Example 2 with SpringApplicationContext

use of com.hummer.core.SpringApplicationContext in project hummer-framework by hummer-team.

the class SpringStarterListener method onApplicationEvent.

@Override
public void onApplicationEvent(ApplicationPreparedEvent event) {
    if (SpringApplicationContext.getApplicationContext() == null) {
        // init application context
        SpringApplicationContext context = new SpringApplicationContext();
        context.setApplicationContext(event.getApplicationContext());
    }
    LOGGER.info("SpringContext load success,property configuration load success,now begin create bean");
    // load property configuration
    PropertiesContainer.loadPropertyData(event.getApplicationContext().getEnvironment());
    if (!isLoad) {
        executeCustomizeContextInit(event.getApplicationContext());
        isLoad = true;
    }
}
Also used : SpringApplicationContext(com.hummer.core.SpringApplicationContext)

Aggregations

SpringApplicationContext (com.hummer.core.SpringApplicationContext)2