Toggle navigation
Home
java.util.concurrent.Future<?> to java.util.concurrent.CountDownLatch
No. of Instances - 3
No. of Commits - 2
No. of Projects - {'orientdb', 'undertow'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Jdk -> Jdk
Mapping:
Rename Method invocation
get
to
await
Other
new Runnable(){ @Override public void run(){ final CountDownLatch latch=new CountDownLatch(1); try { Session session=deployment.connectToServer(new Endpoint(){ @Override public void onOpen( Session session, EndpointConfig config){ } @Override public void onClose( Session session, CloseReason closeReason){ latch.countDown(); } @Override public void onError( Session session, Throwable thr){ latch.countDown(); } } ,null,new URI("ws://" + DefaultServer.getHostAddress("default") + ":"+ DefaultServer.getHostPort("default")+ "/ws/stress")); try { for (int i=0; i < NUM_REQUESTS; ++i) { session.getAsyncRemote().sendText("t-" + thread + "-m-"+ i); } session.getAsyncRemote().sendText("close"); latch.await(); } finally { session.close(); } } catch ( Exception e) { throw new RuntimeException(e); } } }
to
latch
Add or Remove Method invocation
executor.submit(new Runnable(){ @Override public void run(){ final CountDownLatch latch=new CountDownLatch(1); try { Session session=deployment.connectToServer(new Endpoint(){ @Override public void onOpen( Session session, EndpointConfig config){ } @Override public void onClose( Session session, CloseReason closeReason){ latch.countDown(); } @Override public void onError( Session session, Throwable thr){ latch.countDown(); } } ,null,new URI("ws://" + DefaultServer.getHostAddress("default") + ":"+ DefaultServer.getHostPort("default")+ "/ws/stress")); try { for (int i=0; i < NUM_REQUESTS; ++i) { session.getAsyncRemote().sendText("t-" + thread + "-m-"+ i); } session.getAsyncRemote().sendText("close"); latch.await(); } finally { session.close(); } } catch ( Exception e) { throw new RuntimeException(e); } } } )
to
latch
Rename Variable
futures
to
latches
futures
to
latches
flushFuture
to
latch
flushFuture
to
latch