IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.java.lang.ClassLoader Class Reference

Classes

class  NativeLibrary
 

Static Public Member Functions

static void registerNatives ()
 Implements the native method 'registerNatives'.
 
static global::java.lang.Class defineClass0 (global::java.lang.ClassLoader self, string name, byte[] b, int off, int len, global::java.security.ProtectionDomain pd)
 Implements the native method 'defineClass0'.
 
static global::java.lang.Class defineClass1 (global::java.lang.ClassLoader self, string name, byte[] b, int off, int len, global::java.security.ProtectionDomain pd, string source)
 Implements the native method 'defineClass1'.
 
static unsafe global::java.lang.Class defineClass2 (global::java.lang.ClassLoader self, string name, global::java.nio.ByteBuffer bb, int off, int len, global::java.security.ProtectionDomain pd, string source)
 Implements the native method 'defineClass2'.
 
static void resolveClass0 (global::java.lang.ClassLoader self, global::java.lang.Class clazz)
 Implements the native method 'resolveClass0'.
 
static global::java.lang.Class findBootstrapClass (global::java.lang.ClassLoader self, string name)
 Implements the native method 'findBootstrapClass'.
 
static global::java.lang.Class findLoadedClass0 (global::java.lang.ClassLoader self, string name)
 Implements the native method 'findLoadedClass0'.
 
static global::java.net.URL getBootstrapResource (string name)
 Implements the native method 'getBootstrapResource'.
 
static global::java.util.Enumeration getBootstrapResources (string name)
 Implements the native method 'getBootstrapResources'.
 
static object retrieveDirectives ()
 Implements the native method 'retrieveDirectives'.
 
static string findBuiltinLib (string name)
 Finds the builtin native library, or returns null if the given name isn't built in.
 

Detailed Description

Definition at line 36 of file ClassLoader.NativeLibrary.cs.

Member Function Documentation

◆ defineClass0()

static global.java.lang.Class IKVM.Java.Externs.java.lang.ClassLoader.defineClass0 ( global.java.lang.ClassLoader self,
string name,
byte[] b,
int off,
int len,
global.java.security.ProtectionDomain pd )
static

Implements the native method 'defineClass0'.

Parameters
self
name
b
off
len
pd
Returns

Definition at line 59 of file ClassLoader.cs.

60 {
61#if FIRST_PASS
62 throw new NotImplementedException();
63#else
64 var buf = new byte[len];
65 Array.Copy(b, off, buf, 0, len);
66 return DefineClass(self, name, ReadClass(buf), pd, null);
67#endif
68 }

◆ defineClass1()

static global.java.lang.Class IKVM.Java.Externs.java.lang.ClassLoader.defineClass1 ( global.java.lang.ClassLoader self,
string name,
byte[] b,
int off,
int len,
global.java.security.ProtectionDomain pd,
string source )
static

Implements the native method 'defineClass1'.

Parameters
self
name
b
off
len
pd
source
Returns
Exceptions
global::java.lang.NoClassDefFoundError

Definition at line 82 of file ClassLoader.cs.

83 {
84#if FIRST_PASS
85 throw new NotImplementedException();
86#else
87 var buf = new byte[len];
88 Array.Copy(b, off, buf, 0, len);
89 return DefineClass(self, name, ReadClass(buf), pd, source);
90#endif
91 }

◆ defineClass2()

static unsafe global.java.lang.Class IKVM.Java.Externs.java.lang.ClassLoader.defineClass2 ( global.java.lang.ClassLoader self,
string name,
global.java.nio.ByteBuffer bb,
int off,
int len,
global.java.security.ProtectionDomain pd,
string source )
static

Implements the native method 'defineClass2'.

Parameters
self
name
bb
off
len
pd
source
Returns

Definition at line 104 of file ClassLoader.cs.

105 {
106#if FIRST_PASS
107 throw new NotImplementedException();
108#else
109 var buf = new byte[bb.remaining()];
110 bb.get(buf);
111 return DefineClass(self, name, ReadClass(buf), pd, source);
112#endif
113 }

