webservices/wscore/src/senxmldao.cpp
branchRCL_3
changeset 37 1adb97a15c2f
parent 36 c5fabff9b552
child 42 9db35237e6aa
equal deleted inserted replaced
36:c5fabff9b552 37:1adb97a15c2f
  1710         // called, which means that such provider may be removed from
  1710         // called, which means that such provider may be removed from
  1711         // the map and destroyed. Otherwise, such hostlets are destroyed,
  1711         // the map and destroyed. Otherwise, such hostlets are destroyed,
  1712         // when server (main thread) goes down.
  1712         // when server (main thread) goes down.
  1713         
  1713         
  1714         pLookupInfo = NULL;
  1714         pLookupInfo = NULL;
  1715         if(pHostlet->Threadsafe())
  1715         if(pHostlet && pHostlet->Threadsafe())
  1716             {
  1716             {
  1717             TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Adding new threadsafe, unsharable provider into cache.");
  1717             TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Adding new threadsafe, unsharable provider into cache.");
  1718             pLookupInfo = CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId);
  1718             pLookupInfo = CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId);
  1719             }
  1719             }
  1720         else
  1720         else
  1721             {
  1721             {
  1722             // Any non-threadsafe provider should compare whether consumer ID
  1722             // Any non-threadsafe provider should compare whether consumer ID
  1723             // is equal. The thread ID is irrelevant in the matching.
  1723             // is equal. The thread ID is irrelevant in the matching.
  1724             TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Adding new non-threadsafe, unsharable provider into cache.");
  1724             TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Adding new non-threadsafe, unsharable provider into cache.");
  1725             pLookupInfo = CSenHostletLookupInfo::NewLC(KNullDesC, aReqConsumerId);
  1725             pLookupInfo = CSenHostletLookupInfo::NewLC(KNullDesC, aReqConsumerId);
  1726             }
  1726             }
  1727 
  1727 
  1728         pLookupInfo->IncrementLookupCount();
  1728         pLookupInfo->IncrementLookupCount();
  1729         append = iUnsharableProviders.Append(pLookupInfo, pHostlet);
  1729         append = iUnsharableProviders.Append(pLookupInfo, pHostlet);
  1730         if(append==KErrNone)
  1730         if(append==KErrNone)
  1731             {
  1731             {
  1732             TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount()));
  1732             TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount()));
  1733             CleanupStack::Pop(2); // pLookupInfo, pHostlet
  1733             CleanupStack::Pop(2); // pLookupInfo, pHostlet
  1734             }
  1734             }
  1735         else
  1735         else
  1736             {
  1736             {
  1737             TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- iUnsharableProviders.Append failed."); // OOM case
  1737             TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- iUnsharableProviders.Append failed."); // OOM case
  1931     delete ipLookupCount;
  1931     delete ipLookupCount;
  1932     }
  1932     }
  1933 
  1933 
  1934 TPtrC CSenHostletLookupInfo::ThreadId() const
  1934 TPtrC CSenHostletLookupInfo::ThreadId() const
  1935     {
  1935     {
  1936     return *ipFullThreadName;
  1936     if(ipFullThreadName)
       
  1937     	{
       
  1938     	return *ipFullThreadName;
       
  1939     	}
       
  1940     else
       
  1941     	{
       
  1942     	return KNullDesC();
       
  1943     	}
  1937     }
  1944     }
  1938 
  1945 
  1939 TPtrC8 CSenHostletLookupInfo::ConsumerId() const
  1946 TPtrC8 CSenHostletLookupInfo::ConsumerId() const
  1940     {
  1947     {
  1941     return *ipUniqueConsumerId;
  1948     if(ipUniqueConsumerId)
       
  1949     	{
       
  1950     	return *ipUniqueConsumerId;
       
  1951     	}
       
  1952     else
       
  1953     	{
       
  1954     	return KNullDesC8();
       
  1955     	}	
  1942     }
  1956     }
  1943 
  1957 
  1944 
  1958 
  1945 TInt CSenHostletLookupInfo::LookupCount() const
  1959 TInt CSenHostletLookupInfo::LookupCount() const
  1946     {
  1960     {
  1958     }
  1972     }
  1959 
  1973 
  1960 
  1974 
  1961 TBool CSenHostletLookupInfo::operator==(const CSenHostletLookupInfo& aHostletRequestor)
  1975 TBool CSenHostletLookupInfo::operator==(const CSenHostletLookupInfo& aHostletRequestor)
  1962     {
  1976     {
  1963     return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName)
  1977     if(ipFullThreadName && ipUniqueConsumerId)
       
  1978     	{
       
  1979     	return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName)
  1964             && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
  1980             && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
  1965     
  1981     	}
       
  1982     else
       
  1983     	{
       
  1984     	return EFalse;
       
  1985     	}	
  1966     //    return (aHostletRequestor.ThreadId() == *ipFullThreadName
  1986     //    return (aHostletRequestor.ThreadId() == *ipFullThreadName
  1967 //            && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
  1987 //            && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
  1968     }
  1988     }
  1969 
  1989 
  1970 
  1990