public void listen()

in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/listeners/XRayListener.java [31:49]


    public void listen(Event event) {
        try {
            EventDispatcher dispatcher = isEventDownstream(event) ? downstreamEventDispatcher : upstreamEventDispatcher;

            if (event instanceof ServiceRequestEvent || event instanceof HttpServletNetworkRequestEvent) {
                dispatcher.dispatchRequestEvent(event);
            } else if (event instanceof ServiceResponseEvent || event instanceof HttpServletNetworkResponseEvent) {
                dispatcher.dispatchResponseEvent(event);
            } else {
                // Other events we don't care about so return.
                return;
            }
        } catch (Exception e) {
            // We dont want to propagate any exceptions back to the bus nor the application code, so we
            // just log it and continue.
            log.error("The X-Ray Agent had encountered an unexpected exception for the following event: "
                    + event.toString(), e);
        }
    }