1 21 package org.jacorb.orb; 22 23 import org.omg.CORBA.*; 24 import org.omg.CORBA.portable.*; 25 26 import java.lang.reflect.*; 27 28 import org.jacorb.ir.RepositoryID; 29 import org.jacorb.util.ObjectUtil; 30 31 38 39 public class ApplicationExceptionHelper 40 { 41 46 47 public static void insert(org.omg.CORBA.Any any, ApplicationException s) 48 throws 49 ClassNotFoundException , 50 NoSuchMethodException , 51 IllegalAccessException , 52 InvocationTargetException 53 { 54 java.lang.Object userEx; 55 56 58 String name = RepositoryID.className(s.getId(), null); 59 String helperName = name + "Helper"; 60 61 63 Class exClass = ObjectUtil.classForName(name); 64 Class helperClass = ObjectUtil.classForName(helperName); 65 Class anyClass = org.omg.CORBA.Any .class; 66 Class isClass = org.omg.CORBA.portable.InputStream .class; 67 68 70 Method readMeth = 71 helperClass.getMethod("read", new Class [] { isClass }); 72 Method insertMeth = 73 helperClass.getMethod("insert", new Class [] { anyClass, exClass }); 74 75 81 userEx = 82 readMeth.invoke(null, new java.lang.Object [] { s.getInputStream () }); 83 insertMeth.invoke(null, new java.lang.Object [] {any, userEx}); 84 } 85 } 86 | Popular Tags |