KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > lifecycle > Callable


1 /*
2  * $Id: Callable.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.umo.lifecycle;
12
13 import org.mule.umo.UMOEventContext;
14
15 /**
16  * <code>Callable</code> is used to provide UMOs with an interface that supports
17  * event calls. UMO components do not have to implement this interface, though the
18  * <code>onCall</code> method provides an example lifecycle method that is executed
19  * when an event is received for the implementing component.
20  *
21  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
22  * @version $Revision: 3798 $
23  */

24 public interface Callable extends UMOEventListener
25 {
26     /**
27      * Passes the event to the listener
28      *
29      * @param eventContext the context of the current event being process
30      * @return Object this object can be anything. When the
31      * <code>UMOLifecycleAdapter</code> for the component receives this
32      * object it will first see if the Object is an <code>UMOMessage</code>
33      * if not and the Object is not null a new message will be created using
34      * the returned object as the payload. This new event will then get
35      * published via the configured outbound router if-
36      * <ol>
37      * <li>One has been configured for the UMO.</li>
38      * <li>the <code>setStopFurtherProcessing(true)</code> wasn't called
39      * on the event context event.</li>
40      * </ol>
41      * @throws Exception if the event fails to process properly. If exceptions aren't
42      * handled by the implementation they will be handled by the
43      * exceptionListener associated with the component
44      */

45     Object JavaDoc onCall(UMOEventContext eventContext) throws Exception JavaDoc;
46 }
47
Popular Tags