Created
November 20, 2013 01:12
-
-
Save davemiller/7555802 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TracingHandler extends SimpleChannelUpstreamHandler { | |
private Tagging tagging; | |
public TracingHandler(Tagging tagging) { | |
this.tagging = tagging; | |
} | |
@Override | |
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { | |
HttpRequest httpRequest = (HttpRequest)e.getMessage(); | |
String tagString = httpRequest.getHeader(DT_HEADER); | |
if(tagString !=null && tagging.isTagValid(tagString)) { | |
tagging.setTagFromString(tagString); | |
tagging.startServerPurePath(); | |
} | |
//code you want to trace goes here | |
tagging.endServerPurePath(); //this could probably go in the writeComplete or channelClosed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment