1 /* 2 * $Id: InterfaceBinding.java 20813 2010-12-21 11:37:48Z dirk.olmes $ 3 * -------------------------------------------------------------------------------------- 4 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com 5 * 6 * The software in this package is published under the terms of the CPAL v1.0 7 * license, a copy of which has been included with this distribution in the 8 * LICENSE.txt file. 9 */ 10 11 package org.mule.api.component; 12 13 import org.mule.api.MessagingException; 14 import org.mule.api.MuleEvent; 15 import org.mule.api.MuleException; 16 import org.mule.api.endpoint.ImmutableEndpoint; 17 import org.mule.api.processor.MessageProcessor; 18 19 public interface InterfaceBinding extends MessageProcessor 20 { 21 /** 22 * This method is responsible for routing the Message via the MuleSession. The 23 * logic for this method will change for each type of router depending on 24 * expected behaviour. For example, a MulticastingRouter might just iterate 25 * through the list of assoaciated endpoints sending the message. Another type of 26 * router such as the ExceptionBasedRouter will hit the first endpoint, if it 27 * fails try the second, and so on. Most router implementations will extends the 28 * FilteringOutboundRouter which implements all the common logic need for a 29 * router. 30 * 31 * @return a result message if any from the invocation. If the endpoint bound has 32 * a one-way exchange pattern configured a null result will always be 33 * returned. 34 * @throws MessagingException if any errors occur during the sending of messages 35 * @throws MuleException 36 * @see org.mule.routing.outbound.FilteringOutboundRouter 37 * @see org.mule.routing.outbound.ExceptionBasedRouter 38 * @see org.mule.routing.outbound.MulticastingRouter 39 * @since 2.1 the synchronous argument has been removed. Instead use the 40 * synchronous attribute of the endpoint you are dispatching to. 41 */ 42 MuleEvent process(MuleEvent event) throws MuleException; 43 44 void setEndpoint(ImmutableEndpoint endpoint) throws MuleException; 45 46 ImmutableEndpoint getEndpoint(); 47 48 Class<?> getInterface(); 49 50 void setInterface(Class<?> interfaceClass); 51 52 String getMethod(); 53 54 void setMethod(String method); 55 56 /** 57 * This wires the dynamic proxy to the service object. 58 */ 59 Object createProxy(Object target); 60 }