ixcclassloader.java
来自「This is a resource based on j2me embedde」· Java 代码 · 共 1,155 行 · 第 1/4 页
JAVA
1,155 行
(byte) 0x69, (byte) 0x6f, (byte) 0x6e, (byte) 0x01, (byte) 0x00, (byte) 0x05, (byte) 0x28, (byte) 0x5b, (byte) 0x42, (byte) 0x29, (byte) 0x56, (byte) 0x01, (byte) 0x00, (byte) 0x18, (byte) 0x28, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x69, (byte) 0x6f, (byte) 0x2f, (byte) 0x49, (byte) 0x6e, (byte) 0x70, (byte) 0x75, (byte) 0x74, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x6d, (byte) 0x3b, (byte) 0x29, (byte) 0x56, (byte) 0x01, (byte) 0x00, (byte) 0x0a, (byte) 0x72, (byte) 0x65, (byte) 0x61, (byte) 0x64, (byte) 0x4f, (byte) 0x62, (byte) 0x6a, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x01, (byte) 0x00, (byte) 0x14, (byte) 0x28, (byte) 0x29, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x4f, (byte) 0x62, (byte) 0x6a, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x3b, (byte) 0x01, (byte) 0x00, (byte) 0x07, (byte) 0x66, (byte) 0x6f, (byte) 0x72, (byte) 0x4e, (byte) 0x61, (byte) 0x6d, (byte) 0x65, (byte) 0x01, (byte) 0x00, (byte) 0x25, (byte) 0x28, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x29, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x3b, (byte) 0x01, (byte) 0x00, (byte) 0x09, (byte) 0x67, (byte) 0x65, (byte) 0x74, (byte) 0x4d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x01, (byte) 0x00, (byte) 0x40, (byte) 0x28, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x5b, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x43, (byte) 0x6c, (byte) 0x61, (byte) 0x73, (byte) 0x73, (byte) 0x3b, (byte) 0x29, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x72, (byte) 0x65, (byte) 0x66, (byte) 0x6c, (byte) 0x65, (byte) 0x63, (byte) 0x74, (byte) 0x2f, (byte) 0x4d, (byte) 0x65, (byte) 0x74, (byte) 0x68, (byte) 0x6f, (byte) 0x64, (byte) 0x3b, (byte) 0x01, (byte) 0x00, (byte) 0x08, (byte) 0x74, (byte) 0x6f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x01, (byte) 0x00, (byte) 0x14, (byte) 0x28, (byte) 0x29, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x28, (byte) 0x4c, (byte) 0x6a, (byte) 0x61, (byte) 0x76, (byte) 0x61, (byte) 0x2f, (byte) 0x6c, (byte) 0x61, (byte) 0x6e, (byte) 0x67, (byte) 0x2f, (byte) 0x53, (byte) 0x74, (byte) 0x72, (byte) 0x69, (byte) 0x6e, (byte) 0x67, (byte) 0x3b, (byte) 0x29, (byte) 0x56, (byte) 0x00, (byte) 0x21, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x11, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x12, (byte) 0x00, (byte) 0x13, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x1d, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x05, (byte) 0x2a, (byte) 0xb7, (byte) 0x00, (byte) 0x01, (byte) 0xb1, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x09, (byte) 0x00, (byte) 0x16, (byte) 0x00, (byte) 0x17, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x34, (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0xbb, (byte) 0x00, (byte) 0x02, (byte) 0x59, (byte) 0xbb, (byte) 0x00, (byte) 0x03, (byte) 0x59, (byte) 0x2a, (byte) 0xb7, (byte) 0x00, (byte) 0x04, (byte) 0xb7, (byte) 0x00, (byte) 0x05, (byte) 0x4c, (byte) 0x2b, (byte) 0xb6, (byte) 0x00, (byte) 0x06, (byte) 0xc0, (byte) 0x00, (byte) 0x07, (byte) 0xb0, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0a, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x0b, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x0d, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x19, (byte) 0x00, (byte) 0x1a, (byte) 0x00, (byte) 0x09, (byte) 0x00, (byte) 0x1b, (byte) 0x00, (byte) 0x1c, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x93, (byte) 0x00, (byte) 0x04, (byte) 0x00, (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x53, (byte) 0x2c, (byte) 0xbe, (byte) 0xbd, (byte) 0x00, (byte) 0x08, (byte) 0x4e, (byte) 0x03, (byte) 0x36, (byte) 0x04, (byte) 0x15, (byte) 0x04, (byte) 0x2c, (byte) 0xbe, (byte) 0xa2, (byte) 0x00, (byte) 0x2f, (byte) 0x2c, (byte) 0x15, (byte) 0x04, (byte) 0x32, (byte) 0xc1, (byte) 0x00, (byte) 0x08, (byte) 0x99, (byte) 0x00, (byte) 0x11, (byte) 0x2d, (byte) 0x15, (byte) 0x04, (byte) 0x2c, (byte) 0x15, (byte) 0x04, (byte) 0x32, (byte) 0xc0, (byte) 0x00, (byte) 0x08, (byte) 0x53, (byte) 0xa7, (byte) 0x00, (byte) 0x11, (byte) 0x2d, (byte) 0x15, (byte) 0x04, (byte) 0x2c, (byte) 0x15, (byte) 0x04, (byte) 0x32, (byte) 0xc0, (byte) 0x00, (byte) 0x09, (byte) 0xb8, (byte) 0x00, (byte) 0x0a, (byte) 0x53, (byte) 0x84, (byte) 0x04, (byte) 0x01, (byte) 0xa7, (byte) 0xff, (byte) 0xd0, (byte) 0x2a, (byte) 0xb8, (byte) 0x00, (byte) 0x0a, (byte) 0x2b, (byte) 0x2d, (byte) 0xb6, (byte) 0x00, (byte) 0x0b, (byte) 0xb0, (byte) 0x4e, (byte) 0xbb, (byte) 0x00, (byte) 0x0d, (byte) 0x59, (byte) 0x2d, (byte) 0xb6, (byte) 0x00, (byte) 0x0e, (byte) 0xb7, (byte) 0x00, (byte) 0x0f, (byte) 0xbf, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x45, (byte) 0x00, (byte) 0x46, (byte) 0x00, (byte) 0x0c, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x15, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x26, (byte) 0x00, (byte) 0x09, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x13, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x15, (byte) 0x00, (byte) 0x1a, (byte) 0x00, (byte) 0x16, (byte) 0x00, (byte) 0x28, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x36, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x3c, (byte) 0x00, (byte) 0x1b, (byte) 0x00, (byte) 0x46, (byte) 0x00, (byte) 0x1c, (byte) 0x00, (byte) 0x47, (byte) 0x00, (byte) 0x1d, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x1d, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0x00, (byte) 0x1e }; IxcClassLoader(ClassLoader l) { super(l); } private void addMethodsFor(Class clazz, Hashtable methods) { if (theRemoteIF.isAssignableFrom(clazz)) { if (clazz.isInterface()) { Method[] m = clazz.getMethods(); for (int i = 0; i < m.length; i++) { methods.put(m[i], m[i]); } } else { Class[] ifs = clazz.getInterfaces(); for (int i = 0; i < ifs.length; i++) { addMethodsFor(ifs[i], methods); } Class sup = clazz.getSuperclass(); if (sup != null) { addMethodsFor(sup, methods); } } } } private Method[] getMethodsFor(Class remote) { Hashtable methods = new Hashtable(11); // Set of methods we have to generate. Both key and value are // (the same instance of) Method. This eliminates duplicates. addMethodsFor(remote, methods); Method[] result = new Method[methods.size()]; int i = 0; for (Enumeration e = methods.elements(); e.hasMoreElements();) { result[i++] = (Method) e.nextElement(); } return result; } private void addInterfacesFor(Class clazz, Hashtable interfaces, boolean addAll) { // If addAll = true, then add any interface to the list. // Else add interfaces that extend java.rmi.Remote to the list. if (clazz.isInterface()) { if (addAll) { interfaces.put(clazz, clazz); } else { if (theRemoteIF.isAssignableFrom(clazz)) { interfaces.put(clazz, clazz); addAll = true; } } } Class[] ifs = clazz.getInterfaces(); for (int i = 0; i < ifs.length; i++) { addInterfacesFor(ifs[i], interfaces, addAll); } Class sup = clazz.getSuperclass(); if (sup != null) { addInterfacesFor(sup, interfaces, addAll); } } private Class[] getInterfacesFor(Class remote) { // Returns a set of interfaces we have to add to a ConstantPool. Hashtable interfaces = new Hashtable(11); addInterfacesFor(remote, interfaces, false); Class[] result = new Class[interfaces.size()]; int i = 0; for (Enumeration e = interfaces.elements(); e.hasMoreElements();) { result[i++] = (Class) e.nextElement(); } return result; } // // Get the set of remote interfaces that are // implemented by the class cl. This includes // remote interfaces implemented by // the superclasses of cl. // private Class[] getRemoteInterfaces(Class cl) { HashSet interfaces = new HashSet(); getRemoteInterfacesFor(cl, interfaces); Class[] result = new Class[interfaces.size()]; Iterator it = interfaces.iterator(); for (int i = 0; it.hasNext(); i++){ result[i] = (Class) it.next(); } return result; } private void getRemoteInterfacesFor(Class cl, HashSet interfaces) { while (cl != null) { Class[] ifs = cl.getInterfaces(); for (int i = 0; i < ifs.length; i++) { if (theRemoteIF.isAssignableFrom(ifs[i])) { interfaces.add(ifs[i]); } } cl = cl.getSuperclass(); } } private String nextStubName(String className) { // We expect to be called with this's lock held // fix for 4977190 return new String(className + "_stub" + (nextStubNumber++)); } private String descriptorFor(Method m) { String descriptor = "("; Class[] params = m.getParameterTypes(); for (int j = 0; j < params.length; j++) { descriptor += TypeInfo.descriptorFor(params[j]); } descriptor += ")"; descriptor += TypeInfo.descriptorFor(m.getReturnType()); return descriptor; } synchronized Class getStubClass(IxcClassLoader target, Class remote) throws RemoteException { loadUtilsClass(); Class result = (Class) generated.get(remote); if (result != null) { return result; } if (!theRemoteIF.isAssignableFrom(remote)) { throw new StubException("Remote class must implement Remote"); } try { String stubName = nextStubName(remote.getName()); // fix for 4977190 byte[] classBytes = generateStubClass(stubName.replace('.','/'), remote); // workaround to invoke defineClass() of a ClassLoader // that loaded an xlet.. ClassLoader loader = getParent(); final java.lang.reflect.Method m = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] { String.class, classBytes.getClass(), int.class, int.class });
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?