Hi Rick,
The patch looks good, some comments:
- I think NoServerPlatformDetector.checkPlatform should return
TargetServer.None rather than TargetServer.DEFAULT;
- updateServerPlatform typically called two times (once in
predeploy, once in deploy) - to detect server platform no more than
once consider adding a boolean flag to EntityManagerSetupImpl;
-- actually better to define a static variable
EntityManagerSetupImpl.detectedServerPlatformClass and set it the
first time auto detection is done - that way detection will be
performed just once (except for possible initialization concurrency)
- WLSPlatformDector:
public String checkPlatform() {
String platform = null;
try {
if(this.class.getClassLoader().getClass().getName().contains("weblogic")
{
platform = ServerPlatform.WebLogic;
Class clazz =
PrivilegedAccessHelper.getClassForName("weblogic.version");
Method method = PrivilegedAccessHelper.getMethod(clazz,
"getReleaseBuildVersion", null, false);
String serverNameAndVersion = (String)
PrivilegedAccessHelper.invokeMethod(method, null, null);
if (Helper.compareVersions(serverNameAndVersion, "9")
>= 0) {
if (Helper.compareVersions(serverNameAndVersion,
"10") >= 0) {
platform = ServerPlatform.WebLogic_10;
} else {
platform = ServerPlatform.WebLogic_9;
}
}
}
} catch (Throwable ex){}
return platform;
}
Thanks,
Andrei
On 1/5/2015 6:21 PM, Rick Curtis wrote:
Andrei -
Please take a look at the patch attached below and let me
know what you think. If it seems to be in the right direction,
could I have you write a WLSPlatformDector that could be
included in the initial commit?
Thanks,
Rick
_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
|