if ( Class.class.isInstance( platform ) ) {
jtaPlatformImplClass = (Class<JtaPlatform>) platform;
}
else {
final String platformImplName = platform.toString();
final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
try {
jtaPlatformImplClass = classLoaderService.classForName( platformImplName );
}
catch ( Exception e ) {
throw new HibernateException( "Unable to locate specified JtaPlatform class [" + platformImplName + "]", e );
}
}