throw new RuntimeException("IllegalArgument for monitoring status :" + flag);
}
TracerServiceInfo tracerServiceInfo = new TracerServiceInfo();
ConfigurationContext configurationContext = getConfigContext();
AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
AxisModule axisModule = axisConfiguration.getModule(TracerConstants.WSO2_TRACER);
if (axisModule == null) {
throw new RuntimeException(TracerAdmin.class.getName() + " " +
TracerConstants.WSO2_TRACER + " is not available");
}
if (flag.equalsIgnoreCase("ON")) {
if (!axisConfiguration.isEngaged(axisModule.getName())) {
try {
axisConfiguration.engageModule(axisModule);
} catch (AxisFault axisFault) {
log.error(axisFault);
throw new RuntimeException(axisFault);
}
}
} else if (flag.equalsIgnoreCase("OFF")) {
if (axisConfiguration.isEngaged(axisModule.getName())) {
axisConfiguration.disengageModule(axisModule);
configurationContext.removeProperty(TracerConstants.MSG_SEQ_BUFFER);
}
}
TracePersister tracePersister = getTracePersister();