All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.spotnext.spring.web.controller.AbstractBaseController Maven / Gradle / Ivy

There is a newer version: 1.0.21-BETA-20190513
Show newest version
package io.spotnext.spring.web.controller;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import io.spotnext.core.infrastructure.service.LoggingService;
import io.spotnext.core.infrastructure.support.spring.Registry;

/**
 * 

Abstract AbstractBaseController class.

* * @author mojo2012 * @version 1.0 * @since 1.0 */ public abstract class AbstractBaseController implements ApplicationContextAware { private ApplicationContext applicationContext; @Autowired protected LoggingService loggingService; /** {@inheritDoc} */ @Override public void setApplicationContext(final ApplicationContext context) throws BeansException { this.applicationContext = context; } /** *

getWebApplicationContext.

* * @return a {@link org.springframework.context.ApplicationContext} object. */ public ApplicationContext getWebApplicationContext() { return this.applicationContext; } protected T getBean(final Class beanType) { return Registry.getApplicationContext().getBean(beanType); } protected T getBean(final Class beanType, final String beanName) { return Registry.getApplicationContext().getBean(beanName, beanType); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy