This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have the following code, it does a Class.forName based on the content-type of a particular attachment. So far so good.... I have few questions, Please answer at your convenience .
1) If the same application is being accessed by multiple threads simultaneoulsy, will this cause a problem
2) Will the package org.buddy.deadlock be loaded every time it calls class.forName ?. Is this a performance hit ?
3) Also if the underlying classes in the org.buddy.deadlock package are dependent on third-party applications will they also be loaded with the call to class.forName ?.
1) If the same application is being accessed by multiple threads simultaneoulsy, will this cause a problem
That depends on what constitutes a "problem". As it is, the code may return an object that does not belong to the mimetype that's been passed in.
2) Will the package org.buddy.deadlock be loaded every time it calls class.forName ?. Is this a performance hit ?
Packages as such aren't loaded. Individual classes are loaded (once) when a class is instantiated that uses them.
3) Also if the underlying classes in the org.buddy.deadlock package are dependent on third-party applications will they also be loaded with the call to class.forName ?.
They, too, would be loaded (once, not again for each call) during instantiation, not during the class.forName call.