33
33
import org .apache .mnemonic .DurableChunk ;
34
34
import org .apache .mnemonic .Reclaim ;
35
35
import org .apache .mnemonic .Durable ;
36
+ import org .apache .mnemonic .ParameterHolder ;
36
37
import org .apache .commons .lang3 .tuple .Pair ;
37
38
import org .apache .commons .lang3 .RandomUtils ;
38
39
import org .testng .annotations .AfterClass ;
@@ -202,11 +203,21 @@ public <A extends RestorableAllocator<A>> Person<Long> restore(
202
203
return PersonFactory .restore (allocator , factoryproxys , gfields , phandler , autoreclaim );
203
204
}
204
205
@ Override
206
+ public <A extends RestorableAllocator <A >> Person <Long > restore (ParameterHolder <A > ph ) {
207
+ return PersonFactory .restore (ph .getAllocator (),
208
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getHandler (), ph .getAutoReclaim ());
209
+ }
210
+ @ Override
205
211
public <A extends RestorableAllocator <A >> Person <Long > create (
206
212
A allocator , EntityFactoryProxy [] factoryproxys ,
207
213
DurableType [] gfields , boolean autoreclaim ) {
208
214
return PersonFactory .create (allocator , factoryproxys , gfields , autoreclaim );
209
215
}
216
+ @ Override
217
+ public <A extends RestorableAllocator <A >> Person <Long > create (ParameterHolder <A > ph ) {
218
+ return PersonFactory .create (ph .getAllocator (),
219
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getAutoReclaim ());
220
+ }
210
221
} };
211
222
212
223
Person <Long > person = (Person <Long >) efproxies [0 ].create (m_act , null , null , false );
@@ -257,11 +268,21 @@ public <A extends RestorableAllocator<A>> Person<Long> restore(
257
268
return PersonFactory .restore (allocator , factoryproxys , gfields , phandler , autoreclaim );
258
269
}
259
270
@ Override
271
+ public <A extends RestorableAllocator <A >> Person <Long > restore (ParameterHolder <A > ph ) {
272
+ return PersonFactory .restore (ph .getAllocator (),
273
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getHandler (), ph .getAutoReclaim ());
274
+ }
275
+ @ Override
260
276
public <A extends RestorableAllocator <A >> Person <Long > create (
261
277
A allocator , EntityFactoryProxy [] factoryproxys ,
262
278
DurableType [] gfields , boolean autoreclaim ) {
263
279
return PersonFactory .create (allocator , factoryproxys , gfields , autoreclaim );
264
280
}
281
+ @ Override
282
+ public <A extends RestorableAllocator <A >> Person <Long > create (ParameterHolder <A > ph ) {
283
+ return PersonFactory .create (ph .getAllocator (),
284
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getAutoReclaim ());
285
+ }
265
286
} };
266
287
267
288
Person <Long > person = (Person <Long >) efproxies [1 ].create (m_act , null , null , false );
@@ -304,11 +325,21 @@ public <A extends RestorableAllocator<A>> Person<Long> restore(
304
325
return PersonFactory .restore (allocator , factoryproxys , gfields , phandler , autoreclaim );
305
326
}
306
327
@ Override
328
+ public <A extends RestorableAllocator <A >> Person <Long > restore (ParameterHolder <A > ph ) {
329
+ return PersonFactory .restore (ph .getAllocator (),
330
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getHandler (), ph .getAutoReclaim ());
331
+ }
332
+ @ Override
307
333
public <A extends RestorableAllocator <A >> Person <Long > create (
308
334
A allocator , EntityFactoryProxy [] factoryproxys ,
309
335
DurableType [] gfields , boolean autoreclaim ) {
310
336
return PersonFactory .create (allocator , factoryproxys , gfields , autoreclaim );
311
337
}
338
+ @ Override
339
+ public <A extends RestorableAllocator <A >> Person <Long > create (ParameterHolder <A > ph ) {
340
+ return PersonFactory .create (ph .getAllocator (),
341
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getAutoReclaim ());
342
+ }
312
343
}, new EntityFactoryProxy () {
313
344
@ Override
314
345
public <A extends RestorableAllocator <A >> Person <Long > restore (
@@ -317,11 +348,21 @@ public <A extends RestorableAllocator<A>> Person<Long> restore(
317
348
return PersonFactory .restore (allocator , factoryproxys , gfields , phandler , autoreclaim );
318
349
}
319
350
@ Override
351
+ public <A extends RestorableAllocator <A >> Person <Long > restore (ParameterHolder <A > ph ) {
352
+ return PersonFactory .restore (ph .getAllocator (),
353
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getHandler (), ph .getAutoReclaim ());
354
+ }
355
+ @ Override
320
356
public <A extends RestorableAllocator <A >> Person <Long > create (
321
357
A allocator , EntityFactoryProxy [] factoryproxys ,
322
358
DurableType [] gfields , boolean autoreclaim ) {
323
359
return PersonFactory .create (allocator , factoryproxys , gfields , autoreclaim );
324
360
}
361
+ @ Override
362
+ public <A extends RestorableAllocator <A >> Person <Long > create (ParameterHolder <A > ph ) {
363
+ return PersonFactory .create (ph .getAllocator (),
364
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getAutoReclaim ());
365
+ }
325
366
} };
326
367
327
368
Person <Long > person = (Person <Long >) efproxies [0 ].create (m_act , null , null , false );
@@ -355,11 +396,21 @@ public <A extends RestorableAllocator<A>> Person<Long> restore(
355
396
return PersonFactory .restore (allocator , factoryproxys , gfields , phandler , autoreclaim );
356
397
}
357
398
@ Override
399
+ public <A extends RestorableAllocator <A >> Person <Long > restore (ParameterHolder <A > ph ) {
400
+ return PersonFactory .restore (ph .getAllocator (),
401
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getHandler (), ph .getAutoReclaim ());
402
+ }
403
+ @ Override
358
404
public <A extends RestorableAllocator <A >> Person <Long > create (
359
405
A allocator , EntityFactoryProxy [] factoryproxys ,
360
406
DurableType [] gfields , boolean autoreclaim ) {
361
407
return PersonFactory .create (allocator , factoryproxys , gfields , autoreclaim );
362
408
}
409
+ @ Override
410
+ public <A extends RestorableAllocator <A >> Person <Long > create (ParameterHolder <A > ph ) {
411
+ return PersonFactory .create (ph .getAllocator (),
412
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getAutoReclaim ());
413
+ }
363
414
} };
364
415
DurableType mapgtypes [] = {DurableType .STRING , DurableType .DURABLE , DurableType .STRING , DurableType .DURABLE };
365
416
EntityFactoryProxy mapefproxies [] = {null , new EntityFactoryProxy () {
@@ -371,12 +422,26 @@ public <A extends RestorableAllocator<A>> Durable restore(
371
422
return DurableHashMapFactory .restore (allocator , dpt .getRight (), dpt .getLeft (), phandler , autoreclaim );
372
423
}
373
424
@ Override
425
+ public <A extends RestorableAllocator <A >> Durable restore (ParameterHolder <A > ph ) {
426
+ Pair <DurableType [], EntityFactoryProxy []> dpt = Utils .shiftDurableParams (ph .getGenericTypes (),
427
+ ph .getEntityFactoryProxies (), 2 );
428
+ return DurableHashMapFactory .restore (ph .getAllocator (),
429
+ dpt .getRight (), dpt .getLeft (), ph .getHandler (), ph .getAutoReclaim ());
430
+ }
431
+ @ Override
374
432
public <A extends RestorableAllocator <A >> Durable create (
375
433
A allocator , EntityFactoryProxy [] factoryproxys ,
376
434
DurableType [] gfields , boolean autoreclaim ) {
377
435
Pair <DurableType [], EntityFactoryProxy []> dpt = Utils .shiftDurableParams (gfields , factoryproxys , 2 );
378
436
return DurableHashMapFactory .create (allocator , dpt .getRight (), dpt .getLeft (), mInitialCapacity , autoreclaim );
379
437
}
438
+ @ Override
439
+ public <A extends RestorableAllocator <A >> Durable create (ParameterHolder <A > ph ) {
440
+ Pair <DurableType [], EntityFactoryProxy []> dpt = Utils .shiftDurableParams (ph .getGenericTypes (),
441
+ ph .getEntityFactoryProxies (), 2 );
442
+ return DurableHashMapFactory .create (ph .getAllocator (),
443
+ dpt .getRight (), dpt .getLeft (), mInitialCapacity , ph .getAutoReclaim ());
444
+ }
380
445
}, null , new EntityFactoryProxy () {
381
446
@ Override
382
447
public <A extends RestorableAllocator <A >> Person <Long > restore (
@@ -385,11 +450,21 @@ public <A extends RestorableAllocator<A>> Person<Long> restore(
385
450
return PersonFactory .restore (allocator , factoryproxys , gfields , phandler , autoreclaim );
386
451
}
387
452
@ Override
453
+ public <A extends RestorableAllocator <A >> Person <Long > restore (ParameterHolder <A > ph ) {
454
+ return PersonFactory .restore (ph .getAllocator (),
455
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getHandler (), ph .getAutoReclaim ());
456
+ }
457
+ @ Override
388
458
public <A extends RestorableAllocator <A >> Person <Long > create (
389
459
A allocator , EntityFactoryProxy [] factoryproxys ,
390
460
DurableType [] gfields , boolean autoreclaim ) {
391
461
return PersonFactory .create (allocator , factoryproxys , gfields , autoreclaim );
392
462
}
463
+ @ Override
464
+ public <A extends RestorableAllocator <A >> Person <Long > create (ParameterHolder <A > ph ) {
465
+ return PersonFactory .create (ph .getAllocator (),
466
+ ph .getEntityFactoryProxies (), ph .getGenericTypes (), ph .getAutoReclaim ());
467
+ }
393
468
} };
394
469
395
470
Person <Long > person = PersonFactory .create (m_act , null , null , false );
0 commit comments