public static void assureInterface(String interfaceName, String superInterfaceName, String interfactType, ClassLoader cl) throws DeploymentException {
Class clazz = null;
try {
clazz = cl.loadClass(interfaceName);
} catch (ClassNotFoundException e) {
throw new DeploymentException(interfactType + " interface class not found: " + interfaceName);
}
if (!clazz.isInterface()) {
throw new DeploymentException(interfactType + " interface is not an interface: " + interfaceName);
}
Class superInterface = null;
try {
superInterface = cl.loadClass(superInterfaceName);
} catch (ClassNotFoundException e) {
throw new DeploymentException("Class " + superInterfaceName + " could not be loaded");
}
if (clazz.isAssignableFrom(superInterface)) {
throw new DeploymentException(interfactType + " interface does not extend " + superInterfaceName + ": " + interfaceName);
}
}