[java-metadata-aggregator COMMIT] in /trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline: Futur...

noreply at shibboleth.net noreply at shibboleth.net
Wed Sep 17 08:55:13 EDT 2014


Author: iay
Date: Wed Sep 17 08:55:13 2014
New Revision: 379

URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=379&view=rev
Log:
Hide implementation of FutureNow, access it through a static method instead.

Modified:
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java?rev=379&r1=378&r2=379&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/FutureSupport.java Wed Sep 17 08:55:13 2014
@@ -43,7 +43,7 @@
      *
      * @param <T> type of "future" object to return
      */
-    public static class FutureNow<T> implements Future<T> {
+    private static class FutureNow<T> implements Future<T> {
     
         /**
          * Value to be returned.
@@ -96,6 +96,19 @@
     }
 
     /**
+     * Returns a {@link Future} containing an already computed value.
+     * 
+     * @param t value to be returned
+     * @param <T> type of value to be returned
+     * 
+     * @return {@link Future} returning the passed value
+     */
+    @Nonnull
+    public static <T> Future<T> futureNow(final T t) {
+        return new FutureNow<>(t);
+    }
+
+    /**
      * Resolves the future value of a {@link Future} collection value.
      * @param future {@link Future} value to be resolved
      * @param <T> type of the items in the collection

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java?rev=379&r1=378&r2=379&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SplitMergeStage.java Wed Sep 17 08:55:13 2014
@@ -264,7 +264,7 @@
          * a {@link Future}.
          */
         if (pipeline == null) {
-            return new FutureSupport.FutureNow<>(items);
+            return FutureSupport.futureNow(items);
         }
 
         final PipelineCallable<T> callable = new PipelineCallable<>(pipeline, items);



More information about the commits mailing list