/** * There should only be one ServiceContext per openmrs (java virtual machine). This method * should be used when wanting to fetch the service context Note: The ServiceContext shouldn't * be used independently. All calls should go through the Context * * @return This VM's current ServiceContext. * @see org.openmrs.api.context.Context */ public static ServiceContext getInstance() { if (ServiceContextHolder.instance == null) { ServiceContextHolder.instance = new ServiceContext(); } return ServiceContextHolder.instance; }