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 == null || !(obj instanceof StorageManager))
throw new SandeshaException(SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.storageManagerMustImplement));
StorageManager mgr = (StorageManager) obj;
storageManager = mgr;
return storageManager;
} catch (Exception e) {
String message = SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.cannotGetStorageManager);
if (log.isErrorEnabled())
log.error(message, e);
throw new SandeshaException(message,e);
}
}