private RealmAdapter getRealmAdapter(WebBundleDescriptor wbd, boolean isSystemApp, String realmName) {
ModuleType mType = ((wbd != null) ? wbd.getModuleType() : ModuleType.WAR);
String mTyString = mType.toString();
if ("org.jvnet.glassfish.comms.deployment.backend.SipArchiveDeployer".equals(mTyString)) {
String realmClassName = PluggableContextInfo.getCustomRealmAdapter(mType.toString());
RealmAdapter adapter = null;
try {
Class realmClass = Class.forName(realmClassName);
Constructor ctor = realmClass.getConstructor(
new Class[]{com.sun.enterprise.deployment.WebBundleDescriptor.class, boolean.class, String.class});
adapter = (RealmAdapter) ctor.newInstance(wbd, isSystemApp, realmName);
} catch (Throwable t) {
_logger.log(Level.SEVERE, "Unable to create context", t);
return null;
}
return adapter;
} else {
return new RealmAdapter(wbd, isSystemApp, realmName);
}
}