View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.api.annotations.param;
8   
9   import java.util.List;
10  import java.util.Map;
11  
12  /**
13   * Tests various cases for how headers can added to an outbound message through a generic map by injecting the 
14   * map into a component invocation
15   */
16  public class OutboundHeadersAnnotationComponent
17  {
18      public Map<String, Object> processHeaders(@OutboundHeaders Map<String, Object> headers)
19      {
20          headers.put("bar", "barValue");
21          //Verify that we receive any outbound headers already set on the message
22          if(headers.containsKey("foo"))
23          {
24              headers.put("foo", "fooValue");
25          }
26          return headers;
27      }
28  
29      //Can only use the {@link OutboundHeaders} annotation on Map parameters
30      public List<?> invalidParamType(@OutboundHeaders List<?> headers)
31      {
32          return headers;
33      }
34  }