On Mon, 7 Aug 2000, Juha Lindfors wrote:
> I was hoping the Class.getInterfaces would return all interfaces from
> superclasses as well. I guess not. Oh well.
>
> Anyhow, the way that jBoss plays with the classloaders, I'd rather not
> trust the classpath thingy. Could just travel the class hierarchy upwards
> with getSuperClass() and check the interfaces there as well. That's what
> isAssignableFrom has to do as well, no? Would just need to add recursion to
> the method.
The only advantage to re-implementing "isAssignableFrom" is that
we can avoid loading the interface class. But if the interface class
cannot be loaded, that is definitely an error, right? Since the bean
class *was* loaded, then if the interface class cannot be loaded the bean
class must not implement the interface (otherwise, how could it be
loaded?) and we can safely return false.
So I think it would be nicer to use the existing isAssignableFrom
and then return false in case we can't load the interface - why reinvent
the wheel?
But I agree with your later point that the interfaces we're
concerned with are EJB interfaces, so if they're not available we have
bigger problems.
Aaron