Hi.

OK, so if I really want to know what I'm doing, I probably want to know, how
many separate classloaders I have
and where they are loading from, right?

First step, would be to understand Phoenix classloaders -
I suppose there is at least one classloader per SAR and one for common jars,
perhaps another for bootstrapping and perhaps yet another ... - next step, to
understand their relations (which is parent to which) to see where there are
separate peers. 
Since one SAR contains the Jetty webserver, which in turn hosts the Axis
webapp, I suppose I'd have to figure these two out as well - classloaderwise I
mean. 
Final step: check whether some peers share a resource.

Upon first glance, this seems like a major task, huh.
Is there, by any chance, a brief document/page/posting/blog showing an overview
of Phoenix' classloaders somewhere...?
If someone knows, I'd be interested to know.

Thanks for helping, folks. Special thanks for the impressive response times.
Cheers,
Joerg



Berin Loritsch schrieb am 12.01.2004:
>Joerg Buchberger wrote:
>
>> 23361497, the interface defining the services for the
>> component that should be returned
>> 
>> Are you sure, that the interface and the component should
>> have equal hash codes,
>> even though the components interface is not equal to the
>> component itself?
>> Did you mean perhaps, that I should check
>> loggerInst.debug("here : " + System.identityHashCode(
>> MyComponentImpl.class ) );
>> instead?
>
>I think he was trying to get you to list the differences between
>the hashcode for the MyInterface.class, and the one that the
>proxied component said it implemented.
>
>The thing is that with classloaders, even if there are two classloaders
>that point to the same exact JAR file, the class hashcode for any one
>class (or interface) will be different when the two classloaders are not
>connected in any way.
>
>Proof:
>
>ClassLoader loader1 = new URLClassLoader(new URL[] {"file:otherJar.jar"});
>ClassLoader loader2 = new URLClassLoader(new URL[] {"file:otherJar.jar"});
>
>Class myClass1 = loader1.loadClass("demo.MyClass");
>Class myClass2 = loader2.loadClass("demo.MyClass");
>
>assert  myClass1.equals(myClass2);  // will fail!!!
>assert  myClass1.hashCode() == myClass2.hashCode(); // will fail!!!
>
>
>Now if loader2 was a child classloader of loader1, then the class returned
>would be the same.  However, they are peers, and completely separate.
>
>This is the type of check that should be made.
>
>-- 
>
>"They that give up essential liberty to obtain a little temporary safety
>  deserve neither liberty nor safety."
>                 - Benjamin Franklin
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to