You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// First, check if the class has already been loaded
81
-
Class<?> c = findLoadedClass(name);
82
-
83
-
// if not loaded, search the local (child) resources
84
-
if (c == null) {
85
-
try {
86
-
c = findClass(name);
87
-
} catch (ClassNotFoundExceptioncnfe) {
88
-
// ignore
89
-
}
90
-
}
91
-
92
-
// If we could not find it, delegate to parent
93
-
// Note that we do not attempt to catch any ClassNotFoundException
94
-
if (c == null) {
95
-
try {
96
-
c = this.parent.loadClass(name);
97
-
} catch (Exceptione) {
98
-
// ignore the Spring "BeanInfo" class lookup errors
99
-
// if (e.getMessage().indexOf("BeanInfo") == -1) {
100
-
// log.warn("Exception {}", e);
101
-
// }
102
-
}
103
-
if (c == null && parentParent != null) {
104
-
try {
105
-
c = parentParent.loadClass(name);
106
-
} catch (Exceptione) {
107
-
// if (e.getMessage().indexOf("BeanInfo") == -1) {
108
-
// log.warn("Exception {}", e);
109
-
// }
110
-
}
111
-
}
112
-
if (c == null) {
113
-
try {
114
-
c = system.loadClass(name);
115
-
} catch (Exceptione) {
116
-
// if (e.getMessage().indexOf("BeanInfo") == -1) {
117
-
// log.warn("Exception {}", e);
118
-
// }
119
-
}
120
-
}
121
-
}
122
-
123
-
// resolve if requested
124
-
if (resolve) {
125
-
resolveClass(c);
126
-
}
127
-
128
-
returnc;
129
-
}
130
-
131
-
/**
132
-
* Override the parent-first resource loading model established by java.lang.Classloader with child-first behavior.
133
-
*
134
-
* @param name the name of the resource to load, should not be null
135
-
* @return a {@link URL} for the resource, or null if it could not be found
136
-
*/
137
-
@Override
138
-
publicURLgetResource(Stringname) {
139
-
URLurl = findResource(name);
140
-
// If local search failed, delegate to parent
141
-
if (url == null) {
142
-
url = this.parent.getResource(name);
143
-
}
144
-
returnurl;
145
-
}
1
+
/*
2
+
* RED5 Open Source Media Server - https://github.com/Red5/ Copyright 2006-2016 by respective authors (see below). All rights reserved. Licensed under the Apache License, Version
3
+
* 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
4
+
* required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
5
+
* either express or implied. See the License for the specific language governing permissions and limitations under the License.
6
+
*/
7
+
8
+
packageorg.red5.classloading;
9
+
10
+
importjava.net.URL;
11
+
importjava.net.URLClassLoader;
12
+
13
+
/**
14
+
* An almost trivial no-fuss implementation of a class loader following the child-first delegation model. <i>Based on code from Ceki Gulcu</i>
Copy file name to clipboardExpand all lines: src/main/java/org/red5/classloading/ClassLoaderBuilder.java
+5-18Lines changed: 5 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,8 @@
1
1
/*
2
-
* RED5 Open Source Media Server - https://github.com/Red5/
3
-
*
4
-
* Copyright 2006-2016 by respective authors (see below). All rights reserved.
5
-
*
6
-
* Licensed under the Apache License, Version 2.0 (the "License");
7
-
* you may not use this file except in compliance with the License.
8
-
* You may obtain a copy of the License at
9
-
*
10
-
* http://www.apache.org/licenses/LICENSE-2.0
11
-
*
12
-
* Unless required by applicable law or agreed to in writing, software
13
-
* distributed under the License is distributed on an "AS IS" BASIS,
14
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
-
* See the License for the specific language governing permissions and
16
-
* limitations under the License.
2
+
* RED5 Open Source Media Server - https://github.com/Red5/ Copyright 2006-2016 by respective authors (see below). All rights reserved. Licensed under the Apache License, Version
3
+
* 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
4
+
* required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
5
+
* either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copy file name to clipboardExpand all lines: src/main/java/org/red5/daemon/EngineLauncher.java
+4-15Lines changed: 4 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,8 @@
1
1
/*
2
-
* RED5 Open Source Media Server - https://github.com/Red5/
3
-
*
4
-
* Copyright 2006-2016 by respective authors (see below). All rights reserved.
5
-
*
6
-
* Licensed under the Apache License, Version 2.0 (the "License");
7
-
* you may not use this file except in compliance with the License.
8
-
* You may obtain a copy of the License at
9
-
*
10
-
* http://www.apache.org/licenses/LICENSE-2.0
11
-
*
12
-
* Unless required by applicable law or agreed to in writing, software
13
-
* distributed under the License is distributed on an "AS IS" BASIS,
14
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
-
* See the License for the specific language governing permissions and
16
-
* limitations under the License.
2
+
* RED5 Open Source Media Server - https://github.com/Red5/ Copyright 2006-2016 by respective authors (see below). All rights reserved. Licensed under the Apache License, Version
3
+
* 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
4
+
* required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
5
+
* either express or implied. See the License for the specific language governing permissions and limitations under the License.
0 commit comments