public static com.sun.j2me.global.ResourceAbstractionLayer | getInstance()Returns an instance ResourceAbstractionLayer . This
instance is created only once (singleton) and then it is reused when
the method is called again.
if (abstractionLayer == null) {
String alClsName =
Configuration.getProperty(ABSTRACTION_LAYER_PROPERTY);
if (alClsName != null) {
try {
abstractionLayer = (ResourceAbstractionLayer)
Class.forName(alClsName).newInstance();
} catch (ClassNotFoundException cnf_ignore) {
/* intentionally ignored */
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Resource handler class does not exist:"
+ alClsName);
}
} catch (InstantiationException ie_ignore) {
/* intentionally ignored */
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Resource handler class missing constructor:"
+ alClsName);
}
} catch (IllegalAccessException iae_ignore) {
/* intentionally ignored */
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Resource handler class incorrect type:"
+ alClsName);
}
}
}
if (abstractionLayer == null) {
// try default abstraction layer
try {
abstractionLayer = (ResourceAbstractionLayer)Class.forName(
DEFAULT_ABSTRACTION_LAYER).newInstance();
} catch (ClassNotFoundException cnf_ignore) {
/* intentionally ignored */
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Default Resource handler class does not exist:"
+ DEFAULT_ABSTRACTION_LAYER);
}
} catch (InstantiationException ie_ignore) {
/* intentionally ignored */
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Resource handler class missing constructor:"
+ DEFAULT_ABSTRACTION_LAYER);
}
} catch (IllegalAccessException iae_ignore) {
/* intentionally ignored */
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_JSR238,
"Resource handler class incorrect type:"
+ DEFAULT_ABSTRACTION_LAYER);
}
}
}
}
return abstractionLayer;
|