if (cl != null) {
try {
cls = cl.loadClass(name);
} catch (ClassNotFoundException ee) {
ee.printStackTrace();
throw new AWTError("DataTransferer not found: " + name);
}
}
}
if (cls != null) {
try {
method = cls.getDeclaredMethod("getInstanceImpl");
method.setAccessible(true);
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new AWTError("Cannot instantiate DataTransferer: " + name);
} catch (SecurityException e) {
e.printStackTrace();
throw new AWTError("Access is denied for DataTransferer: " + name);
}
}
if (method != null) {
try {
ret = (DataTransferer) method.invoke(null);
} catch (InvocationTargetException e) {
e.printStackTrace();
throw new AWTError("Cannot instantiate DataTransferer: " + name);
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new AWTError("Cannot access DataTransferer: " + name);
}
}
return ret;
}
};