KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > umo > manager > UMOManager


1 /*
2  * $Id: UMOManager.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.manager;
12
13 import org.mule.impl.internal.notifications.NotificationException;
14 import org.mule.umo.UMOException;
15 import org.mule.umo.UMOInterceptorStack;
16 import org.mule.umo.endpoint.UMOEndpoint;
17 import org.mule.umo.lifecycle.InitialisationException;
18 import org.mule.umo.lifecycle.Lifecycle;
19 import org.mule.umo.model.UMOModel;
20 import org.mule.umo.provider.UMOConnector;
21 import org.mule.umo.security.UMOSecurityManager;
22 import org.mule.umo.transformer.UMOTransformer;
23 import org.mule.util.queue.QueueManager;
24
25 import javax.transaction.TransactionManager JavaDoc;
26
27 import java.util.Map JavaDoc;
28
29 /**
30  * <code>UMOManager</code> maintains and provides services for a UMO server
31  * instance.
32  *
33  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
34  * @version $Revision: 3798 $
35  */

36 public interface UMOManager extends Lifecycle
37 {
38     /**
39      * Getter for the envionment parameters declared in the mule-config.xml
40      *
41      * @param key the propery name
42      * @return the property value
43      */

44     Object JavaDoc getProperty(Object JavaDoc key);
45
46     /**
47      * @param logicalName the name of the endpoint to retrieve
48      * @return the endpoint instnace if it exists
49      */

50     UMOConnector lookupConnector(String JavaDoc logicalName);
51
52     /**
53      * @param logicalName the logical mapping name for an endpointUri i.e. rather
54      * than specifing an endpointUri to be someone@my.com you can supply a
55      * more descriptive name such as <i>The System Administrator</i>
56      * @param defaultName
57      * @return the actual endpointUri value or null if it is not found
58      */

59     String JavaDoc lookupEndpointIdentifier(String JavaDoc logicalName, String JavaDoc defaultName);
60
61     /**
62      * Getter for a global endpoint. Any endpoints returned from this method can be
63      * modified, as they are clones of the registered endpoints.
64      *
65      * @param logicalName the name of the endpoint
66      * @return the <code>UMOEndpoint</code> or null if it doesn't exist
67      */

68     UMOEndpoint lookupEndpoint(String JavaDoc logicalName);
69
70     /**
71      * Getter method for a Transformer.
72      *
73      * @param name the name of the transformer
74      * @return the Transformer instance if found, otherwise null
75      */

76     UMOTransformer lookupTransformer(String JavaDoc name);
77
78     /**
79      * Registers a <code>UMOConnector</code> with the <code>MuleManager</code>.
80      *
81      * @param connector the <code>UMOConnector</code> to register
82      */

83     void registerConnector(UMOConnector connector) throws UMOException;
84
85     /**
86      * UnRegisters a <code>UMOConnector</code> with the <code>MuleManager</code>.
87      *
88      * @param connectorName the name of the <code>UMOConnector</code> to unregister
89      */

90     void unregisterConnector(String JavaDoc connectorName) throws UMOException;
91
92     /**
93      * Registers an endpointUri with a logical name
94      *
95      * @param logicalName the name of the endpointUri
96      * @param endpoint the physical endpointUri value
97      */

98     void registerEndpointIdentifier(String JavaDoc logicalName, String JavaDoc endpoint) throws InitialisationException;
99
100     /**
101      * unregisters an endpointUri with a logical name
102      *
103      * @param logicalName the name of the endpointUri
104      */

105     void unregisterEndpointIdentifier(String JavaDoc logicalName);
106
107     /**
108      * Registers a shared/global endpoint with the <code>MuleManager</code>.
109      *
110      * @param endpoint the <code>UMOEndpoint</code> to register.
111      */

112     void registerEndpoint(UMOEndpoint endpoint) throws InitialisationException;
113
114     /**
115      * unregisters a shared/global endpoint with the <code>MuleManager</code>.
116      *
117      * @param endpointName the <code>UMOEndpoint</code> name to unregister.
118      */

119     void unregisterEndpoint(String JavaDoc endpointName);
120
121     /**
122      * Registers a transformer with the <code>MuleManager</code>.
123      *
124      * @param transformer the <code>UMOTransformer</code> to register.
125      */

126     void registerTransformer(UMOTransformer transformer) throws InitialisationException;
127
128     /**
129      * UnRegisters a transformer with the <code>MuleManager</code>.
130      *
131      * @param transformerName the <code>UMOTransformer</code> name to register.
132      */

133     void unregisterTransformer(String JavaDoc transformerName);
134
135     /**
136      * Sets an Mule environment parameter in the <code>MuleManager</code>.
137      *
138      * @param key the parameter name
139      * @param value the parameter value
140      */

141     void setProperty(Object JavaDoc key, Object JavaDoc value);
142
143     /**
144      * Sets the Jta Transaction Manager to use with this Mule server instance
145      *
146      * @param manager the manager to use
147      * @throws Exception
148      */

149     void setTransactionManager(TransactionManager JavaDoc manager) throws Exception JavaDoc;
150
151     /**
152      * Returns the Jta transaction manager used by this Mule server instance. or null
153      * if a transaction manager has not been set
154      *
155      * @return the Jta transaction manager used by this Mule server instance. or null
156      * if a transaction manager has not been set
157      */

158     TransactionManager JavaDoc getTransactionManager();
159
160     /**
161      * The model used for managing components for this server
162      *
163      * @return The model used for managing components for this server
164      */

165     UMOModel getModel();
166
167     /**
168      * The model used for managing components for this server
169      *
170      * @param model The model used for managing components for this server
171      */

172     void setModel(UMOModel model) throws UMOException;
173
174     /**
175      * Gets all properties associated with the UMOManager
176      *
177      * @return a map of properties on the Manager
178      */

179     Map JavaDoc getProperties();
180
181     /**
182      * Gets an unmodifiable collection of Connectors registered with the UMOManager
183      *
184      * @return All connectors registered on the Manager
185      * @see UMOConnector
186      */

187     Map JavaDoc getConnectors();
188
189     /**
190      * Gets an unmodifiable collection of endpoints registered with the UMOManager
191      *
192      * @return All endpoints registered on the Manager
193      */

194     Map JavaDoc getEndpointIdentifiers();
195
196     /**
197      * Gets an unmodifiable collection of endpoints registered with the UMOManager
198      *
199      * @return All endpoints registered on the Manager
200      * @see org.mule.umo.endpoint.UMOEndpoint
201      */

202     Map JavaDoc getEndpoints();
203
204     /**
205      * Gets an unmodifiable collection of transformers registered with the UMOManager
206      *
207      * @return All transformers registered on the Manager
208      * @see UMOTransformer
209      */

210     Map JavaDoc getTransformers();
211
212     /**
213      * registers a interceptor stack list that can be referenced by other components
214      *
215      * @param name the referenceable name for this stack
216      * @param stack a List of interceptors
217      * @see org.mule.umo.UMOInterceptor
218      */

219     void registerInterceptorStack(String JavaDoc name, UMOInterceptorStack stack);
220
221     /**
222      * Retrieves a configured interceptor stack.
223      *
224      * @param name the name of the stack
225      * @return the interceptor stack requested or null if there wasn't one configured
226      * for the given name
227      */

228     UMOInterceptorStack lookupInterceptorStack(String JavaDoc name);
229
230     /**
231      * Determines if the server has been started
232      *
233      * @return true if the server has been started
234      */

235     boolean isStarted();
236
237     /**
238      * Determines if the server has been initialised
239      *
240      * @return true if the server has been initialised
241      */

242     boolean isInitialised();
243
244     /**
245      * Returns the long date when the server was started
246      *
247      * @return the long date when the server was started
248      */

249     long getStartDate();
250
251     /**
252      * Will register an agent object on this model. Agents can be server plugins such
253      * as Jms support
254      *
255      * @param agent
256      */

257     void registerAgent(UMOAgent agent) throws UMOException;
258
259     /**
260      * Will find a registered agent using its name, which is unique for all
261      * registered agents
262      *
263      * @param name the name of the Agent to find
264      * @return the Agent or null if there is not agent registered with the given name
265      */

266     UMOAgent lookupAgent(String JavaDoc name);
267
268     /**
269      * Removes and destroys a registered agent
270      *
271      * @param name the agent name
272      * @return the destroyed agent or null if the agent doesn't exist
273      */

274     UMOAgent unregisterAgent(String JavaDoc name) throws UMOException;
275
276     /**
277      * Registers an intenal server event listener. The listener will be notified when
278      * a particular event happens within the server. Typically this is not an event
279      * in the same sense as an UMOEvent (although there is nothing stopping the
280      * implementation of this class triggering listeners when a UMOEvent is
281      * received). The types of notifications fired is entirely defined by the
282      * implementation of this class
283      *
284      * @param l the listener to register
285      */

286     void registerListener(UMOServerNotificationListener l) throws NotificationException;
287
288     /**
289      * Registers an intenal server event listener. The listener will be notified when
290      * a particular event happens within the server. Typically this is not an event
291      * in the same sense as an UMOEvent (although there is nothing stopping the
292      * implementation of this class triggering listeners when a UMOEvent is
293      * received). The types of notifications fired is entirely defined by the
294      * implementation of this class
295      *
296      * @param l the listener to register
297      * @param resourceIdentifier a particular resource name for the given type of
298      * listener For example, the resourceName could be the name of a
299      * component if the listener was a ComponentNotificationListener
300      */

301     void registerListener(UMOServerNotificationListener l, String JavaDoc resourceIdentifier)
302         throws NotificationException;
303
304     /**
305      * Unregisters a previously registered listener. If the listener has not already
306      * been registered, this method should return without exception
307      *
308      * @param l the listener to unregister
309      */

310     void unregisterListener(UMOServerNotificationListener l);
311
312     /**
313      * Fires a server notification to all regiistered listeners
314      *
315      * @param notification the notification to fire
316      */

317     void fireNotification(UMOServerNotification notification);
318
319     /**
320      * associates a Dependency Injector container with Mule. This can be used to
321      * integrate container managed resources with Mule resources
322      *
323      * @param context a Container context to use.
324      */

325     void setContainerContext(UMOContainerContext context) throws UMOException;
326
327     /**
328      * associates a Dependency Injector container with Mule. This can be used to
329      * integrate container managed resources with Mule resources
330      *
331      * @return the container associated with the Manager
332      */

333     UMOContainerContext getContainerContext();
334
335     /**
336      * Sets the unique Id for this Manager instance. this id can be used to assign an
337      * identy to the manager so it can be identified in a network of Mule nodes
338      *
339      * @param id the unique Id for this manager in the network
340      */

341     void setId(String JavaDoc id);
342
343     /**
344      * Gets the unique Id for this Manager instance. this id can be used to assign an
345      * identy to the manager so it can be identified in a network of Mule nodes
346      *
347      * @return the unique Id for this manager in the network
348      */

349     String JavaDoc getId();
350
351     /**
352      * Sets the security manager used by this Mule instance to authenticate and
353      * authorise incoming and outgoing event traffic and service invocations
354      *
355      * @param securityManager the security manager used by this Mule instance to
356      * authenticate and authorise incoming and outgoing event traffic and
357      * service invocations
358      */

359     void setSecurityManager(UMOSecurityManager securityManager) throws InitialisationException;
360
361     /**
362      * Gets the security manager used by this Mule instance to authenticate and
363      * authorise incoming and outgoing event traffic and service invocations
364      *
365      * @return he security manager used by this Mule instance to authenticate and
366      * authorise incoming and outgoing event traffic and service invocations
367      */

368     UMOSecurityManager getSecurityManager();
369
370     /**
371      * Obtains a workManager instance that can be used to schedule work in a thread
372      * pool. This will be used primarially by UMOAgents wanting to schedule work.
373      * This work Manager must <b>never</b> be used by provider implementations as
374      * they have their own workManager accible on the connector.
375      *
376      * @return a workManager instance used by the current MuleManager
377      */

378     UMOWorkManager getWorkManager();
379
380     /**
381      * Sets a workManager instance that can be used to schedule work in a thread
382      * pool. This will be used primarially by UMOAgents wanting to schedule work.
383      * This work Manager must <b>never</b> be used by provider implementations as
384      * they have their own workManager accible on the connector.
385      *
386      * @param workManager the workManager instance used by the current MuleManager
387      */

388     void setWorkManager(UMOWorkManager workManager);
389
390     /**
391      * Sets the queue manager used by mule for queuing events. This is used by both
392      * components and vm provider.
393      *
394      * @param queueManager
395      */

396     void setQueueManager(QueueManager queueManager);
397
398     /**
399      * Gets the queue manager used by mule for queuing events. This is used by both
400      * components and vm provider.
401      *
402      * @return
403      */

404     QueueManager getQueueManager();
405 }
406
Popular Tags