01: /*
02: * $Id: NestedRouter.java 10961 2008-02-22 19:01:02Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.routing;
12:
13: import org.mule.api.MessagingException;
14: import org.mule.api.MuleMessage;
15: import org.mule.api.MuleSession;
16: import org.mule.api.endpoint.OutboundEndpoint;
17:
18: public interface NestedRouter extends Router {
19:
20: /**
21: * This method is responsible for routing the Message via the MuleSession. The logic
22: * for this method will change for each type of router depending on expected
23: * behaviour. For example, a MulticastingRouter might just iterate through the
24: * list of assoaciated endpoints sending the message. Another type of router such
25: * as the ExceptionBasedRouter will hit the first endpoint, if it fails try the
26: * second, and so on. Most router implementations will extends the
27: * FilteringOutboundRouter which implements all the common logic need for a
28: * router.
29: *
30: * @param message the message to send via one or more endpoints on this router
31: * @param session the session used to actually send the event
32: * @param synchronous whether the invocation process should be synchronous or not
33: * @return a result message if any from the invocation. If the synchronous flag
34: * is false a null result will always be returned.
35: * @throws MessagingException if any errors occur during the sending of messages
36: * @see org.mule.routing.outbound.FilteringOutboundRouter
37: * @see org.mule.routing.outbound.ExceptionBasedRouter
38: * @see org.mule.routing.outbound.MulticastingRouter
39: */
40: MuleMessage route(MuleMessage message, MuleSession session,
41: boolean synchronous) throws MessagingException;
42:
43: void setEndpoint(OutboundEndpoint endpoint);
44:
45: OutboundEndpoint getEndpoint();
46:
47: Class getInterface();
48:
49: void setInterface(Class interfaceClass);
50:
51: String getMethod();
52:
53: void setMethod(String method);
54:
55: /**
56: * This wires the dynamic proxy to the service object.
57: *
58: * @param target
59: */
60: Object createProxy(Object target);
61: }
|