Freeze Slice API Reference
Evictor.ice
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 #pragma once
6 
7 [["cpp:header-ext:h", "cpp:dll-export:FREEZE_API"]]
8 
9 #include <Ice/ObjectAdapterF.ice>
10 #include <Ice/ServantLocator.ice>
11 #include <Ice/Identity.ice>
12 #include <Freeze/Exception.ice>
13 
14 module Freeze
15 {
16 
25 local interface ServantInitializer
26 {
48  void initialize(Ice::ObjectAdapter adapter, Ice::Identity identity, string facet, Object servant);
49 }
50 
56 local exception NoSuchElementException
57 {
58 }
59 
70 local interface EvictorIterator
71 {
83  bool hasNext();
84 
98 }
99 
106 {
107 }
108 
123 local interface Evictor extends Ice::ServantLocator
124 {
125 
146  void setSize(int sz);
147 
160  int getSize();
161 
188  Object* add(Object servant, Ice::Identity id);
189 
220  Object* addFacet(Object servant, Ice::Identity id, string facet);
221 
222  //
223  // Note: no UUID operation as we don't know the category or
224  // categories this evictor was registered with.
225  //
226 
247  Object remove(Ice::Identity id);
248 
274  Object removeFacet(Ice::Identity id, string facet);
275 
293 
313  bool hasFacet(Ice::Identity id, string facet);
314 
332  EvictorIterator getIterator(string facet, int batchSize);
333 }
334 
335 }
Ice::ObjectAdapter
Freeze::Evictor::hasFacet
bool hasFacet(Ice::Identity id, string facet)
Like hasObject, but with a facet.
Freeze::EvictorIterator::hasNext
bool hasNext()
Determines if the iteration has more elements.
Freeze::EvictorIterator
An iterator for the objects managed by the evictor.
Definition: Evictor.ice:71
Freeze::Evictor::hasObject
bool hasObject(Ice::Identity id)
Returns true if the given identity is managed by the evictor with the default facet.
Freeze::Evictor::addFacet
Object * addFacet(Object servant, Ice::Identity id, string facet)
Like add, but with a facet.
Freeze::Evictor::getIterator
EvictorIterator getIterator(string facet, int batchSize)
Get an iterator for the identities managed by the evictor.
Freeze
Freeze provides automatic persistence for Ice servants.
Definition: BackgroundSaveEvictor.ice:12
Freeze::EvictorIterator::next
Ice::Identity next()
Obtains the next identity in the iteration.
Freeze::Evictor::add
Object * add(Object servant, Ice::Identity id)
Add a servant to this evictor.
Ice::ServantLocator
Freeze::ServantInitializer
A servant initializer provides the application with an opportunity to perform custom servant initiali...
Definition: Evictor.ice:26
Freeze::Evictor
An automatic Ice object persistence manager, based on the evictor pattern.
Definition: Evictor.ice:124
ObjectAdapterF.ice
Freeze::ServantInitializer::initialize
void initialize(Ice::ObjectAdapter adapter, Ice::Identity identity, string facet, Object servant)
Called whenever the evictor creates a new servant.
Identity.ice
Freeze::Evictor::removeFacet
Object removeFacet(Ice::Identity id, string facet)
Like remove, but with a facet.
ServantLocator.ice
Exception.ice
Freeze::Evictor::setSize
void setSize(int sz)
Set the size of the evictor's servant queue.
Ice::Identity
Freeze::Evictor::getSize
int getSize()
Get the size of the evictor's servant queue.
Freeze::NoSuchElementException
This exception is raised if there are no further elements in the iteration.
Definition: Evictor.ice:57
Freeze::EvictorDeactivatedException
This exception is raised if the evictor has been deactivated.
Definition: Evictor.ice:106