Package org.jboss.wsf.spi.management.recording

Examples of org.jboss.wsf.spi.management.recording.Record


   protected boolean handleInbound(MessageContext ctx)
   {
      Endpoint endpoint = EndpointAssociation.getEndpoint();
      if (endpoint != null && isRecording(endpoint))
      {
         Record record = RecordFactory.newRecord();
         RecordGroupAssociation.pushGroupID(record.getGroupID());
         record.setDate(new Date());
         HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
         if (httpServletRequest != null)
         {
            try
            {
               record.setDestinationHost(new URL(httpServletRequest.getRequestURL().toString()).getHost());
               record.setSourceHost(httpServletRequest.getRemoteHost());
            }
            catch (Exception e)
            {
               log.warn("Unable to read from the http servlet request! " + e.getMessage());
            }
         }
         record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_REQUEST_HEADERS)));
         record.setMessageType(MessageType.INBOUND);
         record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
         boolean processEnvelope = false;
         for (Iterator<RecordProcessor> it = endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
         {
            processEnvelope = it.next().isProcessEnvelope();
         }
         if (processEnvelope) //skip message processing if not required since it's very time-consuming
         {
            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
            try
            {
               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
               if (soapEnv != null)
               {
                  record.setEnvelope(DOMWriter.printNode(soapEnv, true));
               }
            }
            catch (SOAPException ex)
            {
               log.error("Cannot trace SOAPMessage", ex);
View Full Code Here


   {
      Endpoint endpoint = EndpointAssociation.getEndpoint();
      if (endpoint != null && isRecording(endpoint))
      {
         String groupID = RecordGroupAssociation.popGroupID();
         Record record = RecordFactory.newRecord(groupID);
         record.setDate(new Date());
         record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_RESPONSE_HEADERS)));
         record.setMessageType(MessageType.OUTBOUND);
         record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
         boolean processEnvelope = false;
         for (Iterator<RecordProcessor> it = endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
         {
            processEnvelope = it.next().isProcessEnvelope();
         }
         if (processEnvelope) //skip message processing if not required since it's very time-consuming
         {
            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
            try
            {
               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
               if (soapEnv != null)
               {
                  record.setEnvelope(DOMWriter.printNode(soapEnv, true));
               }
            }
            catch (SOAPException ex)
            {
               log.error("Cannot trace SOAPMessage", ex);
View Full Code Here

      return sb.toString();
   }
  
   public static Record newRecord(String groupID)
   {
      Record record = new RecordImpl();
      record.setGroupID(groupID);
      return record;
   }
View Full Code Here

   protected boolean handleInbound(MessageContext ctx)
   {
      Endpoint endpoint = EndpointAssociation.getEndpoint();
      if (endpoint != null && isRecording(endpoint))
      {
         Record record = RecordFactory.newRecord();
         RecordGroupAssociation.pushGroupID(record.getGroupID());
         record.setDate(new Date());
         HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
         if (httpServletRequest != null)
         {
            try
            {
               record.setDestinationHost(new URL(httpServletRequest.getRequestURL().toString()).getHost());
               record.setSourceHost(httpServletRequest.getRemoteHost());
            }
            catch (Exception e)
            {
               log.warn("Unable to read from the http servlet request! " + e.getMessage());
            }
         }
         record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_REQUEST_HEADERS)));
         record.setMessageType(MessageType.INBOUND);
         record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
         boolean processEnvelope = false;
         for (Iterator<RecordProcessor> it = endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
         {
            processEnvelope = it.next().isProcessEnvelope();
         }
         if (processEnvelope) //skip message processing if not required since it's very time-consuming
         {
            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
            try
            {
               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
               if (soapEnv != null)
               {
                  record.setEnvelope(DOMWriter.printNode(soapEnv, true));
               }
            }
            catch (SOAPException ex)
            {
               log.error("Cannot trace SOAPMessage", ex);
View Full Code Here

   {
      Endpoint endpoint = EndpointAssociation.getEndpoint();
      if (endpoint != null && isRecording(endpoint))
      {
         String groupID = RecordGroupAssociation.popGroupID();
         Record record = RecordFactory.newRecord(groupID);
         record.setDate(new Date());
         record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_RESPONSE_HEADERS)));
         record.setMessageType(MessageType.OUTBOUND);
         record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
         boolean processEnvelope = false;
         for (Iterator<RecordProcessor> it = endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
         {
            processEnvelope = it.next().isProcessEnvelope();
         }
         if (processEnvelope) //skip message processing if not required since it's very time-consuming
         {
            SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
            try
            {
               SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
               if (soapEnv != null)
               {
                  record.setEnvelope(DOMWriter.printNode(soapEnv, true));
               }
            }
            catch (SOAPException ex)
            {
               log.error("Cannot trace SOAPMessage", ex);
View Full Code Here

      return sb.toString();
   }
  
   public static Record newRecord(String groupID)
   {
      Record record = new RecordImpl();
      record.setGroupID(groupID);
      return record;
   }
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.management.recording.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.