KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > UMOComponent


1 /*
2  * $Id: UMOComponent.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;
12
13 import org.mule.umo.lifecycle.Initialisable;
14 import org.mule.umo.lifecycle.Lifecycle;
15
16 import java.io.Serializable JavaDoc;
17
18 /**
19  * <code>UMOComponent</code> is the interal repesentation of a Mule Managed
20  * component. It is responsible for managing the interaction of events to and from
21  * the component as well as managing pooled resources.
22  *
23  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24  * @version $Revision: 3798 $
25  */

26
27 public interface UMOComponent extends Serializable JavaDoc, Lifecycle, Initialisable
28 {
29     /**
30      * @return the UMODescriptor associated with the component
31      * @see UMODescriptor
32      */

33     UMODescriptor getDescriptor();
34
35     /**
36      * Makes an asynhronous event call to the component.
37      *
38      * @param event the event to consume
39      * @throws UMOException if the event fails to be processed
40      */

41     void dispatchEvent(UMOEvent event) throws UMOException;
42
43     /**
44      * Makes a synhronous event call to the component. This event will be consumed by
45      * the component and a result returned.
46      *
47      * @param event the event to consume
48      * @return a UMOMessage containing the resulting message and properties
49      * @throws UMOException if the event fails to be processed
50      */

51     UMOMessage sendEvent(UMOEvent event) throws UMOException;
52
53     /**
54      * Determines whether this component has been started
55      *
56      * @return true is the component is started andready to receive events
57      */

58     boolean isStarted();
59
60     /**
61      * Gets the underlying instance form this component Where the Component
62      * implmentation provides pooling this is no 1-2-1 mapping between UMOComponent
63      * and instance, so this method will return the object in initial state. If the
64      * underlying component is Container managed in Spring or another IoC container
65      * then the object instance in the IoC container will be returned
66      *
67      * @return the underlying instance form this component
68      */

69     Object JavaDoc getInstance() throws UMOException;
70
71     /**
72      * Pauses event processing for a single Mule Component. Unlike stop(), a paused
73      * component will still consume messages from the underlying transport, but those
74      * messages will be queued until the component is resumed.
75      */

76     void pause() throws UMOException;
77
78     /**
79      * Resumes a single Mule Component that has been paused. If the component is not
80      * paused nothing is executed.
81      */

82     void resume() throws UMOException;
83
84     /**
85      * True if the component is in a paused state, false otherwise
86      *
87      * @return True if the component is in a paused state, false otherwise
88      */

89     boolean isPaused();
90 }
91
Popular Tags