summaryrefslogtreecommitdiff
path: root/cpp/test/Freeze/evictor/Test.ice
blob: 489ad57e2e35a1a6a3bc7289319cc15b9fc617c1 (plain)
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
// **********************************************************************
//
// Copyright (c) 2003-2016 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.
//
// **********************************************************************

#pragma once

#include <Ice/Identity.ice>

module Test
{

exception AlreadyRegisteredException
{
};

exception NotRegisteredException
{
};

exception EvictorDeactivatedException
{
};


exception InsufficientFundsException
{
};

["cpp:virtual"]class Account
{
    int getBalance();
    ["freeze:write"] void transfer(int amount, Account* toAccount) throws InsufficientFundsException;

    //
    // Other implementations of transfer that we want to test as well
    //
    ["freeze:write", "amd"] void transfer2(int amount, Account* toAccount) throws InsufficientFundsException;
    ["freeze:write", "amd"] void transfer3(int amount, Account* toAccount) throws InsufficientFundsException;

    

    //
    // "Internal" operation
    //
    ["freeze:write:mandatory"] void deposit(int amount) throws InsufficientFundsException;

    int balance;
};

sequence<Account*> AccountPrxSeq;
sequence<Ice::Identity> AccountIdSeq;

["freeze:write", "cpp:virtual"] class Servant
{
    ["freeze:read", "cpp:const"] idempotent int getValue();
    ["amd", "freeze:read", "cpp:const"] idempotent int slowGetValue();

    idempotent void setValue(int value);

    ["amd"] void setValueAsync(int value);
    ["freeze:read", "cpp:const"] void releaseAsync();

    ["freeze:read", "cpp:const"] void addFacet(string name, string data) throws AlreadyRegisteredException;
    ["freeze:read", "cpp:const"] void removeFacet(string name) throws NotRegisteredException;

    ["freeze:read", "cpp:const"] int getTransientValue();
    idempotent void setTransientValue(int value);
    idempotent void keepInCache();
    void release() throws NotRegisteredException;

    ["freeze:write"] AccountPrxSeq getAccounts();
    ["freeze:read"] int getTotalBalance();

    void destroy();

    int value;
    AccountIdSeq accounts;
};

["freeze:write", "cpp:virtual"] class Facet extends Servant
{
    ["freeze:read", "cpp:const"] idempotent string getData();
    idempotent void setData(string data);

    string data;
};


interface RemoteEvictor
{
    idempotent void setSize(int size);

    Servant* createServant(string id, int value) 
        throws AlreadyRegisteredException, EvictorDeactivatedException;

    idempotent Servant* getServant(string id);

    void saveNow();

    void deactivate();
    idempotent void destroyAllServants(string facet);
};

interface RemoteEvictorFactory
{
    RemoteEvictor* createEvictor(string name, bool transactional);
    void shutdown();
};

};