|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.api.context.ServiceContext
public class ServiceContext
Represents an OpenMRS Service Context, which returns the
services represented throughout the system.
This class should not be access directly, but rather used through the
Context class.
This class is essentially static and only one instance is kept because
this is fairly heavy-weight. Spring takes care of filling in the actual
service implementations via dependency injection. See the
/metadata/api/spring/applicationContext-service.xml file.
Module services are also accessed through this class. See
getService(Class)
Context| Method Summary | |
|---|---|
void |
addAdvice(java.lang.Class cls,
org.aopalliance.aop.Advice advice)
|
void |
addAdvisor(java.lang.Class cls,
org.springframework.aop.Advisor advisor)
|
static void |
destroyInstance()
Null out the current instance of the ServiceContext. |
void |
doneRefreshingContext()
Should be called right after any spring context refresh This wakes up all calls to getService that were waiting because startRefreshingContext was called |
AdministrationService |
getAdministrationService()
|
AlertService |
getAlertService()
|
ArdenService |
getArdenService()
|
CohortService |
getCohortService()
|
ConceptService |
getConceptService()
|
DataSetService |
getDataSetService()
|
EncounterService |
getEncounterService()
|
FormService |
getFormService()
|
HL7Service |
getHL7Service()
|
static ServiceContext |
getInstance()
There should only be one ServiceContext per openmrs (java virtual machine). |
LocationService |
getLocationService()
|
LogicService |
getLogicService()
|
MessageService |
getMessageService()
|
ObsService |
getObsService()
|
OrderService |
getOrderService()
|
PatientService |
getPatientService()
|
PatientSetService |
getPatientSetService()
|
PersonService |
getPersonService()
|
ProgramWorkflowService |
getProgramWorkflowService()
|
ReportObjectService |
getReportObjectService()
|
ReportService |
getReportService()
|
SchedulerService |
getSchedulerService()
|
java.lang.Object |
getService(java.lang.Class cls)
Returns the current proxy that is stored for the Class cls |
UserService |
getUserService()
|
boolean |
isRefreshingContext()
Returns true/false whether startRefreshingContext() has been called without a subsequent call to doneRefreshingContext() yet. |
void |
removeAdvice(java.lang.Class cls,
org.aopalliance.aop.Advice advice)
|
void |
removeAdvisor(java.lang.Class cls,
org.springframework.aop.Advisor advisor)
|
void |
setAdministrationService(AdministrationService administrationService)
|
void |
setAlertService(AlertService alertService)
|
void |
setArdenService(ArdenService ardenService)
|
void |
setCohortService(CohortService cs)
|
void |
setConceptService(ConceptService conceptService)
|
void |
setDataSetService(DataSetService dataSetService)
|
void |
setEncounterService(EncounterService encounterService)
|
void |
setFormService(FormService formService)
|
void |
setHl7Service(HL7Service hl7Service)
|
void |
setLocationService(LocationService locationService)
|
void |
setLogicService(LogicService logicService)
|
void |
setMessageService(MessageService messageService)
Sets the message service. |
void |
setModuleService(java.util.List<java.lang.Object> params)
Allow other services to be added to our service layer Classes will be found/loaded with the ModuleClassLoader params[0] = string representing the service interface
params[1] = service instance |
void |
setObsService(ObsService obsService)
|
void |
setOrderService(OrderService orderService)
|
void |
setPatientService(PatientService patientService)
|
void |
setPatientSetService(PatientSetService patientSetService)
|
void |
setPersonService(PersonService personService)
|
void |
setProgramWorkflowService(ProgramWorkflowService programWorkflowService)
|
void |
setReportObjectService(ReportObjectService reportObjectService)
|
void |
setReportService(ReportService reportService)
|
void |
setSchedulerService(SchedulerService schedulerService)
Set the scheduler service. |
void |
setService(java.lang.Class cls,
java.lang.Object classInstance)
Allow other services to be added to our service layer |
void |
setUserService(UserService userService)
|
void |
setUseSystemClassLoader(boolean useSystemClassLoader)
Set this service context to use the system class loader if the useSystemClassLoader is set to true. |
void |
startRefreshingContext()
Should be called right before any spring context refresh This forces all calls to getService to wait until doneRefreshingContext is called |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ServiceContext getInstance()
Contextpublic static void destroyInstance()
public EncounterService getEncounterService()
public LocationService getLocationService()
public ObsService getObsService()
public PatientSetService getPatientSetService()
public CohortService getCohortService()
public void setCohortService(CohortService cs)
cohort - related servicepublic OrderService getOrderService()
public FormService getFormService()
public ReportObjectService getReportObjectService()
public ReportService getReportService()
public AdministrationService getAdministrationService()
public ProgramWorkflowService getProgramWorkflowService()
public ArdenService getArdenService()
public LogicService getLogicService()
public SchedulerService getSchedulerService()
public void setSchedulerService(SchedulerService schedulerService)
service - public AlertService getAlertService()
public void setAlertService(AlertService alertService)
alertService - public void setProgramWorkflowService(ProgramWorkflowService programWorkflowService)
programWorkflowService - public void setArdenService(ArdenService ardenService)
ardenService - public void setLogicService(LogicService logicService)
logicService - public MessageService getMessageService()
public void setMessageService(MessageService messageService)
service - public HL7Service getHL7Service()
public void setHl7Service(HL7Service hl7Service)
hl7Service - the hl7Service to setpublic void setAdministrationService(AdministrationService administrationService)
administrationService - the administrationService to setpublic void setEncounterService(EncounterService encounterService)
encounterService - the encounterService to setpublic void setLocationService(LocationService locationService)
locationService - the LocationService to setpublic void setFormService(FormService formService)
formService - the formService to setpublic void setObsService(ObsService obsService)
obsService - the obsService to setpublic void setOrderService(OrderService orderService)
orderService - the orderService to setpublic void setPatientSetService(PatientSetService patientSetService)
patientSetService - the patientSetService to setpublic void setReportObjectService(ReportObjectService reportObjectService)
reportObjectService - the reportObjectService to setpublic void setReportService(ReportService reportService)
reportService - public void setDataSetService(DataSetService dataSetService)
dataSetService - public DataSetService getDataSetService()
public PatientService getPatientService()
public void setPatientService(PatientService patientService)
patientService - the patientService to setpublic PersonService getPersonService()
public void setPersonService(PersonService personService)
personService - the personService to setpublic ConceptService getConceptService()
public void setConceptService(ConceptService conceptService)
conceptService - the conceptService to setpublic UserService getUserService()
public void setUserService(UserService userService)
userService - the userService to set
public void addAdvisor(java.lang.Class cls,
org.springframework.aop.Advisor advisor)
cls - advisor -
public void addAdvice(java.lang.Class cls,
org.aopalliance.aop.Advice advice)
cls - advice -
public void removeAdvisor(java.lang.Class cls,
org.springframework.aop.Advisor advisor)
cls - advisor -
public void removeAdvice(java.lang.Class cls,
org.aopalliance.aop.Advice advice)
cls - advice - public java.lang.Object getService(java.lang.Class cls)
cls
cls -
cls class
public void setService(java.lang.Class cls,
java.lang.Object classInstance)
cls - Interface to proxyclassInstance - the actual instance of the cls interfacepublic void setModuleService(java.util.List<java.lang.Object> params)
params[0] = string representing the service interface
params[1] = service instance
list - list of parameterspublic void setUseSystemClassLoader(boolean useSystemClassLoader)
useSystemClassLoader is set to true. If false, the openmrs
class loader is used to load module services
useSystemClassLoader - true/false whether to use the system class loaderpublic void startRefreshingContext()
doneRefreshingContext is called
public void doneRefreshingContext()
startRefreshingContext was called
public boolean isRefreshingContext()
|
OpenMRS-trunk | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||