Danesh, Sorry, but you are only extracting a portion of your code. Would you mind sharing the full code please? The CurrentSession is a data structure intended for very internal use within the repository and it only works (or makes sense) if it is used in such a way.
Thanks, Senaka. On Thu, Feb 12, 2015 at 12:49 PM, Danesh Kuruppu <[email protected]> wrote: > Hi all, > I am doing some improvements for the CacheBackRegistry in carbon 4.1.0. > There I need to spawn new thread and inside the thread, I need to get > resource from registry. For that we need to set session parameters to call > the registry. In registry.core, current session parameters are retrieved > from CurrentSession class [1] > > 1. http://sr4.us1.wso2.com:9000/sonar/resource/index/341632?tab=source > > Is it correct to set session parameters like below. > > public void run() { >> try { >> >> >> * CurrentSession.setTenantId(tenantID); >> CurrentSession.setUser(username); >> CurrentSession.setUserRealm(userRealm);* >> >> Resource resource = registry.get(path); >> >> } catch (RegistryException exception) { >> > ......... >> > } >> } >> > > > Please advice. > Thanks > -- > > Danesh Kuruppu > Software Engineer > WSO2 Inc, > Mobile: +94 (77) 1690552 > -- *[image: http://wso2.com] <http://wso2.com>Senaka Fernando* Solutions Architect; WSO2 Inc.; http://wso2.com *Member; Apache Software Foundation; http://apache.org <http://apache.org>E-mail: senaka AT wso2.com <http://wso2.com>**P: +1 408 754 7388 <%2B1%20408%20754%207388>; ext: 51736*; *M: +44 782 741 1966 <%2B44%20782%20741%201966>Linked-In: http://linkedin.com/in/senakafernando <http://linkedin.com/in/senakafernando>*Lean . Enterprise . Middleware
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
