1 /* 2 * $Id: UMOImmutableDescriptor.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.endpoint.UMOEndpoint; 14 import org.mule.umo.lifecycle.Initialisable; 15 import org.mule.umo.routing.UMOInboundMessageRouter; 16 import org.mule.umo.routing.UMOOutboundMessageRouter; 17 import org.mule.umo.routing.UMOResponseMessageRouter; 18 import org.mule.umo.transformer.UMOTransformer; 19 20 import java.beans.ExceptionListener; 21 import java.util.List; 22 import java.util.Map; 23 24 /** 25 * <code>UMODescriptor</code> describes all the properties for a Mule UMO. New Mule 26 * UMOs can be initialised as needed from their descriptor. 27 * 28 * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a> 29 * @version $Revision: 3798 $ 30 */ 31 public interface UMOImmutableDescriptor extends Initialisable 32 { 33 /** 34 * The exception strategy to use to handle exceptions in the Mule UMO. 35 * 36 * @return the exception strategy to use. If none has been set a default will be 37 * used. 38 */ 39 ExceptionListener getExceptionListener(); 40 41 /** 42 * The inbound Provider to use when receiveing an event. This may get overidden 43 * by the configured behaviour of the inbound router on this component 44 * 45 * @return the inbound endpoint or null if one is not set 46 * @see UMOEndpoint 47 * @deprecated use getInboundRouter() instead (see MULE-506) 48 */ 49 UMOEndpoint getInboundEndpoint(); 50 51 /** 52 * Gets the identifier for the Mule UMO created from the descriptor 53 * 54 * @return the identifier for the Mule UMO created from the descriptor 55 */ 56 String getName(); 57 58 /** 59 * The outbound Provider to use when sending an event. This may get overidden by 60 * the configured behaviour of the outbound router on this component 61 * 62 * @return the outbound endpoint or null if one is not set 63 * @see UMOEndpoint 64 * @deprecated use getOutboundRouter() instead (see MULE-506) 65 */ 66 UMOEndpoint getOutboundEndpoint(); 67 68 /** 69 * Returns any properties configured on this descriptor. 70 * 71 * @return properties defined for the descriptor. 72 */ 73 Map getProperties(); 74 75 /** 76 * Returns a list of interceptor objects that will be executed before/after the 77 * Mule UMO has executed 78 * 79 * @return a list of interceptor objects that will be executed before/after the 80 * Mule UMO has executed 81 */ 82 List getInterceptors(); 83 84 /** 85 * The version on the Mule UMO. This is currently not used by the mule run-time 86 * but may be used in future. 87 * 88 * @return the Descriptor Version 89 */ 90 String getVersion(); 91 92 /** 93 * String used to instansiate the object, this can be a class name or a reference 94 * to an object in a container 95 * 96 * @return the Object's class r reference name or an instance of the object to 97 * use 98 */ 99 Object getImplementation(); 100 101 /** 102 * Class used to instansiate the object, this can be a class name or a reference 103 * to an object in a container 104 * 105 * @return the Object's class representation 106 */ 107 Class getImplementationClass() throws UMOException; 108 109 /** 110 * Inbound Routers control how events are received by a component. If no router 111 * is set. A default will be used that uses the inboundProvider set on his 112 * descriptor. 113 * 114 * @return the inbound router for this component. This will always return a valid 115 * router. 116 * @see UMOInboundMessageRouter 117 */ 118 UMOInboundMessageRouter getInboundRouter(); 119 120 /** 121 * Outbound Routers control how events are published by a component once. the 122 * event has been processed. If no router is set. A default will be used that 123 * uses the outboundProvider set on his descriptor to route the event. 124 * 125 * @return the outbound router for this component 126 * @see UMOOutboundMessageRouter 127 */ 128 UMOOutboundMessageRouter getOutboundRouter(); 129 130 /** 131 * Response Routers control how events are returned in a request/response call. 132 * It cn be use to aggregate response events before returning, thus acting as a 133 * Join in a forked process. This can be used to make request/response calls a 134 * lot more efficient as independent tasks can be forked, execute concurrently 135 * and then join before the request completes 136 * 137 * @return the response router for this component 138 * @see UMOResponseMessageRouter 139 */ 140 UMOResponseMessageRouter getResponseRouter(); 141 142 /** 143 * The transformer to use when receiving events or data. 144 * 145 * @return the Inbound transformer to use 146 * @deprecated use getInboundRouter() instead (see MULE-506) 147 */ 148 UMOTransformer getInboundTransformer(); 149 150 /** 151 * The transformer to use when sending events or data. 152 * 153 * @return the Outbound transformer to use 154 * @deprecated use getOutboundRouter() instead (see MULE-506) 155 */ 156 UMOTransformer getOutboundTransformer(); 157 158 /** 159 * The transformer to use when sending events or data back as a response. 160 * 161 * @return the response transformer to use 162 */ 163 UMOTransformer getResponseTransformer(); 164 165 String getEncoding(); 166 167 /** 168 * Determines if only a single instance of this component is created. This is 169 * useful when a component hands off event processing to another engine such as 170 * Rules processing or Bpel and the processing engine allocates and manages its 171 * own threads. 172 * 173 * @return true if this component is a singleton 174 */ 175 boolean isSingleton(); 176 177 /** 178 * Returns the initial state of this component 179 * 180 * @return the initial state of this component 181 */ 182 String getInitialState(); 183 184 /** 185 * Returns the name of the contaier where the object for this descriptor resides. 186 * If this value is 'none' the 'implementaiton' attributed is expected to be a 187 * fully qualified class name that will be instanciated. 188 * 189 * @return the container name, or null if it is not known - in which case each 190 * container will be queried for the component implementation. 191 */ 192 String getContainer(); 193 } 194