01: /*
02: * $Id: Model.java 11379 2008-03-17 02:46:56Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.model;
12:
13: import org.mule.api.NamedObject;
14: import org.mule.api.component.LifecycleAdapterFactory;
15: import org.mule.api.context.MuleContextAware;
16: import org.mule.api.lifecycle.Lifecycle;
17:
18: import java.beans.ExceptionListener;
19:
20: /**
21: * The <code>Model</code> encapsulates and manages the runtime behaviour of a
22: * Mule Server instance. It is responsible for maintaining the UMOs instances and
23: * their configuration.
24: */
25: public interface Model extends Lifecycle, MuleContextAware, NamedObject {
26: /**
27: * Returns the model type name. This is a friendly identifier that is used to
28: * look up the SPI class for the model
29: *
30: * @return the model type
31: */
32: String getType();
33:
34: /**
35: * The entry point resolver is used to determine the method to be called on a
36: * service when an event is received for it.
37: *
38: * @return Returns the entryPointResolver.
39: */
40: EntryPointResolverSet getEntryPointResolverSet();
41:
42: /**
43: * This will be used to build entry points on the components registered with the
44: * model.
45: *
46: * @param entryPointResolver The entryPointResolver to set. This will be used to
47: * build entry points on the components registered with the model.
48: */
49: void setEntryPointResolverSet(
50: EntryPointResolverSet entryPointResolver);
51:
52: /**
53: * The lifecycle adapter is used by the model to translate Mule lifecycle event
54: * to events that UMO components registered with the model understand. The
55: * <code>LifecycleAdapterFactory</code> is used by the model to instanciate
56: * LifecycleAdapters.
57: *
58: * @return Returns the lifecycleAdapterFactory used by this Model.
59: * @see LifecycleAdapterFactory
60: * @see org.mule.api.component.LifecycleAdapter
61: */
62: LifecycleAdapterFactory getLifecycleAdapterFactory();
63:
64: /**
65: * Sets the lifecycleAdapterFactory on the model.
66: *
67: * @param lifecycleAdapterFactory The lifecycleAdapterFactory to set on this
68: * model.
69: * @see LifecycleAdapterFactory
70: * @see org.mule.api.component.LifecycleAdapter
71: */
72: void setLifecycleAdapterFactory(
73: LifecycleAdapterFactory lifecycleAdapterFactory);
74:
75: /**
76: * The exception strategy to use by components managed by the model. The
77: * exception strategy is used when an exception occurs while processing the
78: * current event for a service. A service can define it's own exception
79: * strategy, but if it doesn't this implmentation will be used.
80: *
81: * @return the default exception strategy for this model.
82: * @see ExceptionListener
83: */
84: ExceptionListener getExceptionListener();
85:
86: /**
87: * The exception strategy to use by components managed by the model. The
88: * exception strategy is used when an exception occurs while processing the
89: * current event for a service. A service can define it's own exception
90: * strategy, but if it doesn't this implmentation will be used.
91: *
92: * @param listener the default exception strategy for this model.
93: * @see ExceptionListener
94: */
95: void setExceptionListener(ExceptionListener listener);
96:
97: }
|