geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasonhu...@apache.org
Subject geode git commit: GEODE-2217: Add generic type parameter to FunctionContext interface
Date Wed, 12 Apr 2017 18:30:16 GMT
Repository: geode
Updated Branches:
  refs/heads/develop f13da788c -> bc2218409


GEODE-2217: Add generic type parameter to FunctionContext interface

 * This closes #447


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/bc221840
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/bc221840
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/bc221840

Branch: refs/heads/develop
Commit: bc2218409cfe2693e3bb886ee1660c7ab4748323
Parents: f13da78
Author: Alyssa Kim <micro9110@gmail.com>
Authored: Mon Apr 10 19:14:12 2017 -0800
Committer: Jason Huynh <huynhja@gmail.com>
Committed: Wed Apr 12 11:30:03 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/geode/cache/execute/Function.java    | 5 +++--
 .../java/org/apache/geode/cache/execute/FunctionContext.java  | 7 ++++---
 .../geode/internal/cache/execute/FunctionContextImpl.java     | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/bc221840/geode-core/src/main/java/org/apache/geode/cache/execute/Function.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/execute/Function.java b/geode-core/src/main/java/org/apache/geode/cache/execute/Function.java
index 54163a1..25ba4e3 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/execute/Function.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/execute/Function.java
@@ -32,11 +32,12 @@ import org.apache.geode.lang.Identifiable;
  * @see FunctionAdapter
  * @see FunctionService
  *
+ * @param T type of FunctionContext's arguments of this Function
  *
  * @since GemFire 6.0
  */
 @FunctionalInterface
-public interface Function extends Identifiable<String> {
+public interface Function<T> extends Identifiable<String> {
 
   /**
    * Specifies whether the function sends results while executing. The method returns false
if no
@@ -67,7 +68,7 @@ public interface Function extends Identifiable<String> {
    * @param context as created by {@link Execution}
    * @since GemFire 6.0
    */
-  public void execute(FunctionContext context);
+  public void execute(FunctionContext<T> context);
 
   /**
    * Return a unique function identifier, used to register the function with {@link FunctionService}

http://git-wip-us.apache.org/repos/asf/geode/blob/bc221840/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionContext.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionContext.java
b/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionContext.java
index 3389bb5..392eea9 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionContext.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/execute/FunctionContext.java
@@ -25,13 +25,14 @@ package org.apache.geode.cache.execute;
  * This interface is implemented by GemFire. Instances of it will be passed in to
  * {@link Function#execute(FunctionContext)}.
  * 
+ * @param T1 object type of Arguments
  *
  * @since GemFire 6.0
  *
  * @see RegionFunctionContext
  *
  */
-public interface FunctionContext {
+public interface FunctionContext<T1> {
   /**
    * Returns the arguments provided to this function execution. These are the arguments specified
by
    * the caller using {@link Execution#withArgs(Object)}
@@ -39,7 +40,7 @@ public interface FunctionContext {
    * @return the arguments or null if there are no arguments
    * @since GemFire 6.0
    */
-  public Object getArguments();
+  public T1 getArguments();
 
   /**
    * Returns the identifier of the function.
@@ -62,7 +63,7 @@ public interface FunctionContext {
    * @since GemFire 6.0
    */
 
-  public <T> ResultSender<T> getResultSender();
+  public <T2> ResultSender<T2> getResultSender();
 
   /**
    * Returns a boolean to identify whether this is a re-execute. Returns true if it is a
re-execute

http://git-wip-us.apache.org/repos/asf/geode/blob/bc221840/geode-core/src/main/java/org/apache/geode/internal/cache/execute/FunctionContextImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/FunctionContextImpl.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/FunctionContextImpl.java
index 77ff115..e2185c4 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/execute/FunctionContextImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/execute/FunctionContextImpl.java
@@ -89,7 +89,7 @@ public class FunctionContextImpl implements FunctionContext {
     return buf.toString();
   }
 
-  public <T> ResultSender<T> getResultSender() {
+  public ResultSender getResultSender() {
     return this.resultSender;
   }
 


Mime
View raw message