1   /*
2    * $Id: TestCatchAllStrategy.java 10961 2008-02-22 19:01:02Z dfeist $
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.tck.testmodels.mule;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.api.MuleSession;
15  import org.mule.api.endpoint.OutboundEndpoint;
16  import org.mule.api.routing.RouterCatchAllStrategy;
17  import org.mule.api.routing.RoutingException;
18  import org.mule.util.StringMessageUtils;
19  
20  public class TestCatchAllStrategy implements RouterCatchAllStrategy
21  {
22      private OutboundEndpoint endpoint;
23  
24      public void setEndpoint(OutboundEndpoint endpoint)
25      {
26          this.endpoint = endpoint;
27      }
28  
29      public OutboundEndpoint getEndpoint()
30      {
31          return endpoint;
32      }
33  
34      public MuleMessage catchMessage(MuleMessage message, MuleSession session, boolean synchronous)
35          throws RoutingException
36      {
37          System.out.println(StringMessageUtils.getBoilerPlate("Caught an event in the router!", '*', 40));
38          return null;
39      }
40  }