* Export non-DGC-enabled remote object (A0) on endpoint A.
*
* - DGC call to A should fail.
*/
Remote implA0 = new Remote() { };
Exporter expA0 = new BasicJeriExporter(seA, ilf, false, false);
expA0.export(implA0);
System.err.println("\t{A0}");
System.err.print("DGC call to A ");
verifyFailure(dgcA);
/*
* Export DGC-enabled remote object (B1) on endpoint B.
*
* - DGC call to A should still fail.
* - DGC call to B should succeed.
* - DGC call to B with foreign UUID class should fail.
*/
Remote implB1 = new Remote() { };
Exporter expB1 = new BasicJeriExporter(seB, ilf, true, false);
expB1.export(implB1);
System.err.println("\t{A0}\t{B1}");
System.err.print("DGC call to A ");
verifyFailure(dgcA);
System.err.print("DGC call to B ");
verifySuccess(dgcB);
System.err.print("DGC call to B with foreign UUID class ");
verifyFailureWithUuid(dgcB, foreignUuid);
/*
* Export DGC-enabled remote object (A1) on endpoint A.
*
* - DGC call to A should now succeed.
*/
Remote implA1 = new Remote() { };
Exporter expA1 = new BasicJeriExporter(seA, ilf, true, false);
expA1.export(implA1);
System.err.println("\t{A0,A1}\t{B1}");
System.err.print("DGC call to A ");
verifySuccess(dgcA);
/*
* Unexport A1.
*
* - DGC call to A should fail again.
* - DGC call to B should still succeed.
*/
expA1.unexport(true);
System.err.println("\t{A0}\t{B1}");
System.err.print("DGC call to A ");
verifyFailure(dgcA);
System.err.print("DGC call to B ");
verifySuccess(dgcB);
/*
* Export non-DGC-enabled remote object (B0) on endpoint B, to
* maintain listening on B. Then clear reference to B1,
* letting it become garbage collected.
*
* - DGC call to B should now fail.
*/
Remote implB0 = new Remote() { };
Exporter expB0 = new BasicJeriExporter(seB, ilf, false, false);
expB0.export(implB0);
System.err.println("\t{A0}\t{B0,B1}");
implB1 = null;
System.gc();
Thread.sleep(3000);