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