00001 /* 00002 * Copyright(C) OASIS(R) 2006,2010. All Rights Reserved. 00003 * OASIS trademark, IPR and other policies apply. 00004 */ 00005 00013 #ifndef _oasis_sca_ComponentContext_h_ 00014 #define _oasis_sca_ComponentContext_h_ 00015 00016 #include "oasis/sca/ServiceReference.h" 00017 #include "oasis/sca/ServiceProxy.h" 00018 #include "commonj/sdo/sdo.h" 00019 #include <string> 00020 #include <vector> 00021 00022 namespace oasis { 00026 namespace sca { 00027 00028 class ComponentContext; 00032 typedef RefCountingPointer<ComponentContext> ComponentContextPtr; 00033 00037 class ComponentContext { 00038 public: 00039 00044 static ComponentContextPtr getCurrent(); 00045 00046 00051 virtual std::string getURI() const = 0; 00052 00053 00054 00062 virtual ServiceProxyPtr getService(const std::string& referenceName) const = 0; 00063 00064 00071 virtual std::vector<ServiceProxyPtr> getServices(const std::string& referenceName) const = 0; 00072 00073 00074 00082 virtual ServiceReferencePtr getServiceReference(const std::string& referenceName) const = 0; 00083 00084 00091 virtual std::vector<ServiceReferencePtr> getServiceReferences(const std::string& referenceName) const = 0; 00092 00093 00094 00099 virtual commonj::sdo::DataObjectPtr getProperties() const = 0; 00100 00101 00107 virtual commonj::sdo::DataFactoryPtr getDataFactory() const = 0; 00108 00109 00110 00116 virtual ServiceReferencePtr getSelfReference() const = 0; 00117 00118 00124 virtual ServiceReferencePtr getSelfReference(const std::string& serviceName)const = 0; 00125 }; 00126 00127 } // namespace sca 00128 } // namespace oasis 00129 00130 #endif /* _oasis_sca_ComponentContext_h_ */