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.api.component; 8 9 import org.mule.api.MessagingException; 10 import org.mule.api.MuleEvent; 11 import org.mule.api.MuleException; 12 import org.mule.api.endpoint.ImmutableEndpoint; 13 import org.mule.api.processor.MessageProcessor; 14 15 public interface InterfaceBinding extends MessageProcessor 16 { 17 /** 18 * This method is responsible for routing the Message via the MuleSession. The 19 * logic for this method will change for each type of router depending on 20 * expected behaviour. For example, a MulticastingRouter might just iterate 21 * through the list of assoaciated endpoints sending the message. Another type of 22 * router such as the ExceptionBasedRouter will hit the first endpoint, if it 23 * fails try the second, and so on. Most router implementations will extends the 24 * FilteringOutboundRouter which implements all the common logic need for a 25 * router. 26 * 27 * @return a result message if any from the invocation. If the endpoint bound has 28 * a one-way exchange pattern configured a null result will always be 29 * returned. 30 * @throws MessagingException if any errors occur during the sending of messages 31 * @throws MuleException 32 * @see org.mule.routing.outbound.FilteringOutboundRouter 33 * @see org.mule.routing.outbound.ExceptionBasedRouter 34 * @see org.mule.routing.outbound.MulticastingRouter 35 * @since 2.1 the synchronous argument has been removed. Instead use the 36 * synchronous attribute of the endpoint you are dispatching to. 37 */ 38 MuleEvent process(MuleEvent event) throws MuleException; 39 40 void setEndpoint(ImmutableEndpoint endpoint) throws MuleException; 41 42 ImmutableEndpoint getEndpoint(); 43 44 Class<?> getInterface(); 45 46 void setInterface(Class<?> interfaceClass); 47 48 String getMethod(); 49 50 void setMethod(String method); 51 52 /** 53 * This wires the dynamic proxy to the service object. 54 */ 55 Object createProxy(Object target); 56 }