/** * Checks if the {@link SensorInstrumentationPoint} exists in the * {@link MethodInstrumentationConfig}. If not new one is created, registered with registration * service and saved in the {@link MethodInstrumentationConfig}. * * @param agentConfiguration * {@link AgentConfig} to read platform id. * @param methodType * {@link MethodType} in question. * @param methodInstrumentationConfig * {@link MethodInstrumentationConfig}. * @return {@link SensorInstrumentationPoint} for the {@link MethodInstrumentationConfig}. */ protected SensorInstrumentationPoint getOrCreateSensorInstrumentationPoint(AgentConfig agentConfiguration, MethodType methodType, MethodInstrumentationConfig methodInstrumentationConfig) { // check for existing SensorInstrumentationPoint sensorInstrumentationPoint = methodInstrumentationConfig.getSensorInstrumentationPoint(); // if not create new one if (null == sensorInstrumentationPoint) { // if not create new and register long id = registerMethod(agentConfiguration, methodType, methodInstrumentationConfig); sensorInstrumentationPoint = new SensorInstrumentationPoint(); sensorInstrumentationPoint.setId(id); if (Character.CONSTRUCTOR.equals(methodType.getMethodCharacter())) { sensorInstrumentationPoint.setConstructor(true); } // set to method instrumentation methodInstrumentationConfig.setSensorInstrumentationPoint(sensorInstrumentationPoint); } return sensorInstrumentationPoint; }