equal
deleted
inserted
replaced
56 import java.util.List; |
56 import java.util.List; |
57 import java.util.concurrent.atomic.AtomicInteger; |
57 import java.util.concurrent.atomic.AtomicInteger; |
58 |
58 |
59 public class PinClientSocketFactory { |
59 public class PinClientSocketFactory { |
60 |
60 |
61 private static final int PORT = TestLibrary.getUnusedRandomPort(); |
|
62 private static final int SESSIONS = 50; |
61 private static final int SESSIONS = 50; |
63 |
62 |
64 public interface Factory extends Remote { |
63 public interface Factory extends Remote { |
65 Session getSession() throws RemoteException; |
64 Session getSession() throws RemoteException; |
66 } |
65 } |
94 Session session = factoryStub.getSession(); |
93 Session session = factoryStub.getSession(); |
95 session.ping(); |
94 session.ping(); |
96 } |
95 } |
97 UnicastRemoteObject.unexportObject(factoryImpl, true); |
96 UnicastRemoteObject.unexportObject(factoryImpl, true); |
98 |
97 |
99 Registry registryImpl = LocateRegistry.createRegistry(PORT); |
98 Registry registryImpl = TestLibrary.createRegistryOnEphemeralPort(); |
|
99 int port = TestLibrary.getRegistryPort(registryImpl); |
|
100 System.out.println("Registry listening on port " + port); |
|
101 |
100 CSF csf = new CSF(); |
102 CSF csf = new CSF(); |
101 Reference<CSF> registryRef = new WeakReference<CSF>(csf); |
103 Reference<CSF> registryRef = new WeakReference<CSF>(csf); |
102 Registry registryStub = LocateRegistry.getRegistry("", PORT, csf); |
104 Registry registryStub = LocateRegistry.getRegistry("", port, csf); |
103 csf = null; |
105 csf = null; |
104 registryStub.list(); |
106 registryStub.list(); |
105 registryStub = null; |
107 registryStub = null; |
106 UnicastRemoteObject.unexportObject(registryImpl, true); |
108 UnicastRemoteObject.unexportObject(registryImpl, true); |
107 |
109 |