View Javadoc

1   /*
2    * $Id: ConfigurationBuilder.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.api.config;
12  
13  import org.mule.api.MuleContext;
14  
15  /**
16   * A <code>ConfigurationBuilder</code> is used to configure a Mule instance,
17   * represented by a MuleContext instance. Multiple ConfigurationBuilder's can be used
18   * to configure a single mule instance with each ConfigurationBuilder doing one of
19   * more of the following:
20   * <li> Creation of mule runtime artifacts (endpoint's, connector's, service's,
21   * transformer's) which are then registered with the <code>Registy</code 
22   * <li> Creation and registration of SecurityManager / TransactionManager / TransactionManagerFactory / QueueManager
23   * and ThreadingProfile's.  Unlike the runtime artifacts mule only uses a single instance of each of these and so if 
24   * multiple configuration builder create and register these artifacts only one will be used.
25   * <li> Configuration of existing Mule configuration related artifacts such as <code>MuleConfiguration</code> and 
26   * <code>ServerNotificationManager</code>
27   * <br/><br/>
28   * Which of the above takes place, depends on what the configuration source contains and the ConfgurationBuilder implementation is used.
29   */
30  public interface ConfigurationBuilder
31  {
32  
33      /**
34       * Will configure a MuleContext based on the configuration provided.  The configuration will be set on the
35       * {@link org.mule.api.config.ConfigurationBuilder} implementation as bean properties before this method
36       * has been called.
37       * 
38       * @param muleContext The current {@link org.mule.api.MuleContext}
39       * @throws ConfigurationException if the configuration fails i.e. an object cannot be created or
40       * initialised properly
41       */
42      void configure(MuleContext muleContext) throws ConfigurationException;
43  
44      /**
45       * Indicate whether this ConfigurationBulder has been configured yet
46       * 
47       * @return <code>true</code> if this ConfigurationBulder has been configured.
48       */
49      boolean isConfigured();
50  }