public static SenBotContext getSenBotContext() {
        if (senBotContextSingleton == null) {
            //synchronize instantiation
            synchronized (SenBotContext.class) {
                //another null check as two threads might have passed the first null check, wait in line on the 
                //synchronized block and both instantiate the singleton.
                if (senBotContextSingleton == null) {
                	String springConfigLocation = System.getProperty(SPRING_CONFIG_LOCATION);
                	if(springConfigLocation == null) {
                		springConfigLocation = "classpath*:cucumber.xml";
                	}
                	
                    context = new ClassPathXmlApplicationContext(new String[]{springConfigLocation});
                    senBotContextSingleton = context.getBean(SenBotContext.class);
                }
            }
        }
        return senBotContextSingleton;
    }
public static SenBotContext getSenBotContext ( ) { if ( senBotContextSingleton == null ) { synchronized ( SenBotContext . class ) { if ( senBotContextSingleton == null ) { String springConfigLocation = System . getProperty ( SPRING_CONFIG_LOCATION ) ; if ( springConfigLocation == null ) { springConfigLocation = "classpath*:cucumber.xml" ; } context = new ClassPathXmlApplicationContext ( new String [ ] { springConfigLocation } ) ; senBotContextSingleton = context . getBean ( SenBotContext . class ) ; } } } return senBotContextSingleton ; }
Obtain the {@link SenBotContext} singleton. Instantiate it if not yet available
@return SenBotContext