/**
* INTERNAL:
*/
protected ServerPlatform buildCustomServerPlatformConfig(CustomServerPlatformConfig platformConfig, DatabaseSessionImpl session) {
ServerPlatform platform;
// Server class - XML schema default is org.eclipse.persistence.platform.server.CustomServerPlatform
String serverClassName = platformConfig.getServerClassName();
try {
Class serverClass = m_classLoader.loadClass(serverClassName);
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
Constructor constructor = (Constructor)AccessController.doPrivileged(new PrivilegedGetConstructorFor(serverClass, new Class[] { org.eclipse.persistence.sessions.DatabaseSession.class }, false));
platform = (ServerPlatform)AccessController.doPrivileged(new PrivilegedInvokeConstructor(constructor, new Object[] { session }));
}else{
Constructor constructor = PrivilegedAccessHelper.getConstructorFor(serverClass, new Class[] { org.eclipse.persistence.sessions.DatabaseSession.class }, false);
platform = (ServerPlatform)PrivilegedAccessHelper.invokeConstructor(constructor, new Object[] { session });
}
} catch (Throwable e) {
throw SessionLoaderException.failedToLoadTag("server-class", serverClassName, e);
}
// External transaction controller class
String externalTransactionControllerClass = platformConfig.getExternalTransactionControllerClass();
if (externalTransactionControllerClass != null) {
try {
platform.setExternalTransactionControllerClass(m_classLoader.loadClass(externalTransactionControllerClass));
} catch (Exception exception) {
throw SessionLoaderException.failedToLoadTag("external-transaction-controller-class", externalTransactionControllerClass, exception);
}
}