forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathSystemBootstrap.java
More file actions
40 lines (36 loc) · 1.23 KB
/
SystemBootstrap.java
File metadata and controls
40 lines (36 loc) · 1.23 KB
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
// Copyright (c) 2020 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package org.cef;
/**
* To allow customization of System.load() calls by supplying a different
* implementation. You'll want to call <code>setLoader</code> with your custom
* implementation before calling into any other CEF classes which then in turn
* will start triggering libraries to be loaded at runtime.
*/
public class SystemBootstrap {
/**
* Simple interface for how a library by name should be loaded.
*/
static public interface Loader {
public void loadLibrary(String libname);
}
/**
* Default implementation is to call System.loadLibrary
*/
static private Loader loader_ = new Loader() {
@Override
public void loadLibrary(String libname) {
System.loadLibrary(libname);
}
};
static public void setLoader(Loader loader) {
if (loader == null) {
throw new NullPointerException("Loader cannot be null");
}
loader_ = loader;
}
static public void loadLibrary(String libname) {
loader_.loadLibrary(libname);
}
}