View Javadoc

1   /*
2    * $Id: Invocation.java 12269 2008-07-10 04:19:03Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.interceptor;
12  
13  import org.mule.api.MuleEvent;
14  import org.mule.api.MuleException;
15  import org.mule.api.MuleMessage;
16  import org.mule.api.service.Service;
17  
18  /**
19   * Call the embedded component.  Because interception is "lower level" in 2.x, it cannot
20   * return a MuleMessage - instead an Object is returned.
21   *
22   * <p>If you are using the adapter in the Spring Extras package then, if you want that same object to be
23   * returned as the result, you do not need to construct a new message, just return null and the
24   * adapter will manage the result correctly. 
25   *
26   * @deprecated - This is only used for backwards compatability with old style (Mule 1.x) interceptors
27   */
28  public interface Invocation
29  {
30  
31      /**
32       * Calls the component
33       *
34       * @return the result of invoking the component
35       * @throws org.mule.api.MuleException if something goes wrong
36       */
37      Object execute() throws MuleException;
38  
39      Service getService();
40  
41      MuleEvent getEvent();
42  
43      MuleMessage getMessage();
44  
45  }