SheafSystem  0.0.0.0
jvm_launcher.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class jvm_launcher
19 
20 #ifndef JVM_LAUNCHER_H
21 #define JVM_LAUNCHER_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
30 class SHEAF_DLL_SPEC jvm_launcher
31 {
32 
33  public:
34 
38  enum status_msg {SUCCESS = 0, JVM_CREATE_FAILURE = 1, CLASS_NOT_FOUND = 2, MAIN_NOT_FOUND = 3, OUT_OF_MEMORY = 4 };
39 
44  int launch(const char* main_class_name, int argc, char* argv[], bool verbose = false);
45 
50  int launch(const char* main_class_name, int argc, char* argv[],
51  const char* class_path, const char* ld_library_path, bool verbose = false);
52 
56  virtual ~jvm_launcher();
57 
58  protected:
59 
66  void re_exec(int argc, char* argv[], const char* class_path, const char* ld_library_path);
67 
68  private:
69 
74  jvm_launcher();
75 
76 };
77 
78 #endif // ifndef JVM_LAUNCHER_H
Launcher for the Java virtual machine.
Definition: jvm_launcher.h:30
status_msg
Return values.
Definition: jvm_launcher.h:38