Created
November 22, 2013 17:10
-
-
Save jasoet/7603423 to your computer and use it in GitHub Desktop.
ApplicationContext Singleton Provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.support.ClassPathXmlApplicationContext; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: Deny Prasetyo | |
* Date: 4/2/13 | |
* Time: 11:00 PM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
public class ApplicationContextProvider { | |
private static ApplicationContextProvider staticObject = null; | |
private ApplicationContext applicationContext; | |
private ApplicationContextProvider() { | |
applicationContext = new ClassPathXmlApplicationContext("classpath*:META-INF/spring/**/applicationContext*.xml"); | |
} | |
public static ApplicationContextProvider getInstance() { | |
if (staticObject == null) { | |
staticObject = new ApplicationContextProvider(); | |
} | |
return staticObject; | |
} | |
public ApplicationContext getApplicationContext() { | |
return applicationContext; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment