Freeze Slice API Reference
Operations | List of all members
Freeze::Evictor Local Interface Reference

An automatic Ice object persistence manager, based on the evictor pattern. More...

defined in <Freeze/Evictor.ice>

local interface Evictor extends Ice::ServantLocator { ... }

Inheritance diagram for Freeze::Evictor:
Inheritance graph
[legend]
Collaboration diagram for Freeze::Evictor:
Collaboration graph
[legend]

Operations

Object * add (Object servant, Ice::Identity id)
 Add a servant to this evictor. More...
 
Object * addFacet (Object servant, Ice::Identity id, string facet)
 Like add, but with a facet. More...
 
EvictorIterator getIterator (string facet, int batchSize)
 Get an iterator for the identities managed by the evictor. More...
 
int getSize ()
 Get the size of the evictor's servant queue. More...
 
bool hasFacet (Ice::Identity id, string facet)
 Like hasObject, but with a facet. More...
 
bool hasObject (Ice::Identity id)
 Returns true if the given identity is managed by the evictor with the default facet. More...
 
Object remove (Ice::Identity id)
 Permanently destroy an Ice object. More...
 
Object removeFacet (Ice::Identity id, string facet)
 Like remove, but with a facet. More...
 
void setSize (int sz)
 Set the size of the evictor's servant queue. More...
 
- Operations inherited from Ice::ServantLocator
void deactivate (string category)
 
void finished (Current curr,["swift:nonnull"] Object servant, LocalObject cookie)
 
Object locate (Current curr, out LocalObject cookie)
 

Detailed Description

An automatic Ice object persistence manager, based on the evictor pattern.

The evictor is a servant locator implementation that stores the persistent state of its objects in a database. Any number of objects can be registered with an evictor, but only a configurable number of servants are active at a time. These active servants reside in a queue; the least recently used servant in the queue is the first to be evicted when a new servant is activated.

See also
ServantInitializer

Operation Documentation

◆ add()

Object* add ( Object  servant,
Ice::Identity  id 
)

Add a servant to this evictor.

The state of the servant passed to this operation will be saved in the evictor's persistent store.

Parameters
servantThe servant to add.
idThe identity of the Ice object that is implemented by the servant.
Returns
A proxy that matches the given identity and this evictor's object adapter.
Exceptions
Ice.AlreadyRegisteredExceptionRaised if the evictor already has an object with this identity.
DatabaseExceptionRaised if a database failure occurred.
EvictorDeactivatedExceptionRaised if the evictor has been deactivated.
See also
addFacet
remove
removeFacet

◆ addFacet()

Object* addFacet ( Object  servant,
Ice::Identity  id,
string  facet 
)

Like add, but with a facet.

Calling add(servant, id) is equivalent to calling addFacet with an empty facet.

Parameters
servantThe servant to add.
idThe identity of the Ice object that is implemented by the servant.
facetThe facet. An empty facet means the default facet.
Returns
A proxy that matches the given identity and this evictor's object adapter.
Exceptions
Ice.AlreadyRegisteredExceptionRaised if the evictor already has an object with this identity.
DatabaseExceptionRaised if a database failure occurred.
EvictorDeactivatedExceptionRaised if the evictor has been deactivated.
See also
add
remove
removeFacet

◆ getIterator()

EvictorIterator getIterator ( string  facet,
int  batchSize 
)

Get an iterator for the identities managed by the evictor.

Parameters
facetThe facet. An empty facet means the default facet.
batchSizeInternally, the Iterator retrieves the identities in batches of size batchSize. Selecting a small batchSize can have an adverse effect on performance.
Returns
A new iterator.
Exceptions
EvictorDeactivatedExceptionRaised if a the evictor has been deactivated.

◆ getSize()

int getSize ( )

Get the size of the evictor's servant queue.

Returns
The size of the servant queue.
Exceptions
EvictorDeactivatedExceptionRaised if a the evictor has been deactivated.
See also
setSize

◆ hasFacet()

bool hasFacet ( Ice::Identity  id,
string  facet 
)

Like hasObject, but with a facet.

Calling hasObject(id) is equivalent to calling hasFacet with an empty facet.

Parameters
idThe identity of the Ice object.
facetThe facet name. An empty facet means the default facet.
Returns
true if the identity is managed by the evictor for the given facet, false otherwise.
Exceptions
DatabaseExceptionRaised if a database failure occurred.
EvictorDeactivatedExceptionRaised if a the evictor has been deactivated.

◆ hasObject()

bool hasObject ( Ice::Identity  id)

Returns true if the given identity is managed by the evictor with the default facet.

Parameters
idThe identity of the Ice object.
Returns
true if the identity is managed by the evictor, false otherwise.
Exceptions
DatabaseExceptionRaised if a database failure occurred.
EvictorDeactivatedExceptionRaised if a the evictor has been deactivated.

◆ remove()

Object remove ( Ice::Identity  id)

Permanently destroy an Ice object.

Parameters
idThe identity of the Ice object.
Returns
The removed servant.
Exceptions
Ice.NotRegisteredExceptionRaised if this identity was not registered with the evictor.
DatabaseExceptionRaised if a database failure occurred.
EvictorDeactivatedExceptionRaised if the evictor has been deactivated.
See also
add
removeFacet

◆ removeFacet()

Object removeFacet ( Ice::Identity  id,
string  facet 
)

Like remove, but with a facet.

Calling remove(id) is equivalent to calling removeFacet with an empty facet.

Parameters
idThe identity of the Ice object.
facetThe facet name. An empty facet means the default facet.
Returns
The removed servant.
Exceptions
Ice.NotRegisteredExceptionRaised if this identity was not registered with the evictor.
DatabaseExceptionRaised if a database failure occurred.
EvictorDeactivatedExceptionRaised if the evictor has been deactivated.
See also
remove
addFacet

◆ setSize()

void setSize ( int  sz)

Set the size of the evictor's servant queue.

This is the maximum number of servants the evictor keeps active. Requests to set the queue size to a value smaller than zero are ignored.

Parameters
szThe size of the servant queue. If the evictor currently holds more than sz servants in its queue, it evicts enough servants to match the new size. Note that this operation can block if the new queue size is smaller than the current number of servants that are servicing requests. In this case, the operation waits until a sufficient number of servants complete their requests.
Exceptions
EvictorDeactivatedExceptionRaised if a the evictor has been deactivated.
See also
getSize

The documentation for this interface was generated from the following file: