コード例 #1
0
  @Override
  public boolean handleRequest(MessageContext context) {

    logger.debug("JaxRpcLogContextServerHandler.handleRequest()");

    String soapMessageString = getSOAPMessageString(context);

    SOAPMessageContext soapContext = (SOAPMessageContext) context;
    SOAPMessage message = soapContext.getMessage();

    PerfLogContextTrackingData perfLogContextTrackingData;

    perfLogContextTrackingData = retrieveLogContextFromSOAPHeader(context);

    // create a thread context
    logger.debug(
        "JaxRpcLogContextServerHandler: guid = "
            + perfLogContextTrackingData.getGuid()
            + " sessionId="
            + perfLogContextTrackingData.getSessionId()
            + " callingJVMHostId="
            + perfLogContextTrackingData.getCallingJvmHostId()
            + " callingJVMCloneId="
            + perfLogContextTrackingData.getCallingJvmCloneId()
            + " callingJVMDepth="
            + perfLogContextTrackingData.getCallingJvmDepthStr()
            + " userId="
            + perfLogContextTrackingData.getUserId()
            + " createTime="
            + perfLogContextTrackingData.getCreateTimeInMillisStr());
    createPerfLogContextForWSRequest(context, message, perfLogContextTrackingData);
    if (LoggerProperties.getInstance().isPerfLogWSCacheSOAPMessage())
      addSOAPMessageStringToPerfLogContextRequestData("JaxRpcServerSOAPRequest", soapMessageString);

    // track elapsed time for this web service...
    context.setProperty(
        ContextHandlerConstants.PROPERTY_NAME_startTime, new Long(System.currentTimeMillis()));
    return super.handleRequest(context);
  }
コード例 #2
0
 @Override
 public boolean handleFault(MessageContext msgContext) {
   String faultMessage = null;
   try {
     faultMessage = getSOAPMessageString(msgContext);
     if (logger.getDebugEnabled()) logger.debug("handleFault: " + faultMessage);
     msgContext.setProperty(ContextHandlerConstants.PROPERTY_NAME_FAULT, new Boolean(true));
     return super.handleFault(msgContext);
   } finally {
     PerfLogContext perfLogContext = PerfLogContextHelper.getCurrentThreadPerfLogContextObject();
     long elapsedTime = getElapsedTime(msgContext);
     PerfLogContextHelper.compensateForOutboundJvmCallExceptionIfAny();
     if (LoggerProperties.getInstance().isPerfLogWSEnabled()
         && (elapsedTime >= LoggerProperties.getInstance().getPerfLogWSThreshold()))
       logPerfMetrics(
           msgContext,
           elapsedTime,
           perfLogContext,
           new Exception("JaxRpcLogContextServerHandler:handleFault"),
           faultMessage);
     PerfLogContextHelper.endPerfLogTxnMonitor();
   }
 }