|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
|
ActiveListService |
getActiveListService()
Gets the ActiveListService used in the context. |
|
AdministrationService |
getAdministrationService()
|
|
AlertService |
getAlertService()
|
|
ArdenService |
getArdenService()
|
|
CohortService |
getCohortService()
|
|
ConceptService |
getConceptService()
|
|
DataSetService |
getDataSetService()
Deprecated. see reportingcompatibility module |
|
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()
|
|
MessageSourceService |
getMessageSourceService()
Gets the MessageSourceService used in the context. |
|
ObsService |
getObsService()
|
|
OrderService |
getOrderService()
|
|
PatientService |
getPatientService()
|
|
PatientSetService |
getPatientSetService()
|
|
PersonService |
getPersonService()
|
|
ProgramWorkflowService |
getProgramWorkflowService()
|
|
|
getRegisteredComponents(java.lang.Class<T> type)
Retrieves all Beans which have been registered in the Spring ApplicationContext that
match the given object type (including subclasses). |
|
ReportObjectService |
getReportObjectService()
Deprecated. see reportingcompatibility module |
|
ReportService |
getReportService()
Deprecated. see reportingcompatibility module |
|
SchedulerService |
getSchedulerService()
|
|
SerializationService |
getSerializationService()
|
|
|
getService(java.lang.Class<? extends T> 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 |
setActiveListService(ActiveListService activeListService)
Sets the ActiveListService used in the context |
|
void |
setAdministrationService(AdministrationService administrationService)
|
|
void |
setAlertService(AlertService alertService)
|
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
|
void |
setArdenService(ArdenService ardenService)
|
|
void |
setCohortService(CohortService cs)
|
|
void |
setConceptService(ConceptService conceptService)
|
|
void |
setDataSetService(DataSetService dataSetService)
Deprecated. see reportingcompatibility module |
|
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 |
setMessageSourceService(MessageSourceService messageSourceService)
Sets the MessageSourceService used in the context. |
|
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 interfaceparams [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)
Deprecated. see reportingcompatibility module |
|
void |
setReportService(ReportService reportService)
Deprecated. see reportingcompatibility module |
|
void |
setSchedulerService(SchedulerService schedulerService)
Set the scheduler service. |
|
void |
setSerializationService(SerializationService serializationService)
|
|
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()
Context
public static void destroyInstance()
public EncounterService getEncounterService()
public LocationService getLocationService()
public ObsService getObsService()
public PatientSetService getPatientSetService()
public CohortService getCohortService()
public void setCohortService(CohortService cs)
cs
- cohort related servicepublic OrderService getOrderService()
public FormService getFormService()
@Deprecated public ReportObjectService getReportObjectService()
public SerializationService getSerializationService()
@Deprecated public ReportService getReportService()
public AdministrationService getAdministrationService()
public ProgramWorkflowService getProgramWorkflowService()
public ArdenService getArdenService()
public LogicService getLogicService()
public SchedulerService getSchedulerService()
public void setSchedulerService(SchedulerService schedulerService)
schedulerService
- 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)
messageService
- 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 set@Deprecated public void setReportObjectService(ReportObjectService reportObjectService)
reportObjectService
- the reportObjectService to set@Deprecated public void setReportService(ReportService reportService)
reportService
- public void setSerializationService(SerializationService serializationService)
serializationService
- @Deprecated public void setDataSetService(DataSetService dataSetService)
dataSetService
- @Deprecated 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 setpublic MessageSourceService getMessageSourceService()
public void setMessageSourceService(MessageSourceService messageSourceService)
messageSourceService
- the MessageSourceService to usepublic ActiveListService getActiveListService()
public void setActiveListService(ActiveListService activeListService)
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 <T> T getService(java.lang.Class<? extends T> cls)
cls
cls
-
cls
classpublic 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 interfaceparams
[1] = service instance
params
- 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()
public <T> java.util.List<T> getRegisteredComponents(java.lang.Class<T> type)
ApplicationContext
that
match the given object type (including subclasses).
NOTE: This method introspects top-level beans only. It does not check nested beans which might match the specified type as well.
type
- the type of Bean to retrieve from the Spring ApplicationContext
ListableBeanFactory.getBeansOfType(Class)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
applicationContext
- the applicationContext to set
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |