/[eiffelstudio]/trunk/Src/library/Eiffel2Java/shared_jni_environment.e
ViewVC logotype

Contents of /trunk/Src/library/Eiffel2Java/shared_jni_environment.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27522 - (show annotations)
Tue Sep 11 18:09:19 2001 UTC (18 years, 5 months ago) by manus
File size: 1726 byte(s)
Simplified use of CLASSPATH environment variable.

1 indexing
2
3 description: "Shared JNI environment. Since one JNI is needed per %
4 %thread we limit Eiffel to having one thread that %
5 %deals with Java."
6
7 class SHARED_JNI_ENVIRONMENT
8
9 feature
10
11 jni: JNI_ENVIRONMENT is
12 -- returns the standard JNI enviroment. It uses the value of
13 -- CLASS_PATH environment variable to initialize the JVM
14 local
15 cpp: POINTER
16 class_path: STRING
17 jvm: JAVA_VM
18 ex: EXCEPTIONS
19 exec: EXECUTION_ENVIRONMENT
20 once
21 create exec
22 -- First obtain the value of the CLASSPATH environment
23 -- variable
24 class_path := exec.get ("CLASSPATH")
25 if class_path = void or else class_path.count = 0 then
26 !!ex
27 ex.raise ("Can't get CLASSPATH")
28 end
29 debug ("java")
30 io.putstring ("CLASSPATH=")
31 io.putstring (class_path)
32 io.new_line
33 end
34
35 -- Next create the JVM and get the JNI environment
36 !!jvm.make
37 Result := jvm.create_vm (class_path)
38 ensure
39 Result /= Void
40 end
41
42 end
43
44
45 --|----------------------------------------------------------------
46 --| Eiffel2Java: library of reusable components for ISE Eiffel.
47 --| Copyright (C) 1986-2001 Interactive Software Engineering Inc.
48 --| All rights reserved. Duplication and distribution prohibited.
49 --| May be used only with ISE Eiffel, under terms of user license.
50 --| Contact ISE for any other use.
51 --|
52 --| Interactive Software Engineering Inc.
53 --| ISE Building
54 --| 360 Storke Road, Goleta, CA 93117 USA
55 --| Telephone 805-685-1006, Fax 805-685-6869
56 --| Electronic mail <info@eiffel.com>
57 --| Customer support: http://support.eiffel.com>
58 --| For latest info see award-winning pages: http://www.eiffel.com
59 --|----------------------------------------------------------------
60

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23