public static synchronized void initialise ( ) { // Only initialise if it has not already been created if ( _instance == null ) { // Check what environment we are running in. If we are in server mode we must use the // server diagnostic module. //Liberty COMMS TODO: //For now not enabling server side diagnostics as can not load SERVER_DIAG_MODULE_CLASS in a clean manner // without having dependency of COMMs server ( at least more than 4/5 classes are needed) which defeat // the purpose of COMMS client independence w.r.to COMMS server //Has to rework on load SERVER_DIAG_MODULE_CLASS without too many dependencies of COMMS server. /* if (RuntimeInfo.isServer()) { if (tc.isDebugEnabled()) SibTr.debug(tc, "We are in Server mode"); try { Class clazz = Class.forName(CommsConstants.SERVER_DIAG_MODULE_CLASS); Method getInstanceMethod = clazz.getMethod("getInstance", new Class[0]); _instance = (CommsDiagnosticModule) getInstanceMethod.invoke(null, (Object[]) null); } catch (Exception e) { FFDCFilter.processException(e, CLASS_NAME + ".initialise", CommsConstants.COMMSDIAGMODULE_INITIALIZE_01, CommsConstants.SERVER_DIAG_MODULE_CLASS); if (tc.isDebugEnabled()) SibTr.debug(tc, "Unable to load the Comms Server Diagnostic Module", e); // In this case, fall out of here with a null _instance and default to the client // one. At least in that case we get _some_ diagnostics... // This is the point where I mention that that shouldn't ever happen :-). } } */ // In all other cases use the client diagnostic module. Note we can instantiate this // directly as we are located in the same build component if ( _instance == null ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "We are NOT in Server mode" ) ; _instance = ClientCommsDiagnosticModule . getInstance ( ) ; } // Now register the packages _instance . register ( packageList ) ; } }
Initialises the diagnostic module .