executionMarker.deactive();
executionMarker.deactive();
executionMarker.deactive();
executionMarker.deactive();
/** * {@inheritDoc} */ @Override public void dispatchConstructorBeforeCatch(long id, Object exceptionObject) { if (!executionMarker.isActive()) { try { executionMarker.active(); // rsc contains the settings of the actual constructor where the exception is // catched. RegisteredSensorConfig rsc = mappings.get(id); long sensorTypeId = exceptionSensor.getSensorTypeConfig().getId(); ICoreService invocCoreService = null; if (null != invocationSequenceHolder.get()) { // Need to replace the core service with the one from the invocation sequence so // that all data objects can be associated to that invocation record. invocCoreService = (ICoreService) invocationSequenceHolder.get(); } IExceptionSensorHook exceptionHook = (IExceptionSensorHook) exceptionSensor.getHook(); if (null != invocCoreService) { exceptionHook.dispatchBeforeCatchBody(invocCoreService, id, sensorTypeId, exceptionObject, rsc); } else { exceptionHook.dispatchBeforeCatchBody(coreService, id, sensorTypeId, exceptionObject, rsc); } } finally { executionMarker.deactive(); } } }
/** * {@inheritDoc} */ @Override public void dispatchConstructorOnThrowInBody(long id, Object object, Object[] parameters, Object exceptionObject) { if (!executionMarker.isActive()) { try { executionMarker.active(); // rsc contains the settings for the actual constructor where the exception was // thrown. RegisteredSensorConfig rsc = mappings.get(id); long sensorTypeId = exceptionSensor.getSensorTypeConfig().getId(); ICoreService invocCoreService = null; if (null != invocationSequenceHolder.get()) { // Need to replace the core service with the one from the invocation sequence so // that all data objects can be associated to that invocation record. invocCoreService = (ICoreService) invocationSequenceHolder.get(); } IExceptionSensorHook exceptionHook = (IExceptionSensorHook) exceptionSensor.getHook(); if (null != invocCoreService) { exceptionHook.dispatchOnThrowInBody(invocCoreService, id, sensorTypeId, object, exceptionObject, parameters, rsc); } else { exceptionHook.dispatchOnThrowInBody(coreService, id, sensorTypeId, object, exceptionObject, parameters, rsc); } } finally { executionMarker.deactive(); } } }
/** * {@inheritDoc} */ @Override public void dispatchOnThrowInBody(long id, Object object, Object[] parameters, Object exceptionObject) { if (!executionMarker.isActive()) { try { executionMarker.active(); // rsc contains the settings for the actual method where the exception was thrown. RegisteredSensorConfig rsc = mappings.get(id); MethodSensorTypeConfig sensorTypeConfig = exceptionSensor.getSensorTypeConfig(); long sensorTypeId = sensorTypeConfig.getId(); ICoreService invocCoreService = null; if (null != invocationSequenceHolder.get()) { // Need to replace the core service with the one from the invocation sequence so // that all data objects can be associated to that invocation record. invocCoreService = (ICoreService) invocationSequenceHolder.get(); } IExceptionSensorHook exceptionHook = (IExceptionSensorHook) exceptionSensor.getHook(); if (null != invocCoreService) { exceptionHook.dispatchOnThrowInBody(invocCoreService, id, sensorTypeId, object, exceptionObject, parameters, rsc); } else { exceptionHook.dispatchOnThrowInBody(coreService, id, sensorTypeId, object, exceptionObject, parameters, rsc); } } finally { executionMarker.deactive(); } } }
/** * {@inheritDoc} */ @Override public void dispatchFirstMethodAfterBody(long id, Object object, Object[] parameters, Object returnValue, boolean exception) { if (!executionMarker.isActive()) { try { executionMarker.active(); try { RegisteredSensorConfig rsc = mappings.get(id); // Now iterate over all registered sensor types and execute them // normal execution (sensor with highest priority first) for (IMethodSensor methodSensor : rsc.getMethodSensors()) { IMethodHook methodHook = (IMethodHook) methodSensor.getHook(); methodHook.firstAfterBody(id, methodSensor.getSensorTypeConfig().getId(), object, parameters, returnValue, exception, rsc); } } catch (Throwable throwable) { // NOPMD log.error("An error happened in the Hook Dispatcher! (after body)", throwable); } } finally { executionMarker.deactive(); } } }
/** * {@inheritDoc} */ @Override public void dispatchBeforeCatch(long id, Object exceptionObject) { if (!executionMarker.isActive()) { try { executionMarker.active(); // rsc contains the settings of the actual method where the exception is catched. RegisteredSensorConfig rsc = mappings.get(id); long sensorTypeId = exceptionSensor.getSensorTypeConfig().getId(); ICoreService invocCoreService = null; if (null != invocationSequenceHolder.get()) { // Need to replace the core service with the one from the invocation sequence so // that all data objects can be associated to that invocation record. invocCoreService = (ICoreService) invocationSequenceHolder.get(); } IExceptionSensorHook exceptionHook = (IExceptionSensorHook) exceptionSensor.getHook(); if (null != invocCoreService) { exceptionHook.dispatchBeforeCatchBody(invocCoreService, id, sensorTypeId, exceptionObject, rsc); } else { exceptionHook.dispatchBeforeCatchBody(coreService, id, sensorTypeId, exceptionObject, rsc); } } finally { executionMarker.deactive(); } } }