The JNI defines a standard naming and calling convention so the Java VM can locate and invoke native methods. JNI also offers a set of standard interface functions to call from native code to do such things as access, manipulate, release, or create objects or to call methods in the Java programming language. Finally, the JNI supports an invocation to load, initialize, and invoke the Java VM. In JDK 1.2 a number of new methods add functionality in the areas of library and version management, local reference management, weak global references, array operations, string operations, reflection support, and the invocation API.
Some clients, such as the serialization service, development tools, and debuggers, need to bypass the access controls built into the Java programming language when they use reflected members or constructors. These controls govern how method and constructor reflectives can access fields, invoke members, and create new class instances according to whether the field, method, or class is public, private, or protected.
In JDK 1.2 reflected field, method and constructor objects extend a new
base class (AccessibleObject) with a flag field that can
be set to bypass the access controls. Flag values for this
field are either True or False, and the
flag value is False. If the flag is
True, access checks are bypassed, and the requested
operation proceeds. If the flag is False, normal access
checks are in force.
Setting the flag is under the control of the JDK 1.2 security
architecture. In addition to the AccessibleObject
instance, which has the necessary state and methods to set the flag to
True, a ReflectPermission object is needed.
The ReflectPermission object has methods to grant the
necessary permission in the policy file to allow the reflective
access.
Bhopal news
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100