View Javadoc

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