View Javadoc

1   /*
2    * $Id: MuleMessageService.java 20813 2010-12-21 11:37:48Z dirk.olmes $
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.module.jbpm;
12  
13  import org.mule.MessageExchangePattern;
14  import org.mule.api.MuleMessage;
15  import org.mule.module.bpm.MessageService;
16  import org.mule.module.bpm.ProcessComponent;
17  
18  import java.util.Map;
19  
20  /**
21   * Proxy for the message-generation service provided by Mule. The real service gets
22   * injected here by the {@link ProcessComponent}.
23   */
24  public class MuleMessageService implements MessageService
25  {
26      private MessageService messageService;
27  
28      public void setMessageService(MessageService messageService)
29      {
30          this.messageService = messageService;
31      }
32  
33      public MuleMessage generateMessage(String endpoint,
34                                         Object payloadObject,
35                                         Map messageProperties,
36                                         MessageExchangePattern mep) throws Exception
37      {
38          return messageService.generateMessage(endpoint, payloadObject, messageProperties, mep);
39      }
40  }