/** * {@inheritDoc} */ @Override public void onApplicationEvent(AgentMessagesReceivedEvent event) { if (event == null) { if (log.isDebugEnabled()) { log.debug("A 'null' event will not be processed."); } return; } // When we update to Spring v4, we should use @Conditional that the RetransformationManager // is not running if retransformation is not used. if (!Agent.agent.isUsingRetransformation()) { if (log.isInfoEnabled()) { log.info("Retransformation is disabled by the used retransformation strategy."); } return; } List<InstrumentationDefinition> instrumentationDefinitions = getInstrumentatioDefinitions(event.getAgentMessages()); if (CollectionUtils.isEmpty(instrumentationDefinitions)) { return; } // remove out-dated duplicates Collection<InstrumentationDefinition> cleanedInstrumentationDefinitions = removeOutdatedInstrumentationDefinitions(instrumentationDefinitions); processInstrumentationDefinitions(cleanedInstrumentationDefinitions); }