1 /* 2 * $Id: UMOOutboundRouterCollection.java 7976 2007-08-21 14:26:13Z dirk.olmes $ 3 * -------------------------------------------------------------------------------------- 4 * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.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.umo.routing; 12 13 import org.mule.umo.MessagingException; 14 import org.mule.umo.UMOMessage; 15 import org.mule.umo.UMOSession; 16 import org.mule.umo.endpoint.UMOEndpoint; 17 18 /** 19 * <code>UMOOutboundRouterCollection</code> is responsible for holding all outbound routers for a service component. 20 */ 21 22 public interface UMOOutboundRouterCollection extends UMORouterCollection 23 { 24 /** 25 * Prepares one or more events to be dispached by a Message Dispatcher. 26 * 27 * @param message The source Message 28 * @param session The current session 29 * @return a list containing 0 or events to be dispatched 30 * @throws RoutingException If any of the events cannot be created. 31 */ 32 UMOMessage route(UMOMessage message, UMOSession session, boolean synchronous) throws MessagingException; 33 34 /** 35 * A helper method for finding out which endpoints a message would be routed to 36 * without actually routing the the message. 37 * 38 * @param message the message to retrieve endpoints for 39 * @return an array of UMOEndpoint objects or an empty array 40 * @throws RoutingException if there is a filter exception 41 */ 42 UMOEndpoint[] getEndpointsForMessage(UMOMessage message) throws MessagingException; 43 44 /** 45 * Determines if any endpoints have been set on this router. 46 * 47 * @return 48 */ 49 boolean hasEndpoints(); 50 }