AxisConfiguration config = context.getAxisConfiguration();
Parameter classLoaderParam = config.getParameter(Sandesha2Constants.MODULE_CLASS_LOADER);
if(classLoaderParam != null) classLoader = (ClassLoader) classLoaderParam.getValue();
if (classLoader==null)
throw new SandeshaException (SandeshaMessageHelper.getMessage(SandeshaMessageKeys.classLoaderNotFound));
Class c = classLoader.loadClass(className);
Class configContextClass = context.getClass();
Constructor constructor = c.getConstructor(new Class[] { configContextClass });
Object obj = constructor.newInstance(new Object[] {context});
if (!(obj instanceof SecurityManager)) {
String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.securityManagerMustImplement, className);
throw new SandeshaException(message);
}
return (SecurityManager) obj;
} catch (Exception e) {
String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotInitSecurityManager, e.toString());
throw new SandeshaException(message,e);
}
}