}
private static void hasMcInterface(PrintStream out, String classname, URLClassLoader cl,
List<? extends ConfigProperty> listConfProp, String mcClassName, String tip)
{
ManagedConnection mcClz = null;
try
{
out.print(" " + tip + ": ");
Class<?> mcfClz = Class.forName(classname, true, cl);
ManagedConnectionFactory mcf = (ManagedConnectionFactory)mcfClz.newInstance();
Injection injector = new Injection();
for (ConfigProperty cp : listConfProp)
{
if (!XsdString.isNull(cp.getConfigPropertyValue()))
{
injector.inject(mcf, cp.getConfigPropertyName().getValue(),
cp.getConfigPropertyValue().getValue(), cp.getConfigPropertyType().getValue());
}
}
mcClz = mcf.createManagedConnection(null, null);
if (hasInterface(mcClz.getClass(), "javax.resource.spi." + mcClassName))
{
out.println("Yes");
}
else
{
out.println("No");
}
}
catch (Throwable t)
{
// Nothing we can do
t.printStackTrace(System.err);
out.println("Unknown");
}
finally
{
if (mcClz != null)
{
try
{
mcClz.destroy();
}
catch (ResourceException e)
{
e.printStackTrace();
}