ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [25/50] incubator-ignite git commit: GG-10469: Done.
Date Wed, 08 Jul 2015 19:21:50 GMT
GG-10469: Done.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/96fa3002
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96fa3002
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96fa3002

Branch: refs/heads/ignite-1026
Commit: 96fa3002904fcad50dafc1f19655c2d44eaece40
Parents: 96c9695
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Tue Jul 7 18:07:05 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Tue Jul 7 18:07:05 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/interop/InteropIgnition.java   | 17 ++++++++++++++++-
 .../ignite/internal/interop/InteropProcessor.java  |  7 +++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96fa3002/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
index 2989a17..faae72b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -50,6 +50,9 @@ public class InteropIgnition {
      */
     public static synchronized InteropProcessor start(@Nullable String springCfgPath, @Nullable
String gridName,
         int factoryId, long envPtr, long dataPtr) {
+        if (envPtr <= 0)
+            throw new IgniteException("Environment pointer must be positive.");
+
         ClassLoader oldClsLdr = Thread.currentThread().getContextClassLoader();
 
         Thread.currentThread().setContextClassLoader(InteropIgnition.class.getClassLoader());
@@ -83,13 +86,25 @@ public class InteropIgnition {
      * Get instance by environment pointer.
      *
      * @param gridName Grid name.
-     * @return Instance or {@code null} if it doesn't exists (never started or stopped).
+     * @return Instance or {@code null} if it doesn't exist (never started or stopped).
      */
     @Nullable public static synchronized InteropProcessor instance(@Nullable String gridName)
{
         return instances.get(gridName);
     }
 
     /**
+     * Get environment pointer of the given instance.
+     *
+     * @param gridName Grid name.
+     * @return Environment pointer or {@code 0} in case grid with such name doesn't exist.
+     */
+    public static synchronized long environmentPointer(@Nullable String gridName) {
+        InteropProcessor proc = instance(gridName);
+
+        return proc != null ? proc.environmentPointer() : 0;
+    }
+
+    /**
      * Stop single instance.
      *
      * @param gridName Grid name,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96fa3002/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
index 325a464..94b733f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropProcessor.java
@@ -32,6 +32,13 @@ public interface InteropProcessor {
     public Ignite ignite();
 
     /**
+     * Get environment pointer associated with this processor.
+     *
+     * @return Environment pointer.
+     */
+    public long environmentPointer();
+
+    /**
      * Get stop runnable to perform cleanup when interop is not longer used.
      * <p/>
      * <b>NOTE!</b> This runnable is called when current instance of interop
processor is eligible for garbage


Mime
View raw message