IKVM11
11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
SecurityManager.cs
Go to the documentation of this file.
1
/*
2
Copyright (C) 2007-2014 Jeroen Frijters
3
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
7
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
19
20
Jeroen Frijters
21
jeroen@frijters.net
22
23
*/
24
25
using
System
;
26
using
System.Collections.Generic;
27
using
System.Diagnostics;
28
29
using
IKVM.Runtime
;
30
31
namespace
IKVM.Java.Externs.java.lang
32
{
33
34
static
class
SecurityManager
35
{
36
37
public
static
global::java.lang.Class[]
getClassContext
(
object
thisSecurityManager)
38
{
39
#if FIRST_PASS
40
throw
new
NotImplementedException();
41
#else
42
var stack =
new
List<global::java.lang.Class>();
43
var trace =
new
StackTrace();
44
for
(
int
i = 0; i < trace.FrameCount; i++)
45
{
46
var frame = trace.GetFrame(i);
47
var method = frame.GetMethod();
48
49
if
(
IKVM
.
Java
.
Externs
.
sun
.
reflect
.
Reflection
.IsHideFromStackWalk(method))
50
continue
;
51
52
var type = method.DeclaringType;
53
if
(type == typeof(global::java.lang.SecurityManager))
54
continue
;
55
56
stack.Add(
JVM
.Context.
ClassLoaderFactory
.GetJavaTypeFromType(type).ClassObject);
57
}
58
59
return
stack.ToArray();
60
#endif
61
}
62
63
public
static
object
currentClassLoader0
(
object
thisSecurityManager)
64
{
65
var currentClass =
currentLoadedClass0
(thisSecurityManager);
66
if
(currentClass !=
null
)
67
return
RuntimeJavaType.FromClass(currentClass).ClassLoader.GetJavaClassLoader();
68
69
return
null
;
70
}
71
72
public
static
int
classDepth
(
object
thisSecurityManager,
string
name)
73
{
74
throw
new
NotImplementedException();
75
}
76
77
public
static
int
classLoaderDepth0
(
object
thisSecurityManager)
78
{
79
throw
new
NotImplementedException();
80
}
81
82
public
static
global::java.lang.Class
currentLoadedClass0
(
object
thisSecurityManager)
83
{
84
throw
new
NotImplementedException();
85
}
86
87
}
88
89
}
IKVM.Java.Externs.java.lang.SecurityManager
Definition
SecurityManager.cs:35
IKVM.Java.Externs.java.lang.SecurityManager.getClassContext
static global::java.lang.Class[] getClassContext(object thisSecurityManager)
Definition
SecurityManager.cs:37
IKVM.Java.Externs.java.lang.SecurityManager.currentClassLoader0
static object currentClassLoader0(object thisSecurityManager)
Definition
SecurityManager.cs:63
IKVM.Java.Externs.java.lang.SecurityManager.classLoaderDepth0
static int classLoaderDepth0(object thisSecurityManager)
Definition
SecurityManager.cs:77
IKVM.Java.Externs.java.lang.SecurityManager.currentLoadedClass0
static global::java.lang.Class currentLoadedClass0(object thisSecurityManager)
Definition
SecurityManager.cs:82
IKVM.Java.Externs.java.lang.SecurityManager.classDepth
static int classDepth(object thisSecurityManager, string name)
Definition
SecurityManager.cs:72
IKVM.Java.Externs.sun.reflect.Reflection
Provides the implementations of the native methods in global::sun.reflect.Reflection.
Definition
Reflection.cs:40
IKVM.Runtime.JVM
Main state of the running JVM.
Definition
JVM.Resolver.cs:18
IKVM.Runtime.RuntimeContext.ClassLoaderFactory
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.
Definition
RuntimeContext.cs:252
IKVM.Java.Externs.java.lang
Definition
Class.cs:31
IKVM.Java.Externs.sun.reflect
Definition
ConstantPool.cs:27
IKVM.Java.Externs.sun
Definition
AnonymousClassLoader.cs:28
IKVM.Java.Externs
Definition
AppDomainAssemblyClassLoader.cs:32
IKVM.Java
Definition
AppDomainAssemblyClassLoader.cs:32
IKVM.Runtime
Definition
Accessor.cs:5
IKVM
Definition
MemoryBufferWriter.cs:7
System
Definition
HexConverter.cs:9
src
IKVM.Runtime
Java
Externs
java
lang
SecurityManager.cs
Generated by
1.12.0