KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > impl > model > MuleProxy


1 /*
2  * $Id: MuleProxy.java 4219 2006-12-09 10:15:14Z lajos $
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.impl.model;
12
13 import org.mule.management.stats.ComponentStatistics;
14 import org.mule.umo.UMOEvent;
15 import org.mule.umo.UMOException;
16 import org.mule.umo.UMOImmutableDescriptor;
17 import org.mule.umo.lifecycle.Lifecycle;
18 import org.mule.util.queue.QueueSession;
19
20 import javax.resource.spi.work.Work JavaDoc;
21
22 /**
23  * <code>MuleProxy</code> is a proxy to a UMO. It is a poolable object that that
24  * can be executed in it's own thread.
25  */

26
27 public interface MuleProxy extends Work JavaDoc, Lifecycle
28 {
29
30     /**
31      * Sets the current event being processed
32      *
33      * @param event the event being processed
34      */

35     public void onEvent(QueueSession session, UMOEvent event);
36
37     public ComponentStatistics getStatistics();
38
39     public void setStatistics(ComponentStatistics stat);
40
41     /**
42      * Makes a synchronous call on the UMO
43      *
44      * @param event the event to pass to the UMO
45      * @return the return event from the UMO
46      * @throws UMOException if the call fails
47      */

48     public Object JavaDoc onCall(UMOEvent event) throws UMOException;
49
50     /**
51      * When an exception occurs this method can be called to invoke the configured
52      * UMOExceptionStrategy on the UMO
53      *
54      * @param exception If the UMOExceptionStrategy implementation fails
55      */

56     public void handleException(Exception JavaDoc exception);
57
58     /**
59      * Determines if the proxy is suspended
60      *
61      * @return true if the proxy (and the UMO) are suspended
62      */

63     public boolean isSuspended();
64
65     /**
66      * Controls the suspension of the UMO event processing
67      */

68     public void suspend();
69
70     /**
71      * Triggers the UMO to resume processing of events if it is suspended
72      */

73     public void resume();
74
75     /*
76      * (non-Javadoc)
77      *
78      * @see org.mule.umo.UMOLifecycleAdapter#getDescriptor()
79      */

80     public UMOImmutableDescriptor getDescriptor();
81 }
82
Popular Tags