1 7 8 package com.sun.corba.se.impl.io; 9 10 import java.security.AccessController ; 11 import java.security.PrivilegedExceptionAction ; 12 import java.security.PrivilegedActionException ; 13 import java.security.PrivilegedAction ; 14 15 import java.lang.reflect.Modifier ; 16 import java.lang.reflect.Array ; 17 import java.lang.reflect.Field ; 18 import java.lang.reflect.Member ; 19 import java.lang.reflect.Method ; 20 21 22 32 34 class ObjectStreamClassCorbaExt { 35 36 46 static final boolean isAbstractInterface(Class cl) { 47 if (!cl.isInterface() || java.rmi.Remote .class.isAssignableFrom(cl)) { return false; 50 } 51 Method [] methods = cl.getMethods(); 52 for (int i = 0; i < methods.length; i++) { 53 Class exceptions[] = methods[i].getExceptionTypes(); 54 boolean exceptionMatch = false; 55 for (int j = 0; (j < exceptions.length) && !exceptionMatch; j++) { 56 if ((java.rmi.RemoteException .class == exceptions[j]) || 57 (java.lang.Throwable .class == exceptions[j]) || 58 (java.lang.Exception .class == exceptions[j]) || 59 (java.io.IOException .class == exceptions[j])) { 60 exceptionMatch = true; 61 } 62 } 63 if (!exceptionMatch) { 64 return false; 65 } 66 } 67 return true; 68 } 69 70 73 static final boolean isAny(String typeString) { 74 75 int isAny = 0; 76 77 if ( (typeString != null) && 78 (typeString.equals("Ljava/lang/Object;") || 79 typeString.equals("Ljava/io/Serializable;") || 80 typeString.equals("Ljava/io/Externalizable;")) ) 81 isAny = 1; 82 83 return (isAny==1); 84 } 85 86 private static final Method [] getDeclaredMethods(final Class clz) { 87 return (Method []) AccessController.doPrivileged(new PrivilegedAction () { 88 public Object run() { 89 return clz.getDeclaredMethods(); 90 } 91 }); 92 } 93 94 } 95 | Popular Tags |