/usr/share/Ice-3.4.2/slice/Freeze/Evictor.ice is in ice34-slice 3.4.2-8.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | // **********************************************************************
//
// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef FREEZE_EVICTOR_ICE
#define FREEZE_EVICTOR_ICE
[["cpp:header-ext:h"]]
#include <Ice/ObjectAdapterF.ice>
#include <Ice/ServantLocator.ice>
#include <Ice/Identity.ice>
#include <Freeze/Exception.ice>
module Freeze
{
/**
*
* A servant initializer provides the application with an
* opportunity to perform custom servant initialization.
*
* @see Evictor
*
**/
local interface ServantInitializer
{
/**
*
* Called whenever the evictor creates a new servant. This
* operation allows application code to perform custom servant
* initialization after the servant has been created by the
* evictor and its persistent state has been restored.
*
* @param adapter The object adapter in which the evictor is
* installed.
*
* @param identity The identity of the Ice object for which the
* servant was created.
*
* @param facet The facet. An empty facet means the default
* facet.
*
* @param servant The servant to initialize.
*
* @see Ice.Identity
*
**/
void initialize(Ice::ObjectAdapter adapter, Ice::Identity identity, string facet, Object servant);
};
/**
*
* This exception is raised if there are no further elements in the iteration.
*
**/
local exception NoSuchElementException
{
};
/**
*
* An iterator for the objects managed by the evictor.
* Note that an EvictorIterator is not thread-safe: the application needs to
* serialize access to a given EvictorIterator, for example by using it
* in just one thread.
*
* @see Evictor
*
**/
local interface EvictorIterator
{
/**
*
* Determines if the iteration has more elements.
*
* @return True if the iterator has more elements, false
* otherwise.
*
* @throws DatabaseException Raised if a database failure
* occurs while retrieving a batch of objects.
*
**/
bool hasNext();
/**
*
* Obtains the next identity in the iteration.
*
* @returns The next identity in the iteration.
*
* @throws NoSuchElementException Raised if there is no further
* elements in the iteration.
*
* @throws DatabaseException Raised if a database failure
* occurs while retrieving a batch of objects.
**/
Ice::Identity next();
};
/**
*
* This exception is raised if the evictor has been deactivated.
*
**/
local exception EvictorDeactivatedException
{
};
/**
*
* 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 ServantInitializer
*
**/
local interface Evictor extends Ice::ServantLocator
{
/**
*
* 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.
*
* @param sz The size of the servant queue. If the evictor
* currently holds more than <tt>sz</tt> 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.
*
*
* @throws EvictorDeactivatedException Raised if a the evictor has
* been deactivated.
*
* @see #getSize
*
**/
void setSize(int sz);
/**
*
* Get the size of the evictor's servant queue.
*
* @return The size of the servant queue.
*
* @throws EvictorDeactivatedException Raised if a the evictor has
* been deactivated.
*
* @see #setSize
*
**/
int getSize();
/**
*
* Add a servant to this evictor. The state of the servant passed to
* this operation will be saved in the evictor's persistent store.
*
* @param servant The servant to add.
*
* @param id The identity of the Ice object that is implemented by
* the servant.
*
* @return A proxy that matches the given identity and this evictor's
* object adapter.
*
* @throws Ice.AlreadyRegisteredException Raised if the evictor already has
* an object with this identity.
*
* @throws DatabaseException Raised if a database failure occurred.
*
* @throws EvictorDeactivatedException Raised if the evictor has
* been deactivated.
*
* @see #addFacet
* @see #remove
* @see #removeFacet
*
**/
Object* add(Object servant, Ice::Identity id);
/**
*
* Like {@link #add}, but with a facet. Calling <tt>add(servant, id)</tt>
* is equivalent to calling {@link #addFacet} with an empty
* facet.
*
* @param servant The servant to add.
*
* @param id The identity of the Ice object that is implemented by
* the servant.
*
* @param facet The facet. An empty facet means the default
* facet.
*
* @return A proxy that matches the given identity and this evictor's
* object adapter.
*
* @throws Ice.AlreadyRegisteredException Raised if the evictor already has
* an object with this identity.
*
* @throws DatabaseException Raised if a database failure occurred.
*
* @throws EvictorDeactivatedException Raised if the evictor has
* been deactivated.
*
* @see #add
* @see #remove
* @see #removeFacet
*
**/
Object* addFacet(Object servant, Ice::Identity id, string facet);
//
// Note: no UUID operation as we don't know the category or
// categories this evictor was registered with.
//
/**
*
* Permanently destroy an Ice object.
*
* @param id The identity of the Ice object.
*
* @return The removed servant.
*
* @throws Ice.NotRegisteredException Raised if this identity was not
* registered with the evictor.
*
* @throws DatabaseException Raised if a database failure occurred.
*
* @throws EvictorDeactivatedException Raised if the evictor has
* been deactivated.
*
* @see #add
* @see #removeFacet
*
**/
Object remove(Ice::Identity id);
/**
*
* Like {@link #remove}, but with a facet. Calling <tt>remove(id)</tt>
* is equivalent to calling {@link #removeFacet} with an empty facet.
*
* @param id The identity of the Ice object.
*
* @param facet The facet. An empty facet means the default
* facet.
*
* @return The removed servant.
*
* @throws Ice.NotRegisteredException Raised if this identity was not
* registered with the evictor.
*
* @throws DatabaseException Raised if a database failure occurred.
*
* @throws EvictorDeactivatedException Raised if the evictor has
* been deactivated.
*
*
* @see #remove
* @see #addFacet
*
**/
Object removeFacet(Ice::Identity id, string facet);
/**
*
* Returns true if the given identity is managed by the evictor
* with the default facet.
*
* @return true if the identity is managed by the evictor, false
* otherwise.
*
* @throws DatabaseException Raised if a database failure occurred.
*
* @throws EvictorDeactivatedException Raised if a the evictor has
* been deactivated.
*
**/
bool hasObject(Ice::Identity id);
/**
*
* Like {@link #hasObject}, but with a facet. Calling <tt>hasObject(id)</tt>
* is equivalent to calling {@link #hasFacet] with an empty
* facet.
*
* @return true if the identity is managed by the evictor for the
* given facet, false otherwise.
*
* @throws DatabaseException Raised if a database failure occurred.
*
* @throws EvictorDeactivatedException Raised if a the evictor has
* been deactivated.
*
**/
bool hasFacet(Ice::Identity id, string facet);
/**
*
* Get an iterator for the identities managed by the evictor.
*
* @param facet The facet. An empty facet means the default
* facet.
*
* @param batchSize Internally, the Iterator retrieves the
* identities in batches of size batchSize. Selecting a small batchSize
* can have an adverse effect on performance.
*
* @return A new iterator.
*
* @throws EvictorDeactivatedException Raised if a the evictor has
* been deactivated.
*
**/
EvictorIterator getIterator(string facet, int batchSize);
};
};
#endif
|