rpcbenchmark: use lambdas
[controller.git] / benchmark / rpcbenchmark / src / main / java / rpcbenchmark / impl / RpcbenchmarkProvider.java
index b591c3f53c139e4bd79e36abfbfef7a5198b8f0e..503bd170a50fd29e3fb4d8cfe4091e2ac5ab4f33 100644 (file)
@@ -50,7 +50,7 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
     private RpcProviderRegistry providerRegistry;
 
     @Override
-    public void onSessionInitiated(ProviderContext session) {
+    public void onSessionInitiated(final ProviderContext session) {
         LOG.debug("RpcbenchmarkProvider Session Initiated");
         consumerRegistry = session.getSALService(RpcConsumerRegistry.class);
         providerRegistry = session.getSALService(RpcProviderRegistry.class);
@@ -105,12 +105,7 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
         try {
             ExecutorService executor = Executors.newFixedThreadPool(input.getNumClients().intValue());
 
-            final Runnable testRun = new Runnable() {
-                @Override
-                public void run() {
-                    client.runTest(input.getIterations().intValue());
-                }
-            };
+            final Runnable testRun = () -> client.runTest(input.getIterations().intValue());
 
             LOG.info("Test Started");
             long startTime = System.nanoTime();
@@ -122,7 +117,7 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
             executor.shutdown();
             try {
                 executor.awaitTermination(testTimeout, TimeUnit.MINUTES);
-            } catch (InterruptedException e) {
+            } catch (final InterruptedException e) {
                 LOG.error("Out of time: test did not finish within the {} min deadline ", testTimeout); 
             }