You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/09/22 08:40:14 UTC
[28/28] ignite git commit: IGNITE-1513: Moved CPP.
IGNITE-1513: Moved CPP.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/524f5653
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/524f5653
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/524f5653
Branch: refs/heads/ignite-1513-final
Commit: 524f5653ec94e445946bda43b907259e21704360
Parents: 20a7918
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Sep 22 09:40:19 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Sep 22 09:40:22 2015 +0300
----------------------------------------------------------------------
modules/platform/cpp/README.txt | 101 +
modules/platform/cpp/common/Makefile.am | 45 +
modules/platform/cpp/common/configure.ac | 62 +
modules/platform/cpp/common/ignite-common.pc.in | 9 +
modules/platform/cpp/common/include/Makefile.am | 22 +
.../common/include/ignite/common/concurrent.h | 210 ++
.../cpp/common/include/ignite/common/exports.h | 145 ++
.../cpp/common/include/ignite/common/java.h | 652 ++++++
.../cpp/common/os/linux/include/Makefile.am | 21 +
.../os/linux/include/ignite/common/common.h | 81 +
.../linux/include/ignite/common/concurrent_os.h | 394 ++++
.../platform/cpp/common/os/linux/src/common.cpp | 59 +
.../cpp/common/os/linux/src/concurrent_os.cpp | 175 ++
.../os/win/include/ignite/common/common.h | 56 +
.../win/include/ignite/common/concurrent_os.h | 406 ++++
.../platform/cpp/common/os/win/src/common.cpp | 65 +
.../cpp/common/os/win/src/concurrent_os.cpp | 151 ++
modules/platform/cpp/common/project/README.TXT | 1 +
.../platform/cpp/common/project/vs/README.TXT | 1 +
.../cpp/common/project/vs/common.vcxproj | 202 ++
.../common/project/vs/common.vcxproj.filters | 54 +
.../platform/cpp/common/project/vs/module.def | 99 +
.../platform/cpp/common/project/vs/targetver.h | 25 +
modules/platform/cpp/common/src/concurrent.cpp | 94 +
modules/platform/cpp/common/src/exports.cpp | 413 ++++
modules/platform/cpp/common/src/java.cpp | 2205 ++++++++++++++++++
modules/platform/cpp/core-test/Makefile.am | 49 +
.../cpp/core-test/config/cache-query.xml | 91 +
.../cpp/core-test/config/cache-test.xml | 129 +
modules/platform/cpp/core-test/configure.ac | 62 +
.../platform/cpp/core-test/include/Makefile.am | 22 +
.../include/ignite/portable_test_defs.h | 320 +++
.../include/ignite/portable_test_utils.h | 516 ++++
.../cpp/core-test/include/teamcity_messages.h | 55 +
.../platform/cpp/core-test/project/README.TXT | 1 +
.../cpp/core-test/project/vs/README.TXT | 1 +
.../cpp/core-test/project/vs/core-test.vcxproj | 174 ++
.../project/vs/core-test.vcxproj.filters | 68 +
.../cpp/core-test/src/cache_query_test.cpp | 656 ++++++
.../platform/cpp/core-test/src/cache_test.cpp | 486 ++++
.../cpp/core-test/src/concurrent_test.cpp | 186 ++
.../cpp/core-test/src/handle_registry_test.cpp | 176 ++
.../cpp/core-test/src/ignition_test.cpp | 102 +
.../src/portable_reader_writer_raw_test.cpp | 1532 ++++++++++++
.../src/portable_reader_writer_test.cpp | 1951 ++++++++++++++++
.../cpp/core-test/src/portable_session_test.cpp | 257 ++
.../cpp/core-test/src/portable_test_defs.cpp | 65 +
.../cpp/core-test/src/teamcity_boost.cpp | 159 ++
.../cpp/core-test/src/teamcity_messages.cpp | 150 ++
modules/platform/cpp/core/Makefile.am | 66 +
modules/platform/cpp/core/configure.ac | 62 +
modules/platform/cpp/core/ignite.pc.in | 9 +
modules/platform/cpp/core/include/Makefile.am | 61 +
.../cpp/core/include/ignite/cache/cache.h | 1153 +++++++++
.../cpp/core/include/ignite/cache/cache_entry.h | 118 +
.../core/include/ignite/cache/cache_peek_mode.h | 71 +
.../cpp/core/include/ignite/cache/query/query.h | 27 +
.../include/ignite/cache/query/query_argument.h | 125 +
.../include/ignite/cache/query/query_cursor.h | 191 ++
.../include/ignite/cache/query/query_scan.h | 151 ++
.../core/include/ignite/cache/query/query_sql.h | 253 ++
.../include/ignite/cache/query/query_text.h | 159 ++
modules/platform/cpp/core/include/ignite/guid.h | 112 +
.../platform/cpp/core/include/ignite/ignite.h | 154 ++
.../core/include/ignite/ignite_configuration.h | 92 +
.../cpp/core/include/ignite/ignite_error.h | 260 +++
.../platform/cpp/core/include/ignite/ignition.h | 195 ++
.../core/include/ignite/impl/cache/cache_impl.h | 418 ++++
.../ignite/impl/cache/query/query_impl.h | 115 +
.../core/include/ignite/impl/handle_registry.h | 202 ++
.../include/ignite/impl/ignite_environment.h | 130 ++
.../cpp/core/include/ignite/impl/ignite_impl.h | 146 ++
.../core/include/ignite/impl/interop/interop.h | 25 +
.../ignite/impl/interop/interop_input_stream.h | 234 ++
.../ignite/impl/interop/interop_memory.h | 280 +++
.../ignite/impl/interop/interop_output_stream.h | 234 ++
.../cpp/core/include/ignite/impl/operations.h | 452 ++++
.../ignite/impl/portable/portable_common.h | 146 ++
.../ignite/impl/portable/portable_id_resolver.h | 106 +
.../impl/portable/portable_metadata_handler.h | 102 +
.../impl/portable/portable_metadata_manager.h | 120 +
.../impl/portable/portable_metadata_snapshot.h | 122 +
.../impl/portable/portable_metadata_updater.h | 53 +
.../portable/portable_metadata_updater_impl.h | 65 +
.../ignite/impl/portable/portable_reader_impl.h | 1130 +++++++++
.../ignite/impl/portable/portable_utils.h | 344 +++
.../ignite/impl/portable/portable_writer_impl.h | 859 +++++++
.../cpp/core/include/ignite/portable/portable.h | 29 +
.../include/ignite/portable/portable_consts.h | 106 +
.../ignite/portable/portable_containers.h | 525 +++++
.../ignite/portable/portable_raw_reader.h | 324 +++
.../ignite/portable/portable_raw_writer.h | 300 +++
.../include/ignite/portable/portable_reader.h | 355 +++
.../include/ignite/portable/portable_type.h | 293 +++
.../include/ignite/portable/portable_writer.h | 335 +++
.../cpp/core/os/linux/include/Makefile.am | 20 +
.../core/os/linux/include/ignite/impl/utils.h | 155 ++
.../cpp/core/os/linux/src/impl/utils.cpp | 439 ++++
.../cpp/core/os/win/include/ignite/impl/utils.h | 155 ++
.../platform/cpp/core/os/win/src/impl/utils.cpp | 453 ++++
modules/platform/cpp/core/project/README.TXT | 1 +
modules/platform/cpp/core/project/vs/README.TXT | 1 +
.../platform/cpp/core/project/vs/core.vcxproj | 272 +++
.../cpp/core/project/vs/core.vcxproj.filters | 246 ++
modules/platform/cpp/core/src/guid.cpp | 65 +
modules/platform/cpp/core/src/ignite.cpp | 43 +
modules/platform/cpp/core/src/ignite_error.cpp | 222 ++
modules/platform/cpp/core/src/ignition.cpp | 468 ++++
.../cpp/core/src/impl/cache/cache_impl.cpp | 388 +++
.../core/src/impl/cache/query/query_impl.cpp | 193 ++
.../cpp/core/src/impl/handle_registry.cpp | 234 ++
.../cpp/core/src/impl/ignite_environment.cpp | 167 ++
.../platform/cpp/core/src/impl/ignite_impl.cpp | 42 +
.../src/impl/interop/interop_input_stream.cpp | 215 ++
.../core/src/impl/interop/interop_memory.cpp | 182 ++
.../src/impl/interop/interop_output_stream.cpp | 215 ++
.../impl/portable/portable_metadata_handler.cpp | 78 +
.../impl/portable/portable_metadata_manager.cpp | 201 ++
.../portable/portable_metadata_snapshot.cpp | 70 +
.../impl/portable/portable_metadata_updater.cpp | 32 +
.../portable/portable_metadata_updater_impl.cpp | 94 +
.../src/impl/portable/portable_reader_impl.cpp | 683 ++++++
.../core/src/impl/portable/portable_utils.cpp | 214 ++
.../src/impl/portable/portable_writer_impl.cpp | 600 +++++
.../core/src/portable/portable_containers.cpp | 76 +
.../core/src/portable/portable_raw_reader.cpp | 135 ++
.../core/src/portable/portable_raw_writer.cpp | 147 ++
.../cpp/core/src/portable/portable_reader.cpp | 142 ++
.../cpp/core/src/portable/portable_type.cpp | 51 +
.../cpp/core/src/portable/portable_writer.cpp | 154 ++
modules/platform/cpp/examples/Makefile.am | 39 +
modules/platform/cpp/examples/README.txt | 42 +
.../cpp/examples/config/example-cache.xml | 77 +
modules/platform/cpp/examples/configure.ac | 38 +
.../platform/cpp/examples/include/Makefile.am | 21 +
.../examples/include/ignite/examples/address.h | 109 +
.../include/ignite/examples/organization.h | 111 +
.../cpp/examples/project/vs/ignite-examples.sln | 19 +
.../examples/project/vs/ignite-examples.vcxproj | 107 +
.../project/vs/ignite-examples.vcxproj.filters | 30 +
.../platform/cpp/examples/src/putgetexample.cpp | 126 +
modules/platform/cpp/project/vs/ignite.sln | 46 +
modules/platform/cpp/project/vs/ignite.slnrel | 33 +
.../platform/cpp/project/vs/ignite_x86.slnrel | 33 +
modules/platform/src/main/cpp/README.txt | 101 -
.../platform/src/main/cpp/common/Makefile.am | 45 -
.../platform/src/main/cpp/common/configure.ac | 62 -
.../src/main/cpp/common/ignite-common.pc.in | 9 -
.../src/main/cpp/common/include/Makefile.am | 22 -
.../common/include/ignite/common/concurrent.h | 210 --
.../cpp/common/include/ignite/common/exports.h | 145 --
.../cpp/common/include/ignite/common/java.h | 652 ------
.../cpp/common/os/linux/include/Makefile.am | 21 -
.../os/linux/include/ignite/common/common.h | 81 -
.../linux/include/ignite/common/concurrent_os.h | 394 ----
.../src/main/cpp/common/os/linux/src/common.cpp | 59 -
.../cpp/common/os/linux/src/concurrent_os.cpp | 175 --
.../os/win/include/ignite/common/common.h | 56 -
.../win/include/ignite/common/concurrent_os.h | 406 ----
.../src/main/cpp/common/os/win/src/common.cpp | 65 -
.../cpp/common/os/win/src/concurrent_os.cpp | 151 --
.../src/main/cpp/common/project/README.TXT | 1 -
.../src/main/cpp/common/project/vs/README.TXT | 1 -
.../main/cpp/common/project/vs/common.vcxproj | 202 --
.../common/project/vs/common.vcxproj.filters | 54 -
.../src/main/cpp/common/project/vs/module.def | 99 -
.../src/main/cpp/common/project/vs/targetver.h | 25 -
.../src/main/cpp/common/src/concurrent.cpp | 94 -
.../src/main/cpp/common/src/exports.cpp | 413 ----
.../platform/src/main/cpp/common/src/java.cpp | 2205 ------------------
.../platform/src/main/cpp/core-test/Makefile.am | 49 -
.../main/cpp/core-test/config/cache-query.xml | 91 -
.../main/cpp/core-test/config/cache-test.xml | 129 -
.../src/main/cpp/core-test/configure.ac | 62 -
.../src/main/cpp/core-test/include/Makefile.am | 22 -
.../include/ignite/portable_test_defs.h | 320 ---
.../include/ignite/portable_test_utils.h | 516 ----
.../cpp/core-test/include/teamcity_messages.h | 55 -
.../src/main/cpp/core-test/project/README.TXT | 1 -
.../main/cpp/core-test/project/vs/README.TXT | 1 -
.../cpp/core-test/project/vs/core-test.vcxproj | 174 --
.../project/vs/core-test.vcxproj.filters | 68 -
.../main/cpp/core-test/src/cache_query_test.cpp | 656 ------
.../src/main/cpp/core-test/src/cache_test.cpp | 486 ----
.../main/cpp/core-test/src/concurrent_test.cpp | 186 --
.../cpp/core-test/src/handle_registry_test.cpp | 176 --
.../main/cpp/core-test/src/ignition_test.cpp | 102 -
.../src/portable_reader_writer_raw_test.cpp | 1532 ------------
.../src/portable_reader_writer_test.cpp | 1951 ----------------
.../cpp/core-test/src/portable_session_test.cpp | 257 --
.../cpp/core-test/src/portable_test_defs.cpp | 65 -
.../main/cpp/core-test/src/teamcity_boost.cpp | 159 --
.../cpp/core-test/src/teamcity_messages.cpp | 150 --
modules/platform/src/main/cpp/core/Makefile.am | 66 -
modules/platform/src/main/cpp/core/configure.ac | 62 -
modules/platform/src/main/cpp/core/ignite.pc.in | 9 -
.../src/main/cpp/core/include/Makefile.am | 61 -
.../main/cpp/core/include/ignite/cache/cache.h | 1153 ---------
.../cpp/core/include/ignite/cache/cache_entry.h | 118 -
.../core/include/ignite/cache/cache_peek_mode.h | 71 -
.../cpp/core/include/ignite/cache/query/query.h | 27 -
.../include/ignite/cache/query/query_argument.h | 125 -
.../include/ignite/cache/query/query_cursor.h | 191 --
.../include/ignite/cache/query/query_scan.h | 151 --
.../core/include/ignite/cache/query/query_sql.h | 253 --
.../include/ignite/cache/query/query_text.h | 159 --
.../src/main/cpp/core/include/ignite/guid.h | 112 -
.../src/main/cpp/core/include/ignite/ignite.h | 154 --
.../core/include/ignite/ignite_configuration.h | 92 -
.../main/cpp/core/include/ignite/ignite_error.h | 260 ---
.../src/main/cpp/core/include/ignite/ignition.h | 195 --
.../core/include/ignite/impl/cache/cache_impl.h | 418 ----
.../ignite/impl/cache/query/query_impl.h | 115 -
.../core/include/ignite/impl/handle_registry.h | 202 --
.../include/ignite/impl/ignite_environment.h | 130 --
.../cpp/core/include/ignite/impl/ignite_impl.h | 146 --
.../core/include/ignite/impl/interop/interop.h | 25 -
.../ignite/impl/interop/interop_input_stream.h | 234 --
.../ignite/impl/interop/interop_memory.h | 280 ---
.../ignite/impl/interop/interop_output_stream.h | 234 --
.../cpp/core/include/ignite/impl/operations.h | 452 ----
.../ignite/impl/portable/portable_common.h | 146 --
.../ignite/impl/portable/portable_id_resolver.h | 106 -
.../impl/portable/portable_metadata_handler.h | 102 -
.../impl/portable/portable_metadata_manager.h | 120 -
.../impl/portable/portable_metadata_snapshot.h | 122 -
.../impl/portable/portable_metadata_updater.h | 53 -
.../portable/portable_metadata_updater_impl.h | 65 -
.../ignite/impl/portable/portable_reader_impl.h | 1130 ---------
.../ignite/impl/portable/portable_utils.h | 344 ---
.../ignite/impl/portable/portable_writer_impl.h | 859 -------
.../cpp/core/include/ignite/portable/portable.h | 29 -
.../include/ignite/portable/portable_consts.h | 106 -
.../ignite/portable/portable_containers.h | 525 -----
.../ignite/portable/portable_raw_reader.h | 324 ---
.../ignite/portable/portable_raw_writer.h | 300 ---
.../include/ignite/portable/portable_reader.h | 355 ---
.../include/ignite/portable/portable_type.h | 293 ---
.../include/ignite/portable/portable_writer.h | 335 ---
.../main/cpp/core/os/linux/include/Makefile.am | 20 -
.../core/os/linux/include/ignite/impl/utils.h | 155 --
.../main/cpp/core/os/linux/src/impl/utils.cpp | 439 ----
.../cpp/core/os/win/include/ignite/impl/utils.h | 155 --
.../src/main/cpp/core/os/win/src/impl/utils.cpp | 453 ----
.../src/main/cpp/core/project/README.TXT | 1 -
.../src/main/cpp/core/project/vs/README.TXT | 1 -
.../src/main/cpp/core/project/vs/core.vcxproj | 272 ---
.../cpp/core/project/vs/core.vcxproj.filters | 246 --
modules/platform/src/main/cpp/core/src/guid.cpp | 65 -
.../platform/src/main/cpp/core/src/ignite.cpp | 43 -
.../src/main/cpp/core/src/ignite_error.cpp | 222 --
.../platform/src/main/cpp/core/src/ignition.cpp | 468 ----
.../main/cpp/core/src/impl/cache/cache_impl.cpp | 388 ---
.../core/src/impl/cache/query/query_impl.cpp | 193 --
.../main/cpp/core/src/impl/handle_registry.cpp | 234 --
.../cpp/core/src/impl/ignite_environment.cpp | 167 --
.../src/main/cpp/core/src/impl/ignite_impl.cpp | 42 -
.../src/impl/interop/interop_input_stream.cpp | 215 --
.../core/src/impl/interop/interop_memory.cpp | 182 --
.../src/impl/interop/interop_output_stream.cpp | 215 --
.../impl/portable/portable_metadata_handler.cpp | 78 -
.../impl/portable/portable_metadata_manager.cpp | 201 --
.../portable/portable_metadata_snapshot.cpp | 70 -
.../impl/portable/portable_metadata_updater.cpp | 32 -
.../portable/portable_metadata_updater_impl.cpp | 94 -
.../src/impl/portable/portable_reader_impl.cpp | 683 ------
.../core/src/impl/portable/portable_utils.cpp | 214 --
.../src/impl/portable/portable_writer_impl.cpp | 600 -----
.../core/src/portable/portable_containers.cpp | 76 -
.../core/src/portable/portable_raw_reader.cpp | 135 --
.../core/src/portable/portable_raw_writer.cpp | 147 --
.../cpp/core/src/portable/portable_reader.cpp | 142 --
.../cpp/core/src/portable/portable_type.cpp | 51 -
.../cpp/core/src/portable/portable_writer.cpp | 154 --
.../platform/src/main/cpp/examples/Makefile.am | 39 -
.../platform/src/main/cpp/examples/README.txt | 42 -
.../main/cpp/examples/config/example-cache.xml | 77 -
.../platform/src/main/cpp/examples/configure.ac | 38 -
.../src/main/cpp/examples/include/Makefile.am | 21 -
.../examples/include/ignite/examples/address.h | 109 -
.../include/ignite/examples/organization.h | 111 -
.../cpp/examples/project/vs/ignite-examples.sln | 19 -
.../examples/project/vs/ignite-examples.vcxproj | 107 -
.../project/vs/ignite-examples.vcxproj.filters | 30 -
.../src/main/cpp/examples/src/putgetexample.cpp | 126 -
.../platform/src/main/cpp/project/vs/ignite.sln | 46 -
.../src/main/cpp/project/vs/ignite.slnrel | 33 -
.../src/main/cpp/project/vs/ignite_x86.slnrel | 33 -
288 files changed, 31449 insertions(+), 31449 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/README.txt
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/README.txt b/modules/platform/cpp/README.txt
new file mode 100644
index 0000000..c9e6999
--- /dev/null
+++ b/modules/platform/cpp/README.txt
@@ -0,0 +1,101 @@
+Apache Ignite for C++
+==================================
+
+Ignite C++ provides data grid functionality.
+Using Ignite C++ APIs you can execute perform concurrent operations on
+the data stored in cache.
+
+Ignite C++ can access cluster and share data with .Net and
+Java applications using portable object format.
+
+Support for the following will be added in next releases:
+ * ACID transactions management.
+ * Distributed locks.
+ * Async operations.
+ * Cache SQL queries and continuous queries.
+ * Event listening.
+ * Compute grid functionality.
+
+Full source code is provided. Users should build the library for intended platform.
+
+Building on Linux With Autotools
+----------------------------------
+
+Common Requirements:
+
+ * GCC, g++, autotools, automake, and libtool must be installed
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+
+Building the library:
+
+ * Build Ignite C++ helper "common" library:
+ * Navigate to the directory $IGNITE_HOME/platforms/cpp/src/common
+ * Execute the following commands one by one:
+ * libtoolize
+ * aclocal
+ * autoheader
+ * automake --add-missing
+ * autoreconf
+ * ./configure
+ * make
+ * make install
+ * Build Ignite C++ library:
+ * Navigate to the directory $IGNITE_HOME/platforms/cpp/src/core
+ * Execute the following commands one by one:
+ * libtoolize
+ * aclocal
+ * autoheader
+ * automake --add-missing
+ * autoreconf
+ * ./configure
+ * make
+ * make install
+
+NOTE: "make install" command may require superuser privileges. In this case it must be
+executed as "sudo make install".
+
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Once both libraries are built and installed, required headers are placed in the
+ "/usr/local/include/ignite" directory.
+ * Ignite C++ depends on jni.h file located inside ${JAVA_HOME}/include directory.
+ Add this directory to headers search path: "-I${JAVA_HOME}/include".
+ * Library is placed in the "/usr/local/lib" directory. Link it to your project: "-lignite".
+ * Ignite depends on "libjvm.so" library shipped with Java. Typically this library is located inside
+ $JAVA_HOME/jre/lib/amd64/server directory. Ensure that LD_LIBRARY_PATH environment variable points to this directory.
+
+
+Building on Windows with Visual Studio (tm)
+----------------------------------
+
+Common Requirements:
+
+ * Microsoft Visual Studio (tm) 2010 or later
+ * Windows SDK 7.1
+ * Java Development Kit (JDK) must be installed: https://java.com/en/download/index.jsp
+ * JAVA_HOME environment variable must be set pointing to Java installation directory.
+
+Building the library:
+
+ * Open and build %IGNITE_HOME%\platforms\cpp\src\project\vs\ignite.sln (or ignite_86.sln if you are running
+ 32-bit platform).
+
+Development:
+
+ * IGNITE_HOME environment variable must be set to Ignite installation directory.
+ * Update Include Directories in Project Properties with paths to:
+ * $(IGNITE_HOME)\platforms\cpp\src\core\include
+ * $(IGNITE_HOME)\platforms\cpp\src\core\os\win\include
+ * $(IGNITE_HOME)\platforms\cpp\src\common\include
+ * $(IGNITE_HOME)\platforms\cpp\src\common\os\win\include
+ * $(JAVA_HOME)\include
+ * $(JAVA_HOME)\include\win32
+ * Update Library Directories with path to the built binaries
+ * Update Linker\Input\Additional Dependencies in Project Properties with path to
+ * ignite.common.lib
+ * ignite.core.lib
+ * Make sure that your application is aware about ignite.common.dll and ignite.core.dll libraries. The easiest way
+ to achieve this is to either make sure these files are in %PATH%, or to put them into the output directory of
+ your project with help of PostBuild events.
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/Makefile.am b/modules/platform/cpp/common/Makefile.am
new file mode 100644
index 0000000..f5ca5dd
--- /dev/null
+++ b/modules/platform/cpp/common/Makefile.am
@@ -0,0 +1,45 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+SUBDIRS = . include os/linux/include
+DIST_SUBDIRS = . include os/linux/include
+
+AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/os/linux/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
+AM_CXXFLAGS = -Wall -std=c++0x
+LIB_LDFLAGS = -no-undefined -version-info 1
+
+COMMON_SRC = os/linux/src/concurrent_os.cpp \
+ src/concurrent.cpp \
+ src/java.cpp \
+ src/exports.cpp \
+ os/linux/src/common.cpp
+
+lib_LTLIBRARIES = libignite-common.la
+libignite_common_la_SOURCES = $(COMMON_SRC)
+libignite_common_la_LIBADD = -L$(JAVA_HOME)/jre/lib/amd64/server
+libignite_common_la_LDFLAGS = $(LIB_LDFLAGS) -L/usr/local/lib -ljvm -version-info 0:0:0 -release $(PACKAGE_VERSION)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ignite-common.pc
+
+clean-local:
+ $(RM) *.gcno *.gcda
+
+clean-docs:
+ $(RM) $(DX_CLEANFILES)
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/configure.ac b/modules/platform/cpp/common/configure.ac
new file mode 100644
index 0000000..5cab969
--- /dev/null
+++ b/modules/platform/cpp/common/configure.ac
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([Apache Ignite JNI bridge for C++], [1.5.0], [dev@ignite.apache.org], [ignite-common], [ignite.apache.org])
+AC_CONFIG_SRCDIR(src)
+
+AC_CANONICAL_SYSTEM
+AC_CONFIG_MACRO_DIR([m4])
+AC_LANG([C++])
+
+# Initialize automake
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_CONFIG_HEADER(config.h)
+
+AM_PROG_AR
+
+# Checks for programs.
+GXX="-g -O2"
+
+AC_PROG_CXX
+
+# Initialize Libtool
+LT_INIT
+
+# Checks for libraries.
+AC_CHECK_LIB([pthread], [pthread_mutex_lock])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+
+AC_CONFIG_FILES(Makefile include/Makefile os/linux/include/Makefile ignite-common.pc)
+
+AC_OUTPUT
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/ignite-common.pc.in
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/ignite-common.pc.in b/modules/platform/cpp/common/ignite-common.pc.in
new file mode 100644
index 0000000..b8c40d2
--- /dev/null
+++ b/modules/platform/cpp/common/ignite-common.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ignite-common
+Description: Apache Ignite JNI bridge for C++.
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lignite-common
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/Makefile.am b/modules/platform/cpp/common/include/Makefile.am
new file mode 100644
index 0000000..5db1d4a
--- /dev/null
+++ b/modules/platform/cpp/common/include/Makefile.am
@@ -0,0 +1,22 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/common/concurrent.h \
+ ignite/common/java.h \
+ ignite/common/exports.h
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/ignite/common/concurrent.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/ignite/common/concurrent.h b/modules/platform/cpp/common/include/ignite/common/concurrent.h
new file mode 100644
index 0000000..1c9ab22
--- /dev/null
+++ b/modules/platform/cpp/common/include/ignite/common/concurrent.h
@@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_CONCURRENT
+#define _IGNITE_COMMON_CONCURRENT
+
+#include "ignite/common/concurrent_os.h"
+
+namespace ignite
+{
+ namespace common
+ {
+ namespace concurrent
+ {
+ /**
+ * Default deleter implementation.
+ *
+ * @param obj Object to be deleted.
+ */
+ template<typename T>
+ IGNITE_IMPORT_EXPORT void SharedPointerDefaultDeleter(T* obj)
+ {
+ delete obj;
+ }
+
+ /**
+ * Holder of shared pointer data.
+ */
+ class IGNITE_IMPORT_EXPORT SharedPointerImpl
+ {
+ public:
+ /**
+ * Constructor.
+ *
+ * @param ptr Raw pointer.
+ */
+ SharedPointerImpl(void* ptr);
+
+ /**
+ * Get raw pointer.
+ *
+ * @return Raw pointer.
+ */
+ void* Pointer();
+
+ /**
+ * Increment usage counter.
+ */
+ void Increment();
+
+ /**
+ * Decrement usage counter.
+ *
+ * @return True if counter reached zero.
+ */
+ bool Decrement();
+ private:
+ /** Raw pointer. */
+ void* ptr;
+
+ /** Reference count. */
+ int32_t refCnt;
+
+ IGNITE_NO_COPY_ASSIGNMENT(SharedPointerImpl)
+ };
+
+ /**
+ * Shared pointer.
+ */
+ template<typename T>
+ class IGNITE_IMPORT_EXPORT SharedPointer
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ SharedPointer() : impl(NULL), deleter(NULL)
+ {
+ // No-op.
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ptr Raw pointer.
+ */
+ explicit SharedPointer(T* ptr)
+ {
+ if (ptr)
+ {
+ impl = new SharedPointerImpl(ptr);
+ deleter = SharedPointerDefaultDeleter;
+ }
+ else
+ {
+ impl = NULL;
+ deleter = NULL;
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param ptr Raw pointer.
+ * @param deleter Delete function.
+ */
+ SharedPointer(T* ptr, void(*deleter)(T*))
+ {
+ if (ptr)
+ {
+ this->impl = new SharedPointerImpl(ptr);
+ this->deleter = deleter;
+ }
+ else
+ {
+ this->impl = NULL;
+ this->deleter = NULL;
+ }
+ }
+
+ /**
+ * Copy constructor.
+ *
+ * @param other Instance to copy.
+ */
+ SharedPointer(const SharedPointer& other)
+ {
+ impl = other.impl;
+ deleter = other.deleter;
+
+ if (impl)
+ impl->Increment();
+ }
+
+ /**
+ * Assignment operator.
+ *
+ * @param other Other instance.
+ */
+ SharedPointer& operator=(const SharedPointer& other)
+ {
+ if (this != &other)
+ {
+ // 1. Create new instance.
+ SharedPointer tmp(other);
+
+ // 2. Swap with temp.
+ SharedPointerImpl* impl0 = impl;
+ void(*deleter0)(T*) = deleter;
+
+ impl = tmp.impl;
+ deleter = tmp.deleter;
+
+ tmp.impl = impl0;
+ tmp.deleter = deleter0;
+ }
+
+ return *this;
+ }
+
+ /**
+ * Destructor.
+ */
+ ~SharedPointer()
+ {
+ if (impl && impl->Decrement())
+ {
+ T* ptr = Get();
+
+ delete impl;
+
+ deleter(ptr);
+ }
+ }
+
+ /**
+ * Get raw pointer.
+ *
+ * @return Raw pointer.
+ */
+ T* Get()
+ {
+ return impl ? static_cast<T*>(impl->Pointer()) : NULL;
+ }
+ private:
+ /** Implementation. */
+ SharedPointerImpl* impl;
+
+ /** Delete function. */
+ void(*deleter)(T*);
+ };
+ }
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/ignite/common/exports.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/ignite/common/exports.h b/modules/platform/cpp/common/include/ignite/common/exports.h
new file mode 100644
index 0000000..930fad3
--- /dev/null
+++ b/modules/platform/cpp/common/include/ignite/common/exports.h
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_EXPORTS
+#define _IGNITE_COMMON_EXPORTS
+
+#include "ignite/common/java.h"
+
+namespace gcj = ignite::common::java;
+
+extern "C" {
+ int IGNITE_CALL IgniteReallocate(long long memPtr, int cap);
+
+ void* IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, long long dataPtr);
+ void* IGNITE_CALL IgniteIgnitionInstance(gcj::JniContext* ctx, char* name);
+ long long IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name);
+ bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel);
+ void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel);
+
+ void IGNITE_CALL IgniteProcessorReleaseStart(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProcessorProjection(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProcessorCache(gcj::JniContext* ctx, void* obj, char* name);
+ void* IGNITE_CALL IgniteProcessorCreateCache(gcj::JniContext* ctx, void* obj, char* name);
+ void* IGNITE_CALL IgniteProcessorGetOrCreateCache(gcj::JniContext* ctx, void* obj, char* name);
+ void* IGNITE_CALL IgniteProcessorAffinity(gcj::JniContext* ctx, void* obj, char* name);
+ void* IGNITE_CALL IgniteProcessorDataStreamer(gcj::JniContext* ctx, void* obj, char* name, bool keepPortable);
+ void* IGNITE_CALL IgniteProcessorTransactions(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProcessorCompute(gcj::JniContext* ctx, void* obj, void* prj);
+ void* IGNITE_CALL IgniteProcessorMessage(gcj::JniContext* ctx, void* obj, void* prj);
+ void* IGNITE_CALL IgniteProcessorEvents(gcj::JniContext* ctx, void* obj, void* prj);
+ void* IGNITE_CALL IgniteProcessorServices(gcj::JniContext* ctx, void* obj, void* prj);
+ void* IGNITE_CALL IgniteProcessorExtensions(gcj::JniContext* ctx, void* obj);
+
+ long long IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
+ void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, long long inMemPtr, long long outMemPtr);
+ void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
+ void IGNITE_CALL IgniteTargetInObjectStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, long long inMemPtr, long long outMemPtr);
+ long long IGNITE_CALL IgniteTargetOutLong(gcj::JniContext* ctx, void* obj, int opType);
+ void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, long long memPtr);
+ void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType);
+ void IGNITE_CALL IgniteTargetListenFuture(gcj::JniContext* ctx, void* obj, long long futId, int typ);
+ void IGNITE_CALL IgniteTargetListenFutureForOperation(gcj::JniContext* ctx, void* obj, long long futId, int typ, int opId);
+
+ int IGNITE_CALL IgniteAffinityPartitions(gcj::JniContext* ctx, void* obj);
+
+ void* IGNITE_CALL IgniteCacheWithSkipStore(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteCacheWithNoRetries(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteCacheWithExpiryPolicy(gcj::JniContext* ctx, void* obj, long long create, long long update, long long access);
+ void* IGNITE_CALL IgniteCacheWithAsync(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteCacheWithKeepPortable(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteCacheClear(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteCacheRemoveAll(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteCacheOutOpQueryCursor(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
+ void* IGNITE_CALL IgniteCacheOutOpContinuousQuery(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
+ void* IGNITE_CALL IgniteCacheIterator(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteCacheLocalIterator(gcj::JniContext* ctx, void* obj, int peekModes);
+ void IGNITE_CALL IgniteCacheEnterLock(gcj::JniContext* ctx, void* obj, long long id);
+ void IGNITE_CALL IgniteCacheExitLock(gcj::JniContext* ctx, void* obj, long long id);
+ bool IGNITE_CALL IgniteCacheTryEnterLock(gcj::JniContext* ctx, void* obj, long long id, long long timeout);
+ void IGNITE_CALL IgniteCacheCloseLock(gcj::JniContext* ctx, void* obj, long long id);
+ void IGNITE_CALL IgniteCacheRebalance(gcj::JniContext* ctx, void* obj, long long futId);
+ int IGNITE_CALL IgniteCacheSize(gcj::JniContext* ctx, void* obj, int peekModes, bool loc);
+
+ void IGNITE_CALL IgniteCacheStoreCallbackInvoke(gcj::JniContext* ctx, void* obj, long long memPtr);
+
+ void IGNITE_CALL IgniteComputeWithNoFailover(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteComputeWithTimeout(gcj::JniContext* ctx, void* obj, long long timeout);
+ void IGNITE_CALL IgniteComputeExecuteNative(gcj::JniContext* ctx, void* obj, long long taskPtr, long long topVer);
+
+ void IGNITE_CALL IgniteContinuousQueryClose(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteContinuousQueryGetInitialQueryCursor(gcj::JniContext* ctx, void* obj);
+
+ void IGNITE_CALL IgniteDataStreamerListenTopology(gcj::JniContext* ctx, void* obj, long long ptr);
+ bool IGNITE_CALL IgniteDataStreamerAllowOverwriteGet(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteDataStreamerAllowOverwriteSet(gcj::JniContext* ctx, void* obj, bool val);
+ bool IGNITE_CALL IgniteDataStreamerSkipStoreGet(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteDataStreamerSkipStoreSet(gcj::JniContext* ctx, void* obj, bool val);
+ int IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeGet(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteDataStreamerPerNodeBufferSizeSet(gcj::JniContext* ctx, void* obj, int val);
+ int IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsGet(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteDataStreamerPerNodeParallelOperationsSet(gcj::JniContext* ctx, void* obj, int val);
+
+ void* IGNITE_CALL IgniteMessagingWithAsync(gcj::JniContext* ctx, void* obj);
+
+ void* IGNITE_CALL IgniteProjectionForOthers(gcj::JniContext* ctx, void* obj, void* prj);
+ void* IGNITE_CALL IgniteProjectionForRemotes(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProjectionForDaemons(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProjectionForRandom(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProjectionForOldest(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProjectionForYoungest(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteProjectionResetMetrics(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteProjectionOutOpRet(gcj::JniContext* ctx, void* obj, int type, long long memPtr);
+
+ void IGNITE_CALL IgniteQueryCursorIterator(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteQueryCursorClose(gcj::JniContext* ctx, void* obj);
+
+ long long IGNITE_CALL IgniteTransactionsStart(gcj::JniContext* ctx, void* obj, int concurrency, int isolation, long long timeout, int txSize);
+ int IGNITE_CALL IgniteTransactionsCommit(gcj::JniContext* ctx, void* obj, long long id);
+ void IGNITE_CALL IgniteTransactionsCommitAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId);
+ int IGNITE_CALL IgniteTransactionsRollback(gcj::JniContext* ctx, void* obj, long long id);
+ void IGNITE_CALL IgniteTransactionsRollbackAsync(gcj::JniContext* ctx, void* obj, long long id, long long futId);
+ int IGNITE_CALL IgniteTransactionsClose(gcj::JniContext* ctx, void* obj, long long id);
+ int IGNITE_CALL IgniteTransactionsState(gcj::JniContext* ctx, void* obj, long long id);
+ bool IGNITE_CALL IgniteTransactionsSetRollbackOnly(gcj::JniContext* ctx, void* obj, long long id);
+ void IGNITE_CALL IgniteTransactionsResetMetrics(gcj::JniContext* ctx, void* obj);
+
+ void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteRelease(void* obj);
+
+ void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* errMsg);
+
+ int IGNITE_CALL IgniteHandlersSize();
+
+ void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs);
+ void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx);
+
+ void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx);
+
+ void* IGNITE_CALL IgniteEventsWithAsync(gcj::JniContext* ctx, void* obj);
+ bool IGNITE_CALL IgniteEventsStopLocalListen(gcj::JniContext* ctx, void* obj, long long hnd);
+ void IGNITE_CALL IgniteEventsLocalListen(gcj::JniContext* ctx, void* obj, long long hnd, int type);
+ bool IGNITE_CALL IgniteEventsIsEnabled(gcj::JniContext* ctx, void* obj, int type);
+
+ void* IGNITE_CALL IgniteServicesWithAsync(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteServicesWithServerKeepPortable(gcj::JniContext* ctx, void* obj);
+ void IGNITE_CALL IgniteServicesCancel(gcj::JniContext* ctx, void* obj, char* name);
+ void IGNITE_CALL IgniteServicesCancelAll(gcj::JniContext* ctx, void* obj);
+ void* IGNITE_CALL IgniteServicesGetServiceProxy(gcj::JniContext* ctx, void* obj, char* name, bool sticky);
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/include/ignite/common/java.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/include/ignite/common/java.h b/modules/platform/cpp/common/include/ignite/common/java.h
new file mode 100644
index 0000000..01ecbe3
--- /dev/null
+++ b/modules/platform/cpp/common/include/ignite/common/java.h
@@ -0,0 +1,652 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_JVM
+#define _IGNITE_COMMON_JVM
+
+#include <jni.h>
+
+#include "ignite/common/common.h"
+
+namespace ignite
+{
+ namespace common
+ {
+ namespace java
+ {
+ /* Error constants. */
+ const int IGNITE_JNI_ERR_SUCCESS = 0;
+ const int IGNITE_JNI_ERR_GENERIC = 1;
+ const int IGNITE_JNI_ERR_JVM_INIT = 2;
+ const int IGNITE_JNI_ERR_JVM_ATTACH = 3;
+
+ /* Handlers for callbacks from Java. */
+ typedef long long(JNICALL *CacheStoreCreateHandler)(void* target, long long memPtr);
+ typedef int(JNICALL *CacheStoreInvokeHandler)(void* target, long long objPtr, long long memPtr, void* cb);
+ typedef void(JNICALL *CacheStoreDestroyHandler)(void* target, long long objPtr);
+ typedef long long(JNICALL *CacheStoreSessionCreateHandler)(void* target, long long storePtr);
+
+ typedef long long(JNICALL *CacheEntryFilterCreateHandler)(void* target, long long memPtr);
+ typedef int(JNICALL *CacheEntryFilterApplyHandler)(void* target, long long ptr, long long memPtr);
+ typedef void(JNICALL *CacheEntryFilterDestroyHandler)(void* target, long long ptr);
+
+ typedef void(JNICALL *CacheInvokeHandler)(void* target, long long inMemPtr, long long outMemPtr);
+
+ typedef void(JNICALL *ComputeTaskMapHandler)(void* target, long long taskPtr, long long inMemPtr, long long outMemPtr);
+ typedef int(JNICALL *ComputeTaskJobResultHandler)(void* target, long long taskPtr, long long jobPtr, long long memPtr);
+ typedef void(JNICALL *ComputeTaskReduceHandler)(void* target, long long taskPtr);
+ typedef void(JNICALL *ComputeTaskCompleteHandler)(void* target, long long taskPtr, long long memPtr);
+ typedef int(JNICALL *ComputeJobSerializeHandler)(void* target, long long jobPtr, long long memPtr);
+ typedef long long(JNICALL *ComputeJobCreateHandler)(void* target, long long memPtr);
+ typedef void(JNICALL *ComputeJobExecuteHandler)(void* target, long long jobPtr, int cancel, long long memPtr);
+ typedef void(JNICALL *ComputeJobCancelHandler)(void* target, long long jobPtr);
+ typedef void(JNICALL *ComputeJobDestroyHandler)(void* target, long long jobPtr);
+
+ typedef void(JNICALL *ContinuousQueryListenerApplyHandler)(void* target, long long lsnrPtr, long long memPtr);
+ typedef long long(JNICALL *ContinuousQueryFilterCreateHandler)(void* target, long long memPtr);
+ typedef int(JNICALL *ContinuousQueryFilterApplyHandler)(void* target, long long filterPtr, long long memPtr);
+ typedef void(JNICALL *ContinuousQueryFilterReleaseHandler)(void* target, long long filterPtr);
+
+ typedef void(JNICALL *DataStreamerTopologyUpdateHandler)(void* target, long long ldrPtr, long long topVer, int topSize);
+ typedef void(JNICALL *DataStreamerStreamReceiverInvokeHandler)(void* target, long long ptr, void* cache, long long memPtr, unsigned char keepPortable);
+
+ typedef void(JNICALL *FutureByteResultHandler)(void* target, long long futAddr, int res);
+ typedef void(JNICALL *FutureBoolResultHandler)(void* target, long long futAddr, int res);
+ typedef void(JNICALL *FutureShortResultHandler)(void* target, long long futAddr, int res);
+ typedef void(JNICALL *FutureCharResultHandler)(void* target, long long futAddr, int res);
+ typedef void(JNICALL *FutureIntResultHandler)(void* target, long long futAddr, int res);
+ typedef void(JNICALL *FutureFloatResultHandler)(void* target, long long futAddr, float res);
+ typedef void(JNICALL *FutureLongResultHandler)(void* target, long long futAddr, long long res);
+ typedef void(JNICALL *FutureDoubleResultHandler)(void* target, long long futAddr, double res);
+ typedef void(JNICALL *FutureObjectResultHandler)(void* target, long long futAddr, long long memPtr);
+ typedef void(JNICALL *FutureNullResultHandler)(void* target, long long futAddr);
+ typedef void(JNICALL *FutureErrorHandler)(void* target, long long futAddr, long long memPtr);
+
+ typedef void(JNICALL *LifecycleEventHandler)(void* target, long long ptr, int evt);
+
+ typedef void(JNICALL *MemoryReallocateHandler)(void* target, long long memPtr, int cap);
+
+ typedef long long(JNICALL *MessagingFilterCreateHandler)(void* target, long long memPtr);
+ typedef int(JNICALL *MessagingFilterApplyHandler)(void* target, long long ptr, long long memPtr);
+ typedef void(JNICALL *MessagingFilterDestroyHandler)(void* target, long long ptr);
+
+ typedef long long(JNICALL *EventFilterCreateHandler)(void* target, long long memPtr);
+ typedef int(JNICALL *EventFilterApplyHandler)(void* target, long long ptr, long long memPtr);
+ typedef void(JNICALL *EventFilterDestroyHandler)(void* target, long long ptr);
+
+ typedef long long(JNICALL *ServiceInitHandler)(void* target, long long memPtr);
+ typedef void(JNICALL *ServiceExecuteHandler)(void* target, long long svcPtr, long long memPtr);
+ typedef void(JNICALL *ServiceCancelHandler)(void* target, long long svcPtr, long long memPtr);
+ typedef void(JNICALL *ServiceInvokeMethodHandler)(void* target, long long svcPtr, long long inMemPtr, long long outMemPtr);
+ typedef int(JNICALL *ClusterNodeFilterApplyHandler)(void* target, long long memPtr);
+
+ typedef long long(JNICALL *NodeInfoHandler)(void* target, long long memPtr);
+
+ typedef void(JNICALL *OnStartHandler)(void* target, void* proc, long long memPtr);
+ typedef void(JNICALL *OnStopHandler)(void* target);
+ typedef void(JNICALL *ErrorHandler)(void* target, int errCode, const char* errClsChars, int errClsCharsLen, const char* errMsgChars, int errMsgCharsLen, void* errData, int errDataLen);
+
+ typedef long long(JNICALL *ExtensionCallbackInLongOutLongHandler)(void* target, int typ, long long arg1);
+ typedef long long(JNICALL *ExtensionCallbackInLongLongOutLongHandler)(void* target, int typ, long long arg1, long long arg2);
+
+ /**
+ * JNI handlers holder.
+ */
+ struct JniHandlers {
+ void* target;
+
+ CacheStoreCreateHandler cacheStoreCreate;
+ CacheStoreInvokeHandler cacheStoreInvoke;
+ CacheStoreDestroyHandler cacheStoreDestroy;
+ CacheStoreSessionCreateHandler cacheStoreSessionCreate;
+
+ CacheEntryFilterCreateHandler cacheEntryFilterCreate;
+ CacheEntryFilterApplyHandler cacheEntryFilterApply;
+ CacheEntryFilterDestroyHandler cacheEntryFilterDestroy;
+
+ CacheInvokeHandler cacheInvoke;
+
+ ComputeTaskMapHandler computeTaskMap;
+ ComputeTaskJobResultHandler computeTaskJobRes;
+ ComputeTaskReduceHandler computeTaskReduce;
+ ComputeTaskCompleteHandler computeTaskComplete;
+ ComputeJobSerializeHandler computeJobSerialize;
+ ComputeJobCreateHandler computeJobCreate;
+ ComputeJobExecuteHandler computeJobExec;
+ ComputeJobCancelHandler computeJobCancel;
+ ComputeJobDestroyHandler computeJobDestroy;
+
+ ContinuousQueryListenerApplyHandler contQryLsnrApply;
+ ContinuousQueryFilterCreateHandler contQryFilterCreate;
+ ContinuousQueryFilterApplyHandler contQryFilterApply;
+ ContinuousQueryFilterReleaseHandler contQryFilterRelease;
+
+ DataStreamerTopologyUpdateHandler dataStreamerTopologyUpdate;
+ DataStreamerStreamReceiverInvokeHandler streamReceiverInvoke;
+
+ FutureByteResultHandler futByteRes;
+ FutureBoolResultHandler futBoolRes;
+ FutureShortResultHandler futShortRes;
+ FutureCharResultHandler futCharRes;
+ FutureIntResultHandler futIntRes;
+ FutureFloatResultHandler futFloatRes;
+ FutureLongResultHandler futLongRes;
+ FutureDoubleResultHandler futDoubleRes;
+ FutureObjectResultHandler futObjRes;
+ FutureNullResultHandler futNullRes;
+ FutureErrorHandler futErr;
+
+ LifecycleEventHandler lifecycleEvt;
+
+ MemoryReallocateHandler memRealloc;
+
+ MessagingFilterCreateHandler messagingFilterCreate;
+ MessagingFilterApplyHandler messagingFilterApply;
+ MessagingFilterDestroyHandler messagingFilterDestroy;
+
+ EventFilterCreateHandler eventFilterCreate;
+ EventFilterApplyHandler eventFilterApply;
+ EventFilterDestroyHandler eventFilterDestroy;
+
+ ServiceInitHandler serviceInit;
+ ServiceExecuteHandler serviceExecute;
+ ServiceCancelHandler serviceCancel;
+ ServiceInvokeMethodHandler serviceInvokeMethod;
+
+ ClusterNodeFilterApplyHandler clusterNodeFilterApply;
+
+ NodeInfoHandler nodeInfo;
+
+ OnStartHandler onStart;
+ OnStopHandler onStop;
+ ErrorHandler error;
+
+ ExtensionCallbackInLongOutLongHandler extensionCallbackInLongOutLong;
+ ExtensionCallbackInLongLongOutLongHandler extensionCallbackInLongLongOutLong;
+ };
+
+ /**
+ * JNI Java members.
+ */
+ struct JniJavaMembers {
+ jclass c_Class;
+ jmethodID m_Class_getName;
+
+ jclass c_Throwable;
+ jmethodID m_Throwable_getMessage;
+ jmethodID m_Throwable_printStackTrace;
+
+ /**
+ * Constructor.
+ */
+ void Initialize(JNIEnv* env);
+
+ /**
+ * Destroy members releasing all allocated classes.
+ */
+ void Destroy(JNIEnv* env);
+
+ /**
+ * Write error information.
+ */
+ bool WriteErrorInfo(JNIEnv* env, char** errClsName, int* errClsNameLen, char** errMsg, int* errMsgLen);
+ };
+
+ /**
+ * JNI members.
+ */
+ struct JniMembers {
+ jclass c_PlatformAbstractQryCursor;
+ jmethodID m_PlatformAbstractQryCursor_iter;
+ jmethodID m_PlatformAbstractQryCursor_iterHasNext;
+ jmethodID m_PlatformAbstractQryCursor_close;
+
+ jclass c_PlatformAffinity;
+ jmethodID m_PlatformAffinity_partitions;
+
+ jclass c_PlatformCache;
+ jmethodID m_PlatformCache_withSkipStore;
+ jmethodID m_PlatformCache_withNoRetries;
+ jmethodID m_PlatformCache_withExpiryPolicy;
+ jmethodID m_PlatformCache_withAsync;
+ jmethodID m_PlatformCache_withKeepPortable;
+ jmethodID m_PlatformCache_clear;
+ jmethodID m_PlatformCache_removeAll;
+ jmethodID m_PlatformCache_iterator;
+ jmethodID m_PlatformCache_localIterator;
+ jmethodID m_PlatformCache_enterLock;
+ jmethodID m_PlatformCache_exitLock;
+ jmethodID m_PlatformCache_tryEnterLock;
+ jmethodID m_PlatformCache_closeLock;
+ jmethodID m_PlatformCache_rebalance;
+ jmethodID m_PlatformCache_size;
+
+ jclass c_PlatformCacheStoreCallback;
+ jmethodID m_PlatformCacheStoreCallback_invoke;
+
+ jclass c_IgniteException;
+
+ jclass c_PlatformClusterGroup;
+ jmethodID m_PlatformClusterGroup_forOthers;
+ jmethodID m_PlatformClusterGroup_forRemotes;
+ jmethodID m_PlatformClusterGroup_forDaemons;
+ jmethodID m_PlatformClusterGroup_forRandom;
+ jmethodID m_PlatformClusterGroup_forOldest;
+ jmethodID m_PlatformClusterGroup_forYoungest;
+ jmethodID m_PlatformClusterGroup_resetMetrics;
+
+ jclass c_PlatformCompute;
+ jmethodID m_PlatformCompute_withNoFailover;
+ jmethodID m_PlatformCompute_withTimeout;
+ jmethodID m_PlatformCompute_executeNative;
+
+ jclass c_PlatformContinuousQuery;
+ jmethodID m_PlatformContinuousQuery_close;
+ jmethodID m_PlatformContinuousQuery_getInitialQueryCursor;
+
+ jclass c_PlatformDataStreamer;
+ jmethodID m_PlatformDataStreamer_listenTopology;
+ jmethodID m_PlatformDataStreamer_getAllowOverwrite;
+ jmethodID m_PlatformDataStreamer_setAllowOverwrite;
+ jmethodID m_PlatformDataStreamer_getSkipStore;
+ jmethodID m_PlatformDataStreamer_setSkipStore;
+ jmethodID m_PlatformDataStreamer_getPerNodeBufSize;
+ jmethodID m_PlatformDataStreamer_setPerNodeBufSize;
+ jmethodID m_PlatformDataStreamer_getPerNodeParallelOps;
+ jmethodID m_PlatformDataStreamer_setPerNodeParallelOps;
+
+ jclass c_PlatformEvents;
+ jmethodID m_PlatformEvents_withAsync;
+ jmethodID m_PlatformEvents_stopLocalListen;
+ jmethodID m_PlatformEvents_localListen;
+ jmethodID m_PlatformEvents_isEnabled;
+
+ jclass c_PlatformServices;
+ jmethodID m_PlatformServices_withAsync;
+ jmethodID m_PlatformServices_withServerKeepPortable;
+ jmethodID m_PlatformServices_cancel;
+ jmethodID m_PlatformServices_cancelAll;
+ jmethodID m_PlatformServices_serviceProxy;
+
+ jclass c_PlatformIgnition;
+ jmethodID m_PlatformIgnition_start;
+ jmethodID m_PlatformIgnition_instance;
+ jmethodID m_PlatformIgnition_environmentPointer;
+ jmethodID m_PlatformIgnition_stop;
+ jmethodID m_PlatformIgnition_stopAll;
+
+ jclass c_PlatformMessaging;
+ jmethodID m_PlatformMessaging_withAsync;
+
+ jclass c_PlatformProcessor;
+ jmethodID m_PlatformProcessor_releaseStart;
+ jmethodID m_PlatformProcessor_cache;
+ jmethodID m_PlatformProcessor_createCache;
+ jmethodID m_PlatformProcessor_getOrCreateCache;
+ jmethodID m_PlatformProcessor_affinity;
+ jmethodID m_PlatformProcessor_dataStreamer;
+ jmethodID m_PlatformProcessor_transactions;
+ jmethodID m_PlatformProcessor_projection;
+ jmethodID m_PlatformProcessor_compute;
+ jmethodID m_PlatformProcessor_message;
+ jmethodID m_PlatformProcessor_events;
+ jmethodID m_PlatformProcessor_services;
+ jmethodID m_PlatformProcessor_extensions;
+
+ jclass c_PlatformTarget;
+ jmethodID m_PlatformTarget_inStreamOutLong;
+ jmethodID m_PlatformTarget_inStreamOutObject;
+ jmethodID m_PlatformTarget_outLong;
+ jmethodID m_PlatformTarget_outStream;
+ jmethodID m_PlatformTarget_outObject;
+ jmethodID m_PlatformTarget_inStreamOutStream;
+ jmethodID m_PlatformTarget_inObjectStreamOutStream;
+ jmethodID m_PlatformTarget_listenFuture;
+ jmethodID m_PlatformTarget_listenFutureForOperation;
+
+ jclass c_PlatformTransactions;
+ jmethodID m_PlatformTransactions_txStart;
+ jmethodID m_PlatformTransactions_txCommit;
+ jmethodID m_PlatformTransactions_txCommitAsync;
+ jmethodID m_PlatformTransactions_txRollback;
+ jmethodID m_PlatformTransactions_txRollbackAsync;
+ jmethodID m_PlatformTransactions_txState;
+ jmethodID m_PlatformTransactions_txSetRollbackOnly;
+ jmethodID m_PlatformTransactions_txClose;
+ jmethodID m_PlatformTransactions_resetMetrics;
+
+ jclass c_PlatformUtils;
+ jmethodID m_PlatformUtils_reallocate;
+ jmethodID m_PlatformUtils_errData;
+
+ /**
+ * Constructor.
+ */
+ void Initialize(JNIEnv* env);
+
+ /**
+ * Destroy members releasing all allocated classes.
+ */
+ void Destroy(JNIEnv* env);
+ };
+
+ /**
+ * JNI JVM wrapper.
+ */
+ class IGNITE_IMPORT_EXPORT JniJvm {
+ public:
+ /**
+ * Default constructor for uninitialized JVM.
+ */
+ JniJvm();
+
+ /**
+ * Constructor.
+ *
+ * @param jvm JVM.
+ * @param javaMembers Java members.
+ * @param members Members.
+ */
+ JniJvm(JavaVM* jvm, JniJavaMembers javaMembers, JniMembers members);
+
+ /**
+ * Get JVM.
+ *
+ * @param JVM.
+ */
+ JavaVM* GetJvm();
+
+ /**
+ * Get Java members.
+ *
+ * @param Java members.
+ */
+ JniJavaMembers& GetJavaMembers();
+
+ /**
+ * Get members.
+ *
+ * @param Members.
+ */
+ JniMembers& GetMembers();
+ private:
+ /** JVM. */
+ JavaVM* jvm;
+
+ /** Java members. */
+ JniJavaMembers javaMembers;
+
+ /** Members. */
+ JniMembers members;
+ };
+
+ /**
+ * JNI error information.
+ */
+ struct IGNITE_IMPORT_EXPORT JniErrorInfo
+ {
+ int code;
+ char* errCls;
+ char* errMsg;
+
+ /**
+ * Default constructor. Creates empty error info.
+ */
+ JniErrorInfo();
+
+ /**
+ * Constructor.
+ *
+ * @param code Code.
+ * @param errCls Error class.
+ * @param errMsg Error message.
+ */
+ JniErrorInfo(int code, const char* errCls, const char* errMsg);
+
+ /**
+ * Copy constructor.
+ *
+ * @param other Other instance.
+ */
+ JniErrorInfo(const JniErrorInfo& other);
+
+ /**
+ * Assignment operator overload.
+ *
+ * @param other Other instance.
+ * @return This instance.
+ */
+ JniErrorInfo& operator=(const JniErrorInfo& other);
+
+ /**
+ * Destructor.
+ */
+ ~JniErrorInfo();
+ };
+
+ /**
+ * Unmanaged context.
+ */
+ class IGNITE_IMPORT_EXPORT JniContext {
+ public:
+ static JniContext* Create(char** opts, int optsLen, JniHandlers hnds);
+ static JniContext* Create(char** opts, int optsLen, JniHandlers hnds, JniErrorInfo* errInfo);
+ static int Reallocate(long long memPtr, int cap);
+ static void Detach();
+ static void Release(jobject obj);
+
+ jobject IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr);
+ jobject IgnitionStart(char* cfgPath, char* name, int factoryId, long long dataPtr, JniErrorInfo* errInfo);
+ jobject IgnitionInstance(char* name);
+ jobject IgnitionInstance(char* name, JniErrorInfo* errInfo);
+ long long IgnitionEnvironmentPointer(char* name);
+ long long IgnitionEnvironmentPointer(char* name, JniErrorInfo* errInfo);
+ bool IgnitionStop(char* name, bool cancel);
+ bool IgnitionStop(char* name, bool cancel, JniErrorInfo* errInfo);
+ void IgnitionStopAll(bool cancel);
+ void IgnitionStopAll(bool cancel, JniErrorInfo* errInfo);
+
+ void ProcessorReleaseStart(jobject obj);
+ jobject ProcessorProjection(jobject obj);
+ jobject ProcessorCache(jobject obj, const char* name);
+ jobject ProcessorCache(jobject obj, const char* name, JniErrorInfo* errInfo);
+ jobject ProcessorCreateCache(jobject obj, const char* name);
+ jobject ProcessorCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo);
+ jobject ProcessorGetOrCreateCache(jobject obj, const char* name);
+ jobject ProcessorGetOrCreateCache(jobject obj, const char* name, JniErrorInfo* errInfo);
+ jobject ProcessorAffinity(jobject obj, const char* name);
+ jobject ProcessorDataStreamer(jobject obj, const char* name, bool keepPortable);
+ jobject ProcessorTransactions(jobject obj);
+ jobject ProcessorCompute(jobject obj, jobject prj);
+ jobject ProcessorMessage(jobject obj, jobject prj);
+ jobject ProcessorEvents(jobject obj, jobject prj);
+ jobject ProcessorServices(jobject obj, jobject prj);
+ jobject ProcessorExtensions(jobject obj);
+
+ long long TargetInStreamOutLong(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
+ void TargetInStreamOutStream(jobject obj, int opType, long long inMemPtr, long long outMemPtr, JniErrorInfo* errInfo = NULL);
+ jobject TargetInStreamOutObject(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
+ void TargetInObjectStreamOutStream(jobject obj, int opType, void* arg, long long inMemPtr, long long outMemPtr, JniErrorInfo* errInfo = NULL);
+ long long TargetOutLong(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
+ void TargetOutStream(jobject obj, int opType, long long memPtr, JniErrorInfo* errInfo = NULL);
+ jobject TargetOutObject(jobject obj, int opType, JniErrorInfo* errInfo = NULL);
+ void TargetListenFuture(jobject obj, long long futId, int typ);
+ void TargetListenFutureForOperation(jobject obj, long long futId, int typ, int opId);
+
+ int AffinityPartitions(jobject obj);
+
+ jobject CacheWithSkipStore(jobject obj);
+ jobject CacheWithNoRetries(jobject obj);
+ jobject CacheWithExpiryPolicy(jobject obj, long long create, long long update, long long access);
+ jobject CacheWithAsync(jobject obj);
+ jobject CacheWithKeepPortable(jobject obj);
+ void CacheClear(jobject obj, JniErrorInfo* errInfo = NULL);
+ void CacheRemoveAll(jobject obj, JniErrorInfo* errInfo = NULL);
+ jobject CacheOutOpQueryCursor(jobject obj, int type, long long memPtr, JniErrorInfo* errInfo = NULL);
+ jobject CacheOutOpContinuousQuery(jobject obj, int type, long long memPtr);
+ jobject CacheIterator(jobject obj);
+ jobject CacheLocalIterator(jobject obj, int peekModes);
+ void CacheEnterLock(jobject obj, long long id);
+ void CacheExitLock(jobject obj, long long id);
+ bool CacheTryEnterLock(jobject obj, long long id, long long timeout);
+ void CacheCloseLock(jobject obj, long long id);
+ void CacheRebalance(jobject obj, long long futId);
+ int CacheSize(jobject obj, int peekModes, bool loc, JniErrorInfo* errInfo = NULL);
+
+ void CacheStoreCallbackInvoke(jobject obj, long long memPtr);
+
+ void ComputeWithNoFailover(jobject obj);
+ void ComputeWithTimeout(jobject obj, long long timeout);
+ void ComputeExecuteNative(jobject obj, long long taskPtr, long long topVer);
+
+ void ContinuousQueryClose(jobject obj);
+ void* ContinuousQueryGetInitialQueryCursor(jobject obj);
+
+ void DataStreamerListenTopology(jobject obj, long long ptr);
+ bool DataStreamerAllowOverwriteGet(jobject obj);
+ void DataStreamerAllowOverwriteSet(jobject obj, bool val);
+ bool DataStreamerSkipStoreGet(jobject obj);
+ void DataStreamerSkipStoreSet(jobject obj, bool val);
+ int DataStreamerPerNodeBufferSizeGet(jobject obj);
+ void DataStreamerPerNodeBufferSizeSet(jobject obj, int val);
+ int DataStreamerPerNodeParallelOperationsGet(jobject obj);
+ void DataStreamerPerNodeParallelOperationsSet(jobject obj, int val);
+
+ jobject MessagingWithAsync(jobject obj);
+
+ jobject ProjectionForOthers(jobject obj, jobject prj);
+ jobject ProjectionForRemotes(jobject obj);
+ jobject ProjectionForDaemons(jobject obj);
+ jobject ProjectionForRandom(jobject obj);
+ jobject ProjectionForOldest(jobject obj);
+ jobject ProjectionForYoungest(jobject obj);
+ void ProjectionResetMetrics(jobject obj);
+ jobject ProjectionOutOpRet(jobject obj, int type, long long memPtr);
+
+ void QueryCursorIterator(jobject obj, JniErrorInfo* errInfo = NULL);
+ bool QueryCursorIteratorHasNext(jobject obj, JniErrorInfo* errInfo = NULL);
+ void QueryCursorClose(jobject obj, JniErrorInfo* errInfo = NULL);
+
+ long long TransactionsStart(jobject obj, int concurrency, int isolation, long long timeout, int txSize);
+ int TransactionsCommit(jobject obj, long long id);
+ void TransactionsCommitAsync(jobject obj, long long id, long long futId);
+ int TransactionsRollback(jobject obj, long long id);
+ void TransactionsRollbackAsync(jobject obj, long long id, long long futId);
+ int TransactionsClose(jobject obj, long long id);
+ int TransactionsState(jobject obj, long long id);
+ bool TransactionsSetRollbackOnly(jobject obj, long long id);
+ void TransactionsResetMetrics(jobject obj);
+
+ jobject EventsWithAsync(jobject obj);
+ bool EventsStopLocalListen(jobject obj, long long hnd);
+ void EventsLocalListen(jobject obj, long long hnd, int type);
+ bool EventsIsEnabled(jobject obj, int type);
+
+ jobject ServicesWithAsync(jobject obj);
+ jobject ServicesWithServerKeepPortable(jobject obj);
+ void ServicesCancel(jobject obj, char* name);
+ void ServicesCancelAll(jobject obj);
+ void* ServicesGetServiceProxy(jobject obj, char* name, bool sticky);
+
+ jobject Acquire(jobject obj);
+
+ void DestroyJvm();
+ void ThrowToJava(char* errMsg);
+ private:
+ JniJvm* jvm;
+ JniHandlers hnds;
+
+ JniContext(JniJvm* jvm, JniHandlers hnds);
+
+ JNIEnv* Attach();
+ void ExceptionCheck(JNIEnv* env);
+ void ExceptionCheck(JNIEnv* env, JniErrorInfo* errInfo);
+ jobject LocalToGlobal(JNIEnv* env, jobject obj);
+ jobject ProcessorCache0(jobject proc, const char* name, jmethodID mthd, JniErrorInfo* errInfo);
+ };
+
+ JNIEXPORT jlong JNICALL JniCacheStoreCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT jint JNICALL JniCacheStoreInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr, jobject cb);
+ JNIEXPORT void JNICALL JniCacheStoreDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr);
+ JNIEXPORT jlong JNICALL JniCacheStoreSessionCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong storePtr);
+
+ JNIEXPORT jlong JNICALL JniCacheEntryFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT jint JNICALL JniCacheEntryFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniCacheEntryFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong objPtr);
+
+ JNIEXPORT void JNICALL JniCacheInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong inMemPtr, jlong outMemPtr);
+
+ JNIEXPORT void JNICALL JniComputeTaskMap(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong inMemPtr, jlong outMemPtr);
+ JNIEXPORT jint JNICALL JniComputeTaskJobResult(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong jobPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniComputeTaskReduce(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr);
+ JNIEXPORT void JNICALL JniComputeTaskComplete(JNIEnv *env, jclass cls, jlong envPtr, jlong taskPtr, jlong memPtr);
+ JNIEXPORT jint JNICALL JniComputeJobSerialize(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr, jlong memPtr);
+ JNIEXPORT jlong JNICALL JniComputeJobCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniComputeJobExecute(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr, jint cancel, jlong memPtr);
+ JNIEXPORT void JNICALL JniComputeJobCancel(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr);
+ JNIEXPORT void JNICALL JniComputeJobDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong jobPtr);
+
+ JNIEXPORT void JNICALL JniContinuousQueryListenerApply(JNIEnv *env, jclass cls, jlong envPtr, jlong cbPtr, jlong memPtr);
+ JNIEXPORT jlong JNICALL JniContinuousQueryFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT jint JNICALL JniContinuousQueryFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong filterPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniContinuousQueryFilterRelease(JNIEnv *env, jclass cls, jlong envPtr, jlong filterPtr);
+
+ JNIEXPORT void JNICALL JniDataStreamerTopologyUpdate(JNIEnv *env, jclass cls, jlong envPtr, jlong ldrPtr, jlong topVer, jint topSize);
+ JNIEXPORT void JNICALL JniDataStreamerStreamReceiverInvoke(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jobject cache, jlong memPtr, jboolean keepPortable);
+
+ JNIEXPORT void JNICALL JniFutureByteResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+ JNIEXPORT void JNICALL JniFutureBoolResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+ JNIEXPORT void JNICALL JniFutureShortResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+ JNIEXPORT void JNICALL JniFutureCharResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+ JNIEXPORT void JNICALL JniFutureIntResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jint res);
+ JNIEXPORT void JNICALL JniFutureFloatResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jfloat res);
+ JNIEXPORT void JNICALL JniFutureLongResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong res);
+ JNIEXPORT void JNICALL JniFutureDoubleResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jdouble res);
+ JNIEXPORT void JNICALL JniFutureObjectResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniFutureNullResult(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr);
+ JNIEXPORT void JNICALL JniFutureError(JNIEnv *env, jclass cls, jlong envPtr, jlong futPtr, jlong memPtr);
+
+ JNIEXPORT void JNICALL JniLifecycleEvent(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jint evt);
+
+ JNIEXPORT void JNICALL JniMemoryReallocate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr, jint cap);
+
+ JNIEXPORT jlong JNICALL JniMessagingFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT jint JNICALL JniMessagingFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jlong memPtr);
+ JNIEXPORT void JNICALL JniMessagingFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr);
+
+ JNIEXPORT jlong JNICALL JniEventFilterCreate(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT jint JNICALL JniEventFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr, jlong memPtr);
+ JNIEXPORT void JNICALL JniEventFilterDestroy(JNIEnv *env, jclass cls, jlong envPtr, jlong ptr);
+
+ JNIEXPORT jlong JNICALL JniServiceInit(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniServiceExecute(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniServiceCancel(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong memPtr);
+ JNIEXPORT void JNICALL JniServiceInvokeMethod(JNIEnv *env, jclass cls, jlong envPtr, jlong svcPtr, jlong inMemPtr, jlong outMemPtr);
+ JNIEXPORT jint JNICALL JniClusterNodeFilterApply(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+
+ JNIEXPORT jlong JNICALL JniNodeInfo(JNIEnv *env, jclass cls, jlong envPtr, jlong memPtr);
+
+ JNIEXPORT void JNICALL JniOnStart(JNIEnv *env, jclass cls, jlong envPtr, jobject proc, jlong memPtr);
+ JNIEXPORT void JNICALL JniOnStop(JNIEnv *env, jclass cls, jlong envPtr);
+
+ JNIEXPORT jlong JNICALL JniExtensionCallbackInLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1);
+ JNIEXPORT jlong JNICALL JniExtensionCallbackInLongLongOutLong(JNIEnv *env, jclass cls, jlong envPtr, jint typ, jlong arg1, jlong arg2);
+ }
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/include/Makefile.am b/modules/platform/cpp/common/os/linux/include/Makefile.am
new file mode 100644
index 0000000..68e45e6
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/include/Makefile.am
@@ -0,0 +1,21 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+ACLOCAL_AMFLAGS = "-Im4"
+
+nobase_include_HEADERS = ignite/common/common.h \
+ ignite/common/concurrent_os.h
http://git-wip-us.apache.org/repos/asf/ignite/blob/524f5653/modules/platform/cpp/common/os/linux/include/ignite/common/common.h
----------------------------------------------------------------------
diff --git a/modules/platform/cpp/common/os/linux/include/ignite/common/common.h b/modules/platform/cpp/common/os/linux/include/ignite/common/common.h
new file mode 100644
index 0000000..6577ad8
--- /dev/null
+++ b/modules/platform/cpp/common/os/linux/include/ignite/common/common.h
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _IGNITE_COMMON_OS
+#define _IGNITE_COMMON_OS
+
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+
+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
+ #define IGNITE_EXPORT __attribute__((visibility("default")))
+ #define IGNITE_IMPORT __attribute__((visibility("default")))
+#else
+ #define IGNITE_EXPORT
+ #define IGNITE_IMPORT
+#endif
+
+#define IGNITE_CALL
+
+#ifdef IGNITE_IMPL
+ #define IGNITE_IMPORT_EXPORT IGNITE_EXPORT
+#else
+ #define IGNITE_IMPORT_EXPORT IGNITE_IMPORT
+#endif
+
+/**
+ * Common construction to disable copy constructor and assignment for class.
+ */
+#define IGNITE_NO_COPY_ASSIGNMENT(cls) \
+ cls(const cls& src); \
+ cls& operator= (const cls& other);
+
+namespace ignite
+{
+ namespace common
+ {
+ /**
+ * Helper class to manage attached threads.
+ */
+ class AttachHelper
+ {
+ public:
+ /**
+ * Destructor.
+ */
+ ~AttachHelper();
+
+ /**
+ * Callback invoked on successful thread attach ot JVM.
+ */
+ static void OnThreadAttach();
+ private:
+ /**
+ * Helper method to allocate attach key.
+ */
+ static void AllocateAttachKey();
+
+ /**
+ * Attach key destructor.
+ */
+ static void DestroyAttachKey(void* key);
+ };
+ }
+}
+
+#endif
\ No newline at end of file