Good work Hung.
Ack from me.
Code reviewed  and functiontested (immomtest/immoitest)

/AndersBj

Hung Nguyen wrote:
>  osaf/services/saf/immsv/immnd/ImmModel.cc |  16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
>
> When the implementer transiently detaches, cached values of cached RTAs are 
> still available for Object Search API and Object Access API.
> The timeout is hard-coded to 6s (DEFAULT_TIMEOUT_SEC).
>
> diff --git a/osaf/services/saf/immsv/immnd/ImmModel.cc 
> b/osaf/services/saf/immsv/immnd/ImmModel.cc
> --- a/osaf/services/saf/immsv/immnd/ImmModel.cc
> +++ b/osaf/services/saf/immsv/immnd/ImmModel.cc
> @@ -9821,6 +9821,7 @@ ImmModel::accessorGet(const ImmsvOmSearc
>      ObjectInfo* obj = NULL;
>      bool implNotSet = true;
>      ImmAttrValueMap::iterator j;
> +    ImplementerEvtMap::iterator iem;
>      int matchedAttributes=0;
>      int soughtAttributes=0;
>      SaImmSearchOptionsT notAllowedOptions = 0LL;
> @@ -9970,12 +9971,19 @@ ImmModel::accessorGet(const ImmsvOmSearc
>                  checkAttribute = true;
>              } else {
>                  //There is no implementer
> +                iem = sImplDetachTime.find(obj->mImplementer);
>                  if((k->second->mFlags & SA_IMM_ATTR_PERSISTENT) &&
>                      !(j->second->empty())) {
>                      op.addAttrValue(*j->second);
>                      checkAttribute = true;
>                      //Persistent rt attributes still accessible
>                      //If they have been given any value
> +                } else if ((k->second->mFlags & SA_IMM_ATTR_CACHED) &&
> +                    (iem != sImplDetachTime.end()) &&
> +                    !(j->second->empty())) {
> +                    //The attribute is cached and the OI is transiently 
> detached
> +                    op.addAttrValue(*j->second);
> +                    checkAttribute = true;
>                  } else {
>                      checkAttribute = false;
>                  }
> @@ -10147,6 +10155,7 @@ ImmModel::searchInitialize(ImmsvOmSearch
>      ObjectInfo* obj = NULL;
>      ObjectMap::iterator omi;
>      ObjectSet::iterator osi;
> +    ImplementerEvtMap::iterator iem;
>      bool noDanglingSearch = req->searchOptions & 
> SA_IMM_SEARCH_NO_DANGLING_DEPENDENTS;
>      ObjectInfo* refObj = NULL;
>      ObjectMMap::iterator ommi = sReverseRefsNoDanglingMMap.end();
> @@ -10521,6 +10530,7 @@ ImmModel::searchInitialize(ImmsvOmSearch
>                                      checkAttribute = true;
>                                  } else {
>                                      //There is no implementer
> +                                    iem = 
> sImplDetachTime.find(obj->mImplementer);
>                                      if(!(j->second->empty())
>                                          && (k->second->mFlags & 
>                                              SA_IMM_ATTR_PERSISTENT ||
> @@ -10535,6 +10545,12 @@ ImmModel::searchInitialize(ImmsvOmSearch
>                                          //is no implementer currently. 
>                                          op.addAttrValue(*j->second);
>                                          checkAttribute = true;
> +                                    } else if ((k->second->mFlags & 
> SA_IMM_ATTR_CACHED) &&
> +                                        (iem != sImplDetachTime.end()) &&
> +                                        !(j->second->empty())) {
> +                                        //The attribute is cached and the OI 
> is transiently detached
> +                                        op.addAttrValue(*j->second);
> +                                        checkAttribute = true;
>                                      } else {
>                                          checkAttribute = false;
>                                      }
>   


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to