diff options
Diffstat (limited to 'cpp/src/Freeze/StrategyI.cpp')
-rw-r--r-- | cpp/src/Freeze/StrategyI.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/cpp/src/Freeze/StrategyI.cpp b/cpp/src/Freeze/StrategyI.cpp index a9156955df8..b6034c04061 100644 --- a/cpp/src/Freeze/StrategyI.cpp +++ b/cpp/src/Freeze/StrategyI.cpp @@ -44,6 +44,7 @@ Freeze::EvictionStrategyI::evictedObject(const ObjectStorePtr& store, // CookiePtr c = CookiePtr::dynamicCast(cookie); assert(c); + if(c->mutated) { store->save(ident, servant); @@ -51,6 +52,25 @@ Freeze::EvictionStrategyI::evictedObject(const ObjectStorePtr& store, } } + +void +Freeze::EvictionStrategyI::savedObject(const ObjectStorePtr& store, + const Identity& ident, + const ObjectPtr& servant, + const LocalObjectPtr& cookie, + Ice::Int usageCount) +{ + assert(usageCount > 0); + + if(usageCount == 1) + { + CookiePtr c = CookiePtr::dynamicCast(cookie); + assert(c); + c->mutated = false; + } +} + + void Freeze::EvictionStrategyI::preOperation(const ObjectStorePtr& store, const Identity& ident, @@ -100,9 +120,9 @@ Freeze::IdleStrategyI::destroyedObject(const Identity& ident, const LocalObjectP void Freeze::IdleStrategyI::evictedObject(const ObjectStorePtr& store, - const Identity& ident, - const ObjectPtr& servant, - const LocalObjectPtr& cookie) + const Identity& ident, + const ObjectPtr& servant, + const LocalObjectPtr& cookie) { // // The object must reach the idle state in order for it to be @@ -115,6 +135,25 @@ Freeze::IdleStrategyI::evictedObject(const ObjectStorePtr& store, } void +Freeze::IdleStrategyI::savedObject(const ObjectStorePtr& store, + const Identity& ident, + const ObjectPtr& servant, + const LocalObjectPtr& cookie, + Ice::Int usageCount) +{ + assert(usageCount > 0); + + if(usageCount == 1) + { + CookiePtr c = CookiePtr::dynamicCast(cookie); + assert(c); + c->mutated = false; + } +} + + + +void Freeze::IdleStrategyI::preOperation(const ObjectStorePtr& store, const Identity& ident, const ObjectPtr& servant, |