Based on the parameter passed in, this method creates the necessary
factory desired.
The current mapping for rmic names are as follows:
- sun = SUN's rmic
- kaffe = Kaffe's rmic
- a fully quallified classname = the name of a rmic
adapter
- weblogic = weblogic compiler
- forking = Sun's RMIC by forking a new JVM
//convert to lower case in the English locale,
String compiler = rmicType.toLowerCase(Locale.ENGLISH);
//handle default specially by choosing the sun or kaffe compiler
if (DEFAULT_COMPILER.equals(compiler) || compiler.length() == 0) {
compiler = KaffeRmic.isAvailable()
? KaffeRmic.COMPILER_NAME
: SunRmic.COMPILER_NAME;
}
if (SunRmic.COMPILER_NAME.equals(compiler)) {
return new SunRmic();
} else if (KaffeRmic.COMPILER_NAME.equals(compiler)) {
return new KaffeRmic();
} else if (WLRmic.COMPILER_NAME.equals(compiler)) {
return new WLRmic();
} else if (ForkingSunRmic.COMPILER_NAME.equals(compiler)) {
return new ForkingSunRmic();
} else if (XNewRmic.COMPILER_NAME.equals(compiler)) {
return new XNewRmic();
}
//no match? ask for the non-lower-cased type
return resolveClassName(rmicType);