View Javadoc

1   /*
2    * $Id: MixedAnnotationsComponent.java 20321 2010-11-24 15:21:24Z dfeist $
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.annotations.param;
12  
13  import java.util.HashMap;
14  import java.util.List;
15  import java.util.Map;
16  
17  import javax.activation.DataHandler;
18  
19  /**
20   * A component for testing invocations with more than one parameter
21   */
22  public class MixedAnnotationsComponent
23  {
24      public Map<?, ?> processAllAnnotated(@Payload String payload, 
25          @InboundHeaders("foo, bar") Map<?, ?> headers, 
26          @InboundAttachments("*") Map<String, DataHandler> attachments)
27      {
28          Map<String, Object> m = new HashMap<String, Object>(3);
29          m.put("payload", payload);
30          m.put("inboundHeaders", headers);
31          m.put("inboundAttachments", attachments);
32          return m;
33      }
34  
35      public Map<?, ?> processPayloadNotAnnotated(String payload, 
36          @InboundHeaders("foo, bar") Map<?, ?> headers, 
37          @InboundAttachments("*") List<DataHandler> attachments)
38      {
39          Map<String, Object> m = new HashMap<String, Object>(3);
40          m.put("payload", payload);
41          m.put("inboundHeaders", headers);
42          m.put("inboundAttachments", attachments);
43          return m;
44      }
45  }