Coverage Report - org.mule.endpoint.inbound.InboundNotificationMessageProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
InboundNotificationMessageProcessor
0%
0/8
0%
0/2
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.endpoint.inbound;
 8  
 
 9  
 import org.mule.api.MuleEvent;
 10  
 import org.mule.api.MuleException;
 11  
 import org.mule.api.endpoint.InboundEndpoint;
 12  
 import org.mule.api.processor.MessageProcessor;
 13  
 import org.mule.context.notification.EndpointMessageNotification;
 14  
 import org.mule.transport.AbstractConnector;
 15  
 import org.mule.util.ObjectUtils;
 16  
 
 17  
 /**
 18  
  * Publishes a {@link EndpointMessageNotification}'s when a message is received.
 19  
  */
 20  
 public class InboundNotificationMessageProcessor implements MessageProcessor
 21  
 {
 22  
     protected InboundEndpoint endpoint;
 23  
 
 24  
     public InboundNotificationMessageProcessor(InboundEndpoint endpoint)
 25  0
     {
 26  0
         this.endpoint = endpoint;
 27  0
     }
 28  
 
 29  
     public MuleEvent process(MuleEvent event) throws MuleException
 30  
     {
 31  0
         AbstractConnector connector = (AbstractConnector) endpoint.getConnector();
 32  0
         if (connector.isEnableMessageEvents())
 33  
         {
 34  0
             connector.fireNotification(new EndpointMessageNotification(event.getMessage(), endpoint,
 35  
                 event.getFlowConstruct().getName(), EndpointMessageNotification.MESSAGE_RECEIVED));
 36  
         }
 37  
 
 38  0
         return event;
 39  
     }
 40  
 
 41  
     @Override
 42  
     public String toString()
 43  
     {
 44  0
         return ObjectUtils.toString(this);
 45  
     }
 46  
 }