Hi,
Start Tenant Flow Code sample should need to be changed in 4.2.0
documentation[1]. currently in the documentation its getting CarbonContext
from the PrivilegedCarbonContext.getCurrentContext().
getCurrentContext() is deprecated in the 4.2.0, no longer available in
4.3.0. This is fixed in 4.3.0 documentation[2]. It should need to be
changed to get from getThreadLocalCarbonContext().
try{
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext privilegedCarbonContext =
PrivilegedCarbonContext*.getCurrentContext();*
*change to* *->PrivilegedCarbonContext.getThreadLocalCarbonContext();*
privilegedCarbonContext.setTenantId(tenantId);
privilegedCarbonContext.setTenantDomain(tenantDomain);
// set other stuff like registry etc. if needed
doSomething();
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
[1] https://docs.wso2.com/display/Carbon420/CarbonContext+API
[2] https://docs.wso2.com/display/Carbon430/CarbonContext+API
--
Shashika Prabath Karunatilaka,
Software Engineer,
WSO2, Inc: http://wso2.com/
mobile : +94 77 7487792
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev