/** * Get all super-interfaces of a class, excluding the * given base interface. * Returns a set of strings containing class names. */ public static Set getSuperInterfaces(ClassLoader cl, String className, String baseClassName) throws ClassNotFoundException { Set allSuper = new HashSet(); if( !className.equals(baseClassName) ) { Class theClass = cl.loadClass(className); Class[] superInterfaces = theClass.getInterfaces(); for(int superIndex = 0; superIndex < superInterfaces.length; superIndex++) { Class currentClass = superInterfaces[superIndex]; String currentClassName = currentClass.getName(); if( !currentClassName.equals(baseClassName) ) { allSuper.add(currentClassName); allSuper.addAll(getSuperInterfaces(cl, currentClassName, baseClassName)); } } // End for -- each super interface } return allSuper; }
/** * Get all super-interfaces of a class, excluding the * given base interface. * Returns a set of strings containing class names. */ public static Set getSuperInterfaces(ClassLoader cl, String className, String baseClassName) throws ClassNotFoundException { Set allSuper = new HashSet(); if( !className.equals(baseClassName) ) { Class theClass = cl.loadClass(className); Class[] superInterfaces = theClass.getInterfaces(); for(int superIndex = 0; superIndex < superInterfaces.length; superIndex++) { Class currentClass = superInterfaces[superIndex]; String currentClassName = currentClass.getName(); if( !currentClassName.equals(baseClassName) ) { allSuper.add(currentClassName); allSuper.addAll(getSuperInterfaces(cl, currentClassName, baseClassName)); } } // End for -- each super interface } return allSuper; }
private Set getRemoteSuperInterfaces(ClassLoader jcl, String homeRemoteIntf) throws ClassNotFoundException { // all super interfaces of home or remote that need to be // processed for stubs. Set allSuperInterfaces = TypeUtil.getSuperInterfaces(jcl, homeRemoteIntf,"java.rmi.Remote"); Set remoteSuperInterfaces = new HashSet(); Iterator iter = allSuperInterfaces.iterator(); while (iter.hasNext()) { String intfName = (String) iter.next(); Class intfClass = jcl.loadClass(intfName); if ( java.rmi.Remote.class.isAssignableFrom(intfClass) && !(intfName.equals("javax.ejb.EJBHome")) && !(intfName.equals("javax.ejb.EJBObject")) ) { remoteSuperInterfaces.add(intfName); } } return remoteSuperInterfaces; }
private Set getRemoteSuperInterfaces(ClassLoader jcl, String homeRemoteIntf) throws ClassNotFoundException { // all super interfaces of home or remote that need to be // processed for stubs. Set allSuperInterfaces = TypeUtil.getSuperInterfaces(jcl, homeRemoteIntf,"java.rmi.Remote"); Set remoteSuperInterfaces = new HashSet(); Iterator iter = allSuperInterfaces.iterator(); while (iter.hasNext()) { String intfName = (String) iter.next(); Class intfClass = jcl.loadClass(intfName); if ( java.rmi.Remote.class.isAssignableFrom(intfClass) && !(intfName.equals("javax.ejb.EJBHome")) && !(intfName.equals("javax.ejb.EJBObject")) ) { remoteSuperInterfaces.add(intfName); } } return remoteSuperInterfaces; }