40 |
|
|
41 |
import java.lang.reflect.Array; |
import java.lang.reflect.Array; |
42 |
import java.lang.reflect.Modifier; |
import java.lang.reflect.Modifier; |
43 |
|
import java.lang.reflect.Proxy; |
44 |
import java.util.Arrays; |
import java.util.Arrays; |
45 |
import java.util.Hashtable; |
import java.util.Hashtable; |
46 |
import java.util.Vector; |
import java.util.Vector; |
503 |
} |
} |
504 |
} |
} |
505 |
|
|
506 |
|
protected Class resolveProxyClass (String[] intfs) |
507 |
|
throws IOException, ClassNotFoundException |
508 |
|
{ |
509 |
|
SecurityManager sm = System.getSecurityManager (); |
510 |
|
|
511 |
|
if (sm == null) |
512 |
|
sm = new SecurityManager () {}; |
513 |
|
|
514 |
|
ClassLoader cl = currentClassLoader (sm); |
515 |
|
|
516 |
|
Class[] clss = new Class[intfs.length]; |
517 |
|
if(cl == null){ |
518 |
|
for (int i = 0; i < intfs.length; i++) |
519 |
|
clss[i] = Class.forName(intfs[i]); |
520 |
|
cl = ClassLoader.getSystemClassLoader(); |
521 |
|
} |
522 |
|
else |
523 |
|
for (int i = 0; i < intfs.length; i++) |
524 |
|
clss[i] = cl.loadClass(intfs[i]); |
525 |
|
try { |
526 |
|
return Proxy.getProxyClass(cl, clss); |
527 |
|
} catch (IllegalArgumentException e) { |
528 |
|
throw new ClassNotFoundException(null, e); |
529 |
|
} |
530 |
|
} |
531 |
|
|
532 |
/** |
/** |
533 |
Allows subclasses to resolve objects that are read from the |
Allows subclasses to resolve objects that are read from the |
534 |
stream with other objects to be returned in their place. This |
stream with other objects to be returned in their place. This |