1 /* 2 * $Id$ 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.client; 12 13 import org.mule.api.MuleException; 14 import org.mule.api.MuleMessage; 15 import org.mule.api.endpoint.InboundEndpoint; 16 import org.mule.api.endpoint.OutboundEndpoint; 17 18 import java.util.Map; 19 20 /** 21 * Extends {@link MuleClient} adding methods that allow the use of an endpoint 22 * instance. 23 */ 24 public interface LocalMuleClient extends MuleClient 25 { 26 27 /** 28 * Sends an event synchronously to a endpointUri via a Mule server and a 29 * resulting message is returned. 30 * 31 * @param endpoint 32 * @param payload the object that is the payload of the event 33 * @param messageProperties any properties to be associated with the payload. In 34 * the case of Jms you could set the JMSReplyTo property in these 35 * properties. 36 * @return A return message, this could be <code>null</code> if the the 37 * components invoked explicitly sets a return as <code>null</code>. 38 * @throws org.mule.api.MuleException 39 */ 40 MuleMessage process(OutboundEndpoint endpoint, Object payload, Map<String, Object> messageProperties) 41 throws MuleException; 42 43 /** 44 * Sends an event synchronously to a endpointUri via a Mule server and a 45 * resulting message is returned. 46 * 47 * @param endpoint 48 * @param message the Message for the event 49 * @return A return message, this could be <code>null</code> if the the 50 * components invoked explicitly sets a return as <code>null</code>. 51 * @throws org.mule.api.MuleException 52 */ 53 MuleMessage process(OutboundEndpoint endpoint, MuleMessage message) throws MuleException; 54 55 /** 56 * Will receive an event from an endpointUri determined by the URL. 57 * 58 * @param endpoint the Mule URL used to determine the destination and transport 59 * of the message 60 * @param timeout how long to block waiting to receive the event, if set to 0 the 61 * receive will not wait at all and if set to -1 the receive will wait 62 * forever 63 * @return the message received or <code>null</code> if no message was received 64 * @throws org.mule.api.MuleException 65 */ 66 MuleMessage request(InboundEndpoint endpoint, long timeout) throws MuleException; 67 68 /** 69 * Will register the specified processor as a listener for the inbound endpoint. 70 * This may be implemented by subscription or polling depending on the transport 71 * implementation 72 * 73 * @param endpoint 74 * @param processor 75 * @throws MuleException 76 */ 77 // void receive(InboundEndpoint endpoint, MessageProcessor processor) throws 78 // MuleException; 79 80 }