View Javadoc

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