public TypeInfo getTypeInfo(ResourceContext resource) throws Throwable { return factory.getTypeInfo(resource.loadClass()); } }
public TypeInfo createTypeInfo(ResourceContext context) throws Exception { return factory.getTypeInfo(context.loadClass()); } }
/** * This one loads the class. * * @param resource the resource * @return the owner url */ public URL findOwnerURL(ResourceContext resource) { if (resource.isClass() == false) throw new IllegalArgumentException("Can only handle classes: " + resource); Class<?> clazz = resource.loadClass(); ProtectionDomain domain = clazz.getProtectionDomain(); CodeSource source = domain.getCodeSource(); return source.getLocation(); } }