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
|
#!/usr/bin/env python
# **********************************************************************
#
# 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.
#
# **********************************************************************
import os, sys, traceback
import Ice
Ice.loadSlice('TestAMD.ice')
import Test
class InitialI(Test._InitialDisp):
def shutdown(self, current=None):
current.adapter.getCommunicator().shutdown()
def pingPong(self, o, current=None):
return Ice.Future.completed(o)
def opOptionalException(self, a, b, o, current=None):
f = Ice.Future()
f.set_exception(Test.OptionalException(False, a, b, o))
return f
def opDerivedException(self, a, b, o, current=None):
f = Ice.Future()
f.set_exception(Test.DerivedException(False, a, b, o, b, o))
return f
def opRequiredException(self, a, b, o, current=None):
e = Test.RequiredException()
e.a = a
e.b = b
e.o = o
if b is not Ice.Unset:
e.ss = b
if o is not Ice.Unset:
e.o2 = o
f = Ice.Future()
f.set_exception(e)
return f
def opByte(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opBool(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opShort(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opInt(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opLong(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFloat(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opDouble(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opString(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opMyEnum(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSmallStruct(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFixedStruct(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opVarStruct(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opOneOptional(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opOneOptionalProxy(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opByteSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opBoolSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opShortSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opIntSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opLongSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFloatSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opDoubleSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opStringSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSmallStructSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSmallStructList(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFixedStructSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFixedStructList(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opVarStructSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSerializable(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opIntIntDict(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opStringIntDict(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opIntOneOptionalDict(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opClassAndUnknownOptional(self, p, current=None):
return Ice.Future.completed(None)
def sendOptionalClass(self, req, o, current=None):
return Ice.Future.completed(None)
def returnOptionalClass(self, req, current=None):
return Ice.Future.completed(Test.OneOptional(53))
def opG(self, g, current=None):
return Ice.Future.completed(g)
def opVoid(self, current=None):
return Ice.Future.completed(None)
def opMStruct1(self, current):
return Ice.Future.completed(Test.SmallStruct())
def opMStruct2(self, p1, current):
return Ice.Future.completed((p1, p1))
def opMSeq1(self, current):
return Ice.Future.completed([])
def opMSeq2(self, p1, current):
return Ice.Future.completed((p1, p1))
def opMDict1(self, current):
return Ice.Future.completed({})
def opMDict2(self, p1, current):
return Ice.Future.completed((p1, p1))
def opMG1(self, current):
return Ice.Future.completed(Test.G())
def opMG2(self, p1, current):
return Ice.Future.completed((p1, p1))
def supportsRequiredParams(self, current=None):
return Ice.Future.completed(False)
def supportsJavaSerializable(self, current=None):
return Ice.Future.completed(True)
def supportsCsharpSerializable(self, current=None):
return Ice.Future.completed(False)
def supportsCppStringView(self, current=None):
return Ice.Future.completed(False)
def supportsNullOptional(self, current=None):
return Ice.Future.completed(True)
def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp")
adapter = communicator.createObjectAdapter("TestAdapter")
initial = InitialI()
adapter.add(initial, Ice.stringToIdentity("initial"))
adapter.activate()
communicator.waitForShutdown()
return True
try:
communicator = Ice.initialize(sys.argv)
status = run(sys.argv, communicator)
except:
traceback.print_exc()
status = False
if communicator:
communicator.destroy()
sys.exit(not status)
|