◆ findBootstrapClass()

static global.java.lang.Class IKVM.Java.Externs.java.lang.ClassLoader.findBootstrapClass ( global.java.lang.ClassLoader self,
string name )
static

Implements the native method 'findBootstrapClass'.

Parameters
self
name
Returns

Definition at line 186 of file ClassLoader.cs.

187 {
188#if FIRST_PASS
189 throw new NotImplementedException();
190#else
191 try
192 {
193 return JVM.Context.ClassLoaderFactory.GetBootstrapClassLoader().TryLoadClassByName(name)?.ClassObject;
194 }
196 {
197 throw x.ToJava();
198 }
199#endif
200 }
Main state of the running JVM.
.NET exception that corresponds to a Java exception.
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.

◆ findBuiltinLib()

static string IKVM.Java.Externs.java.lang.ClassLoader.findBuiltinLib ( string name)
static

Finds the builtin native library, or returns null if the given name isn't built in.

Parameters
name
Returns

Definition at line 44 of file ClassLoader.NativeLibrary.cs.

45 {
46#if FIRST_PASS
47 throw new NotImplementedException();
48#else
49 if (name == null)
50 throw new global::java.lang.InternalError("NULL filename for native library.");
51
52 var l = GetUnmappedLibraryName(name);
53 return IsBuiltinLib(l) ? l : null;
54#endif
55 }

◆ findLoadedClass0()

static global.java.lang.Class IKVM.Java.Externs.java.lang.ClassLoader.findLoadedClass0 ( global.java.lang.ClassLoader self,
string name )
static

Implements the native method 'findLoadedClass0'.

Parameters
self
name
Returns

Definition at line 208 of file ClassLoader.cs.

209 {
210#if FIRST_PASS
211 throw new NotImplementedException();
212#else
213 return name != null ? (JVM.Context.ClassLoaderFactory.GetClassLoaderWrapper(self).FindLoadedClass(name)?.ClassObject) : null;
214#endif
215 }

◆ getBootstrapResource()

static global.java.net.URL IKVM.Java.Externs.java.lang.ClassLoader.getBootstrapResource ( string name)
static

Implements the native method 'getBootstrapResource'.

Parameters
name
Returns

Definition at line 222 of file ClassLoader.cs.

223 {
224#if FIRST_PASS
225 throw new NotImplementedException();
226#else
227 return JVM.Context.ClassLoaderFactory.GetBootstrapClassLoader().GetResources(name).FirstOrDefault();
228#endif
229 }

◆ getBootstrapResources()

static global.java.util.Enumeration IKVM.Java.Externs.java.lang.ClassLoader.getBootstrapResources ( string name)
static

Implements the native method 'getBootstrapResources'.

Parameters
name
Returns

Definition at line 236 of file ClassLoader.cs.

237 {
238#if FIRST_PASS
239 throw new NotImplementedException();
240#else
241 return new global::ikvm.runtime.EnumerationWrapper(JVM.Context.ClassLoaderFactory.GetBootstrapClassLoader().GetResources(name));
242#endif
243 }

◆ registerNatives()

static void IKVM.Java.Externs.java.lang.ClassLoader.registerNatives ( )
static

Implements the native method 'registerNatives'.

Definition at line 44 of file ClassLoader.cs.

45 {
46
47 }

◆ resolveClass0()

static void IKVM.Java.Externs.java.lang.ClassLoader.resolveClass0 ( global.java.lang.ClassLoader self,
global.java.lang.Class clazz )
static

Implements the native method 'resolveClass0'.

Parameters
self
clazz

Definition at line 175 of file ClassLoader.cs.

176 {
177
178 }

◆ retrieveDirectives()

static object IKVM.Java.Externs.java.lang.ClassLoader.retrieveDirectives ( )
static

Implements the native method 'retrieveDirectives'.

Returns

Definition at line 249 of file ClassLoader.cs.

250 {
251 return IKVM.Runtime.Assertions.RetrieveDirectives();
252 }

The documentation for this class was generated from the following files: