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