You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/10/28 15:18:26 UTC
[03/10] ignite git commit: IGNITE-1467: Created standalone CPP
application.
IGNITE-1467: Created standalone CPP application.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/40978109
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/40978109
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/40978109
Branch: refs/heads/ignite-1753-1282
Commit: 40978109fc0996caab6b26ba797e33d3e1e6d235
Parents: 05e739f
Author: isapego <is...@gridgain.com>
Authored: Tue Oct 27 14:07:29 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Oct 27 14:07:29 2015 +0300
----------------------------------------------------------------------
.../platforms/cpp/common/include/Makefile.am | 3 +-
.../cpp/common/include/ignite/common/utils.h | 81 +++++++
.../cpp/common/project/vs/common.vcxproj | 1 +
.../common/project/vs/common.vcxproj.filters | 3 +
.../cpp/core-test/src/cache_query_test.cpp | 21 +-
.../platforms/cpp/core-test/src/cache_test.cpp | 19 +-
.../cpp/core-test/src/ignition_test.cpp | 19 +-
.../platforms/cpp/core/include/ignite/ignite.h | 1 +
.../core/include/ignite/ignite_configuration.h | 81 +------
.../cpp/core/include/ignite/impl/ignite_impl.h | 27 ++-
modules/platforms/cpp/core/src/ignition.cpp | 18 +-
.../platforms/cpp/core/src/impl/ignite_impl.cpp | 5 +
modules/platforms/cpp/ignite/Makefile.am | 39 ++++
modules/platforms/cpp/ignite/configure.ac | 62 +++++
modules/platforms/cpp/ignite/project/README.TXT | 1 +
.../platforms/cpp/ignite/project/vs/README.TXT | 1 +
.../cpp/ignite/project/vs/ignite.vcxproj | 167 ++++++++++++++
.../ignite/project/vs/ignite.vcxproj.filters | 25 +++
modules/platforms/cpp/ignite/src/ignite.cpp | 225 +++++++++++++++++++
modules/platforms/cpp/project/vs/ignite.sln | 10 +
20 files changed, 685 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/common/include/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/include/Makefile.am b/modules/platforms/cpp/common/include/Makefile.am
index 5db1d4a..7a02225 100644
--- a/modules/platforms/cpp/common/include/Makefile.am
+++ b/modules/platforms/cpp/common/include/Makefile.am
@@ -19,4 +19,5 @@ ACLOCAL_AMFLAGS = "-Im4"
nobase_include_HEADERS = ignite/common/concurrent.h \
ignite/common/java.h \
- ignite/common/exports.h
+ ignite/common/exports.h \
+ ignite/common/utils.h
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/common/include/ignite/common/utils.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/include/ignite/common/utils.h b/modules/platforms/cpp/common/include/ignite/common/utils.h
new file mode 100644
index 0000000..4b590d9
--- /dev/null
+++ b/modules/platforms/cpp/common/include/ignite/common/utils.h
@@ -0,0 +1,81 @@
+#pragma once
+/*
+ * 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_UTILS
+#define _IGNITE_COMMON_UTILS
+
+#include <string>
+#include <sstream>
+#include <algorithm>
+
+namespace ignite
+{
+ namespace common
+ {
+ namespace util
+ {
+ /**
+ * Transform string into lowercase.
+ *
+ * @param str String to be transformed.
+ */
+ inline void IntoLower(std::string& str)
+ {
+ std::transform(str.begin(), str.end(), str.begin(), ::tolower);
+ }
+
+ /**
+ * Get lowercase version of the string.
+ *
+ * @param str Input string.
+ * @return Lowercased version of the string.
+ */
+ inline std::string ToLower(const std::string& str)
+ {
+ std::string res(str);
+ IntoLower(res);
+ return res;
+ }
+
+ /**
+ * Get string representation of long in decimal form.
+ *
+ * @param val Long value to be converted to string.
+ * @return String contataining decimal representation of the value.
+ */
+ inline std::string LongToString(long val)
+ {
+ std::stringstream tmp;
+ tmp << val;
+ return tmp.str();
+ }
+
+ /**
+ * Parse string to try and get int value.
+ *
+ * @param str String to be parsed.
+ * @return String contataining decimal representation of the value.
+ */
+ inline int ParseInt(const std::string& str)
+ {
+ return atoi(str.c_str());
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/common/project/vs/common.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/project/vs/common.vcxproj b/modules/platforms/cpp/common/project/vs/common.vcxproj
index c5c790e..0fa1d0e 100644
--- a/modules/platforms/cpp/common/project/vs/common.vcxproj
+++ b/modules/platforms/cpp/common/project/vs/common.vcxproj
@@ -182,6 +182,7 @@
<ClInclude Include="..\..\include\ignite\common\concurrent.h" />
<ClInclude Include="..\..\include\ignite\common\exports.h" />
<ClInclude Include="..\..\include\ignite\common\java.h" />
+ <ClInclude Include="..\..\include\ignite\common\utils.h" />
<ClInclude Include="..\..\os\win\include\ignite\common\common.h" />
<ClInclude Include="..\..\os\win\include\ignite\common\concurrent_os.h" />
<ClInclude Include="targetver.h" />
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/common/project/vs/common.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/common/project/vs/common.vcxproj.filters b/modules/platforms/cpp/common/project/vs/common.vcxproj.filters
index 3d4ae54..01a47a0 100644
--- a/modules/platforms/cpp/common/project/vs/common.vcxproj.filters
+++ b/modules/platforms/cpp/common/project/vs/common.vcxproj.filters
@@ -28,6 +28,9 @@
<ClInclude Include="targetver.h">
<Filter>Misc</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\ignite\common\utils.h">
+ <Filter>Code</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\os\win\src\common.cpp">
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core-test/src/cache_query_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_query_test.cpp b/modules/platforms/cpp/core-test/src/cache_query_test.cpp
index 47009f4..1605d74 100644
--- a/modules/platforms/cpp/core-test/src/cache_query_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_query_test.cpp
@@ -187,17 +187,12 @@ struct CacheQueryTestSuiteFixture {
CacheQueryTestSuiteFixture()
{
IgniteConfiguration cfg;
-
- IgniteJvmOption opts[5];
-
- opts[0] = IgniteJvmOption("-Xdebug");
- opts[1] = IgniteJvmOption("-Xnoagent");
- opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
- opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
- opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
-
- cfg.jvmOptsLen = 5;
- cfg.jvmOpts = opts;
+
+ cfg.jvmOpts.push_back("-Xdebug");
+ cfg.jvmOpts.push_back("-Xnoagent");
+ cfg.jvmOpts.push_back("-Djava.compiler=NONE");
+ cfg.jvmOpts.push_back("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
+ cfg.jvmOpts.push_back("-XX:+HeapDumpOnOutOfMemoryError");
#ifdef IGNITE_TESTS_32
cfg.jvmInitMem = 256;
@@ -209,9 +204,7 @@ struct CacheQueryTestSuiteFixture {
char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
- std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-query.xml");
-
- cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
+ cfg.springCfgPath = std::string(cfgPath).append("/").append("cache-query.xml");
IgniteError err;
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core-test/src/cache_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/cache_test.cpp b/modules/platforms/cpp/core-test/src/cache_test.cpp
index 3239d89..691095f 100644
--- a/modules/platforms/cpp/core-test/src/cache_test.cpp
+++ b/modules/platforms/cpp/core-test/src/cache_test.cpp
@@ -95,16 +95,11 @@ struct CacheTestSuiteFixture {
{
IgniteConfiguration cfg;
- IgniteJvmOption opts[5];
-
- opts[0] = IgniteJvmOption("-Xdebug");
- opts[1] = IgniteJvmOption("-Xnoagent");
- opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
- opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
- opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
-
- cfg.jvmOptsLen = 5;
- cfg.jvmOpts = opts;
+ cfg.jvmOpts.push_back("-Xdebug");
+ cfg.jvmOpts.push_back("-Xnoagent");
+ cfg.jvmOpts.push_back("-Djava.compiler=NONE");
+ cfg.jvmOpts.push_back("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
+ cfg.jvmOpts.push_back("-XX:+HeapDumpOnOutOfMemoryError");
#ifdef IGNITE_TESTS_32
cfg.jvmInitMem = 256;
@@ -116,9 +111,7 @@ struct CacheTestSuiteFixture {
char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
- std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
-
- cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
+ cfg.springCfgPath = std::string(cfgPath).append("/").append("cache-test.xml");
for (int i = 0; i < 2; i++)
{
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core-test/src/ignition_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core-test/src/ignition_test.cpp b/modules/platforms/cpp/core-test/src/ignition_test.cpp
index e0e26d3..7d1284a 100644
--- a/modules/platforms/cpp/core-test/src/ignition_test.cpp
+++ b/modules/platforms/cpp/core-test/src/ignition_test.cpp
@@ -33,16 +33,11 @@ BOOST_AUTO_TEST_CASE(TestIgnition)
{
IgniteConfiguration cfg;
- IgniteJvmOption opts[5];
-
- opts[0] = IgniteJvmOption("-Xdebug");
- opts[1] = IgniteJvmOption("-Xnoagent");
- opts[2] = IgniteJvmOption("-Djava.compiler=NONE");
- opts[3] = IgniteJvmOption("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
- opts[4] = IgniteJvmOption("-XX:+HeapDumpOnOutOfMemoryError");
-
- cfg.jvmOptsLen = 5;
- cfg.jvmOpts = opts;
+ cfg.jvmOpts.push_back("-Xdebug");
+ cfg.jvmOpts.push_back("-Xnoagent");
+ cfg.jvmOpts.push_back("-Djava.compiler=NONE");
+ cfg.jvmOpts.push_back("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005");
+ cfg.jvmOpts.push_back("-XX:+HeapDumpOnOutOfMemoryError");
#ifdef IGNITE_TESTS_32
cfg.jvmInitMem = 256;
@@ -54,9 +49,7 @@ BOOST_AUTO_TEST_CASE(TestIgnition)
char* cfgPath = getenv("IGNITE_NATIVE_TEST_CPP_CONFIG_PATH");
- std::string cfgPathStr = std::string(cfgPath).append("/").append("cache-test.xml");
-
- cfg.springCfgPath = const_cast<char*>(cfgPathStr.c_str());
+ cfg.springCfgPath = std::string(cfgPath).append("/").append("cache-test.xml");
IgniteError err;
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core/include/ignite/ignite.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite.h b/modules/platforms/cpp/core/include/ignite/ignite.h
index 8fc9b02..f194b1a 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite.h
@@ -29,6 +29,7 @@ namespace ignite
*/
class IGNITE_IMPORT_EXPORT Ignite
{
+ friend class impl::IgniteImpl;
public:
/**
* Default constructor.
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
index 4e79e73..c4c6c8e 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
@@ -19,87 +19,29 @@
#define _IGNITE_CONFIGURATION
#include <stdint.h>
+#include <string>
+#include <list>
#include "ignite/impl/utils.h"
namespace ignite
-{
- /**
- * Single JVM option.
- */
- struct IgniteJvmOption
- {
- /** Option. */
- char* opt;
-
- /**
- * Default constructor.
- */
- IgniteJvmOption() : opt(NULL)
- {
- // No-op.
- }
-
- /**
- * Copy constructor.
- *
- * @param option Other instance.
- */
- IgniteJvmOption(const IgniteJvmOption& option) : opt()
- {
- this->opt = impl::utils::CopyChars(option.opt);
- }
-
- /**
- * Constructor.
- *
- * @param opt Option.
- */
- IgniteJvmOption(const char* opt) : opt()
- {
- this->opt = impl::utils::CopyChars(opt);
- }
-
- /**
- * Destructor.
- */
- ~IgniteJvmOption()
- {
- impl::utils::ReleaseChars(opt);
- }
-
- /**
- * Copy operator.
- *
- * @param option Other instance.
- * @return This instance.
- */
- IgniteJvmOption& operator=(const IgniteJvmOption& option)
- {
- impl::utils::ReleaseChars(opt);
-
- this->opt = impl::utils::CopyChars(option.opt);
-
- return *this;
- }
- };
-
+{
/**
* Ignite configuration.
*/
struct IgniteConfiguration
{
/** Path to Ignite home. */
- char* igniteHome;
+ std::string igniteHome;
/** Path to Spring configuration file. */
- char* springCfgPath;
+ std::string springCfgPath;
/** Path ot JVM libbrary. */
- char* jvmLibPath;
+ std::string jvmLibPath;
/** JVM classpath. */
- char* jvmClassPath;
+ std::string jvmClassPath;
/** Initial amount of JVM memory. */
int32_t jvmInitMem;
@@ -108,16 +50,13 @@ namespace ignite
int32_t jvmMaxMem;
/** Additional JVM options. */
- IgniteJvmOption* jvmOpts;
-
- /** Additional JVM options count. */
- int32_t jvmOptsLen;
+ std::list<std::string> jvmOpts;
/**
* Constructor.
*/
- IgniteConfiguration() : igniteHome(NULL), springCfgPath(NULL), jvmLibPath(NULL), jvmClassPath(NULL),
- jvmInitMem(512), jvmMaxMem(1024), jvmOpts(NULL), jvmOptsLen(0)
+ IgniteConfiguration() : igniteHome(), springCfgPath(), jvmLibPath(), jvmClassPath(),
+ jvmInitMem(512), jvmMaxMem(1024), jvmOpts()
{
// No-op.
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core/include/ignite/impl/ignite_impl.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/impl/ignite_impl.h b/modules/platforms/cpp/core/include/ignite/impl/ignite_impl.h
index 1aeab29..318ff5c 100644
--- a/modules/platforms/cpp/core/include/ignite/impl/ignite_impl.h
+++ b/modules/platforms/cpp/core/include/ignite/impl/ignite_impl.h
@@ -26,13 +26,13 @@
#include "ignite/impl/utils.h"
namespace ignite
-{
+{
namespace impl
- {
+ {
/**
* Ignite implementation.
*/
- class IgniteImpl
+ class IGNITE_FRIEND_EXPORT IgniteImpl
{
friend class Ignite;
public:
@@ -57,6 +57,13 @@ namespace ignite
const char* GetName() const;
/**
+ * Get JNI context associated with this instance.
+ *
+ * @return JNI context for this instance.
+ */
+ common::java::JniContext* GetContext();
+
+ /**
* Get cache.
*
* @param name Cache name.
@@ -130,6 +137,19 @@ namespace ignite
return new cache::CacheImpl(name0, env, cacheJavaRef);
}
+
+ /**
+ * Get instance of the implementation from the proxy class.
+ * Internal method. Should not be used by user.
+ *
+ * @param proxy Proxy instance containing IgniteImpl.
+ * @return IgniteImpl instance associated with the proxy or null-pointer.
+ */
+ template<typename T>
+ static IgniteImpl* GetFromProxy(T& proxy)
+ {
+ return proxy.impl.Get();
+ }
private:
/** Environment. */
ignite::common::concurrent::SharedPointer<IgniteEnvironment> env;
@@ -140,7 +160,6 @@ namespace ignite
IGNITE_NO_COPY_ASSIGNMENT(IgniteImpl)
};
}
-
}
#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core/src/ignition.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/ignition.cpp b/modules/platforms/cpp/core/src/ignition.cpp
index c69789f..edac373 100644
--- a/modules/platforms/cpp/core/src/ignition.cpp
+++ b/modules/platforms/cpp/core/src/ignition.cpp
@@ -75,7 +75,7 @@ namespace ignite
*/
char** CreateJvmOptions(const IgniteConfiguration& cfg, const std::string* home, const std::string& cp, int* optsLen)
{
- *optsLen = 3 + (home ? 1 : 0) + cfg.jvmOptsLen;
+ *optsLen = 3 + (home ? 1 : 0) + static_cast<int>(cfg.jvmOpts.size());
char** opts = new char*[*optsLen];
int idx = 0;
@@ -100,8 +100,8 @@ namespace ignite
*(opts + idx++) = CopyChars(xmxStr.c_str());
// 4. Set the rest options.
- for (int i = 0; i < cfg.jvmOptsLen; i++) {
- char* optCopy = CopyChars(cfg.jvmOpts[i].opt);
+ for (std::list<std::string>::const_iterator i = cfg.jvmOpts.begin(); i != cfg.jvmOpts.end(); ++i) {
+ char* optCopy = CopyChars(i->c_str());
opts[idx++] = optCopy;
}
@@ -147,7 +147,7 @@ namespace ignite
bool jvmLibFound;
std::string jvmLib;
- if (cfg.jvmLibPath)
+ if (!cfg.jvmLibPath.empty())
{
std::string jvmLibPath = std::string(cfg.jvmLibPath);
@@ -182,7 +182,7 @@ namespace ignite
bool homeFound;
std::string home;
- if (cfg.igniteHome)
+ if (!cfg.igniteHome.empty())
{
std::string homePath = std::string(cfg.igniteHome);
@@ -194,7 +194,7 @@ namespace ignite
// 3. Create classpath.
std::string cp;
- if (cfg.jvmClassPath)
+ if (!cfg.jvmClassPath.empty())
{
std::string usrCp = cfg.jvmClassPath;
@@ -233,9 +233,11 @@ namespace ignite
// 5. Start Ignite.
if (!failed)
{
- char* springCfgPath0 = CopyChars(cfg.springCfgPath);
+ char* springCfgPath0 = NULL;
- if (!springCfgPath0)
+ if (!cfg.springCfgPath.empty())
+ springCfgPath0 = CopyChars(cfg.springCfgPath.c_str());
+ else
springCfgPath0 = CopyChars(DFLT_CFG);
char* name0 = CopyChars(name);
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/src/impl/ignite_impl.cpp b/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
index c0eab68..28909eb 100644
--- a/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
+++ b/modules/platforms/cpp/core/src/impl/ignite_impl.cpp
@@ -38,5 +38,10 @@ namespace ignite
{
return env.Get()->InstanceName();
}
+
+ JniContext* IgniteImpl::GetContext()
+ {
+ return env.Get()->Context();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/Makefile.am b/modules/platforms/cpp/ignite/Makefile.am
new file mode 100644
index 0000000..ad405da
--- /dev/null
+++ b/modules/platforms/cpp/ignite/Makefile.am
@@ -0,0 +1,39 @@
+##
+## 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 = .
+DIST_SUBDIRS = .
+
+AM_CPPFLAGS = -I$(srcdir)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -DIGNITE_IMPL
+AM_CXXFLAGS = -Wall -std=c++0x
+
+noinst_PROGRAMS = ignite
+
+ignite_SOURCES = src/ignite.cpp
+
+ignite_LDFLAGS = -static-libtool-libs -L/usr/local/lib -lignite
+
+run-check: check
+ ./ignite
+
+clean-local: clean-check
+ $(RM) *.gcno *.gcda
+
+clean-check:
+ $(RM) $(ignite_OBJECTS)
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/configure.ac
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/configure.ac b/modules/platforms/cpp/ignite/configure.ac
new file mode 100644
index 0000000..7705797
--- /dev/null
+++ b/modules/platforms/cpp/ignite/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 C++ Runner], [1.5.0], [dev@ignite.apache.org], [ignite], [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)
+
+AC_OUTPUT
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/project/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/project/README.TXT b/modules/platforms/cpp/ignite/project/README.TXT
new file mode 100644
index 0000000..97f4c64
--- /dev/null
+++ b/modules/platforms/cpp/ignite/project/README.TXT
@@ -0,0 +1 @@
+Contains IDE projects artifacts.
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/project/vs/README.TXT
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/project/vs/README.TXT b/modules/platforms/cpp/ignite/project/vs/README.TXT
new file mode 100644
index 0000000..f4fb456
--- /dev/null
+++ b/modules/platforms/cpp/ignite/project/vs/README.TXT
@@ -0,0 +1 @@
+Contains Visual Studio project artifacts.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj b/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj
new file mode 100644
index 0000000..4ce915e
--- /dev/null
+++ b/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>ignite</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ignite</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v100</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v100</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v100</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v100</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>
+ </LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;IGNITE_IMPL;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>Async</ExceptionHandling>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;IGNITE_IMPL;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>Async</ExceptionHandling>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;IGNITE_IMPL;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>Async</ExceptionHandling>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\core\include;$(ProjectDir)\..\..\..\core\os\win\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;IGNITE_IMPL;_CRT_SECURE_NO_WARNINGS;IGNITE_FRIEND;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>Async</ExceptionHandling>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\src\ignite.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\common\project\vs\common.vcxproj">
+ <Project>{4f7e4917-4612-4b96-9838-025711ade391}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\core\project\vs\core.vcxproj">
+ <Project>{e2dea693-f2ea-43c2-a813-053378f6e4db}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj.filters b/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj.filters
new file mode 100644
index 0000000..f39c60a
--- /dev/null
+++ b/modules/platforms/cpp/ignite/project/vs/ignite.vcxproj.filters
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Code">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Headers">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resources">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\src\ignite.cpp">
+ <Filter>Code</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/ignite/src/ignite.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/ignite/src/ignite.cpp b/modules/platforms/cpp/ignite/src/ignite.cpp
new file mode 100644
index 0000000..56860b3
--- /dev/null
+++ b/modules/platforms/cpp/ignite/src/ignite.cpp
@@ -0,0 +1,225 @@
+/*
+ * 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.
+ */
+
+#include <iostream>
+#include <algorithm>
+#include <list>
+#include <string>
+#include <iterator>
+
+#include "ignite/ignite_configuration.h"
+#include "ignite/ignition.h"
+#include "ignite/common/utils.h"
+
+typedef std::list<std::string> StringList;
+typedef std::set<std::string> StringSet;
+
+namespace config
+{
+ using ignite::common::util::ToLower;
+
+ /** Command line argument: Ignite home. */
+ const std::string CmdIgniteHome = ToLower("-IgniteHome=");
+
+ /** Command line argument: Spring config URL. */
+ const std::string CmdSpringCfgUrl = ToLower("-SpringConfigUrl=");
+
+ /** Command line argument: Path to JVM library. */
+ const std::string CmdJvmLib = ToLower("-JvmLibPath=");
+
+ /** Command line argument: JVM classpath. */
+ const std::string CmdJvmClasspath = ToLower("-JvmClasspath=");
+
+ /** Command line argument: JVM option prefix. */
+ const std::string CmdJvmOpt = ToLower("-J");
+
+ /** Command line argument: JvmInitialMemoryMB. */
+ const std::string CmdJvmMinMem = ToLower("-JvmInitialMemoryMB=");
+
+ /** Command line argument: JvmMaxMemoryMB. */
+ const std::string CmdJvmMaxMem = ToLower("-JvmMaxMemoryMB=");
+
+ /**
+ * Convert configuration to arguments.
+ *
+ * @param cfg Input configuration.
+ * @param args Output arguments.
+ */
+ void ToArgs(const ignite::IgniteConfiguration& cfg, StringList& args)
+ {
+ using ignite::common::util::LongToString;
+
+ if (!cfg.igniteHome.empty())
+ args.push_back(CmdIgniteHome + cfg.igniteHome);
+
+ if (cfg.springCfgPath.empty())
+ args.push_back(CmdSpringCfgUrl + cfg.springCfgPath);
+
+ if (cfg.jvmLibPath.empty())
+ args.push_back(CmdJvmLib + cfg.jvmLibPath);
+
+ if (cfg.jvmClassPath.empty())
+ args.push_back(CmdJvmClasspath + cfg.jvmClassPath);
+
+ if (cfg.jvmOpts.empty())
+ {
+ for (StringList::const_iterator i = cfg.jvmOpts.begin(); i != cfg.jvmOpts.end(); ++i)
+ args.push_back(CmdJvmOpt + *i);
+ }
+
+ args.push_back(CmdJvmMinMem + LongToString(cfg.jvmInitMem));
+ args.push_back(CmdJvmMaxMem + LongToString(cfg.jvmMaxMem));
+ }
+
+ /**
+ * Convert arguments to configuration.
+ *
+ * @param cfg Output configuration.
+ * @param args Input arguments.
+ */
+ void Configure(ignite::IgniteConfiguration& cfg, const StringList& src)
+ {
+ using ignite::common::util::ParseInt;
+
+ StringList jvmOpts;
+
+ for (StringList::const_iterator i = src.begin(); i != src.end(); ++i)
+ {
+ const std::string& arg = *i;
+
+ std::string argLow = ToLower(arg);
+
+ if (argLow.find(CmdIgniteHome) == 0)
+ cfg.igniteHome = arg.substr(CmdIgniteHome.size());
+ else if (argLow.find(CmdSpringCfgUrl) == 0)
+ cfg.springCfgPath = arg.substr(CmdSpringCfgUrl.size());
+ else if (argLow.find(CmdJvmLib) == 0)
+ cfg.jvmLibPath = arg.substr(CmdJvmLib.size());
+ else if (argLow.find(CmdJvmClasspath) == 0)
+ cfg.jvmClassPath = arg.substr(CmdJvmClasspath.size());
+ else if (argLow.find(CmdJvmMinMem) == 0)
+ cfg.jvmInitMem = ParseInt(arg.substr(CmdJvmMinMem.size()));
+ else if (argLow.find(CmdJvmMaxMem) == 0)
+ cfg.jvmMaxMem = ParseInt(arg.substr(CmdJvmMaxMem.size()));
+ else if (argLow.find(CmdJvmOpt) == 0)
+ jvmOpts.push_back(arg.substr(CmdJvmOpt.size()));
+ else
+ {
+ std::cout << "WARNING: unknown argument \"" << arg << "\"."
+ << "Type --help for the list of supported arguments." << std::endl;
+ }
+ }
+
+ if (!jvmOpts.empty())
+ {
+ if (!cfg.jvmOpts.empty())
+ cfg.jvmOpts.swap(jvmOpts);
+ else
+ std::copy(jvmOpts.begin(), jvmOpts.end(), std::back_insert_iterator<StringList>(cfg.jvmOpts));
+ }
+ }
+}
+
+
+/**
+ * Prints help to standard output.
+ */
+void PrintHelp()
+{
+ std::cout << "Usage: ignite [-options]" << std::endl;
+ std::cout << std::endl;
+ std::cout << "Options:" << std::endl;
+ std::cout << "\t-igniteHome path to Ignite installation directory (if not provided IGNITE_HOME environment variable is used)" << std::endl;
+ std::cout << "\t-springConfigUrl path to spring configuration file (if not provided \"config/default-config.xml\" is used)" << std::endl;
+ std::cout << "\t-jvmLibPath path to JVM library (if not provided JAVA_HOME environment variable is used)" << std::endl;
+ std::cout << "\t-jvmClasspath classpath passed to JVM (enlist additional jar files here)" << std::endl;
+ std::cout << "\t-J<javaOption> JVM options passed to created JVM" << std::endl;
+ std::cout << "\t-jvmInitialMemoryMB Initial Java heap size, in megabytes. Maps to -Xms Java parameter. Defaults to 512." << std::endl;
+ std::cout << "\t-jvmMaxMemoryMB Maximum Java heap size, in megabytes. Maps to -Xmx Java parameter. Defaults to 1024." << std::endl;
+ std::cout << std::endl;
+ std::cout << "Examples:" << std::endl;
+ std::cout << "\tignite -J-Xms1024m -J-Xmx1024m -springConfigUrl=C:/woer/gg-test/my-test-gg-confignative.xml" << std::endl;
+ std::cout << "\tignite -igniteHome=c:/apache-ignite -jvmClasspath=libs/myLib1.jar;libs/myLib2.jar" << std::endl;
+ std::cout << "\tignite -jvmInitialMemoryMB=1024 -jvmMaxMemoryMB=4096" << std::endl;
+ std::cout << std::endl;
+}
+
+/**
+ * Application entry point.
+ */
+int main(int argc, const char* argv[])
+{
+ // Help commands.
+ StringSet Help;
+ Help.insert("/help");
+ Help.insert("-help");
+ Help.insert("--help");
+
+ StringList args;
+ std::copy(argv + 1, argv + argc, std::back_insert_iterator<StringList>(args));
+
+ try
+ {
+ // Check for special cases.
+ if (!args.empty())
+ {
+ using ignite::common::util::ToLower;
+
+ std::string first = ToLower(args.front());
+
+ if (Help.find(first) != Help.end())
+ {
+ PrintHelp();
+
+ return 0;
+ }
+ }
+
+ // Pick application configuration.
+ ignite::IgniteConfiguration cfg;
+
+ // Pick command line arguments.
+ config::Configure(cfg, args);
+
+ ignite::Ignite ignite = ignite::Ignition::Start(cfg);
+
+ ignite::impl::IgniteImpl *igniteImpl = ignite::impl::IgniteImpl::GetFromProxy(ignite);
+
+ if (igniteImpl)
+ {
+ ignite::common::java::JniContext* context = igniteImpl->GetContext();
+ if (context)
+ {
+ context->DestroyJvm();
+ }
+ }
+ }
+ catch (ignite::IgniteError& e)
+ {
+ std::cout << "ERROR: " << e.GetText() << std::endl;
+
+ return -1;
+ }
+ catch (std::exception& e)
+ {
+ std::cout << "ERROR: " << e.what() << std::endl;
+
+ return -2;
+ }
+ return 0;
+}
+
http://git-wip-us.apache.org/repos/asf/ignite/blob/40978109/modules/platforms/cpp/project/vs/ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/project/vs/ignite.sln b/modules/platforms/cpp/project/vs/ignite.sln
index 4a2ec29..c573606 100644
--- a/modules/platforms/cpp/project/vs/ignite.sln
+++ b/modules/platforms/cpp/project/vs/ignite.sln
@@ -9,6 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "..\..\core\project\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core-test", "..\..\core-test\project\vs\core-test.vcxproj", "{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ignite", "..\..\ignite\project\vs\ignite.vcxproj", "{69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -41,6 +43,14 @@ Global
{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|Win32.Build.0 = Release|Win32
{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|x64.ActiveCfg = Release|x64
{133A22DB-FD60-44B9-B5E3-6CBB3EA5ABF0}.Release|x64.Build.0 = Release|x64
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|Win32.ActiveCfg = Debug|Win32
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|Win32.Build.0 = Debug|Win32
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|x64.ActiveCfg = Debug|x64
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Debug|x64.Build.0 = Debug|x64
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|Win32.ActiveCfg = Release|Win32
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|Win32.Build.0 = Release|Win32
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|x64.ActiveCfg = Release|x64
+ {69688B4D-3EE0-43F5-A1C6-29B5D2DDE949}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE