Skip to content

Commit

Permalink
add JavaLauncher class
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagewang committed Jun 10, 2012
1 parent b74e58e commit 2447002
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
10 changes: 9 additions & 1 deletion project/jwrapper.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(BOOST_HOME)&quot;;&quot;$(SolutionDir)..\include&quot;"
AdditionalIncludeDirectories="&quot;$(JAVA_HOME)\include\win32&quot;;&quot;$(JAVA_HOME)\include&quot;;&quot;$(BOOST_HOME)&quot;;&quot;$(SolutionDir)..\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -183,6 +183,10 @@
RelativePath="..\src\JavaConfig.cpp"
>
</File>
<File
RelativePath="..\src\JavaLauncher.cpp"
>
</File>
<File
RelativePath="..\src\jwrapper.cpp"
>
Expand All @@ -205,6 +209,10 @@
RelativePath="..\src\JavaConfig.h"
>
</File>
<File
RelativePath="..\src\JavaLauncher.h"
>
</File>
<File
RelativePath="..\src\JWUtil.h"
>
Expand Down
31 changes: 31 additions & 0 deletions src/JavaLauncher.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright 2012 Wangxr, [email protected]
*
* Licensed 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:https://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 "JavaLauncher.h"


JavaLauncher::JavaLauncher()
{
}

JavaLauncher::~JavaLauncher()
{
}

JavaLauncher* JavaLauncher::getInstance()
{
static JavaLauncher *singleton = new JavaLauncher();
return singleton;
}
36 changes: 36 additions & 0 deletions src/JavaLauncher.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright 2012 Wangxr, [email protected]
*
* Licensed 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:https://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 _JW_JAVA_LAUNCHER_H__
#define _JW_JAVA_LAUNCHER_H__
#include <jni.h>
#include <string>

class JavaLauncher
{
public:

JavaLauncher();
~JavaLauncher();
static JavaLauncher* getInstance();

bool launchJavaApp(int argc, char** argv);
static void exitHandler(int code);
static void abortHandler(int code);

private:
};

#endif // end of _JW_JAVA_LAUNCHER_H__

0 comments on commit 2447002

Please sign in to comment.