Skip to content

Commit

Permalink
API Endpoint Phase 2: Add Endpoint route in RestEasy-4 Framework
Browse files Browse the repository at this point in the history
  • Loading branch information
IshikaDawda committed May 24, 2024
1 parent bd620dd commit ad6ef85
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.jboss.resteasy.core;

import com.newrelic.api.agent.security.NewRelicSecurity;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;
import org.jboss.resteasy.spi.HttpRequest;

import java.util.regex.Matcher;

@Weave(originalName = "org.jboss.resteasy.core.registry.MethodExpression")
public abstract class MethodExpression_Instrumentation {
public abstract String getPathExpression();
public void populatePathParams(HttpRequest request, Matcher matcher, String path){
Weaver.callOriginal();
try {
if (NewRelicSecurity.isHookProcessingActive()) {
NewRelicSecurity.getAgent().getSecurityMetaData().getMetaData().setEndpointRoute(getPathExpression());
}
} catch (Exception e) {
}
}
}

0 comments on commit ad6ef85

Please sign in to comment.