try {
final ServerBean thisBean = this;
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
NSFService nsfservice = null;
for (HttpService service : LCDEnvironment.getInstance().getServices()) {
if (service instanceof NSFService) {
nsfservice = (NSFService) service;
break;
}
}
if (nsfservice != null) {
try {
NSFComponentModule forcedMod = nsfservice.loadModule(filepath);
Class<?> klazz = forcedMod.getModuleClassLoader().loadClass(className);
Object cacheMeIfYouCan = klazz.newInstance();
thisBean.put(key, cacheMeIfYouCan);
} catch (Throwable t) {
t.printStackTrace();