org.mule.config.builders
Class AbstractConfigurationBuilder

java.lang.Object
  extended by org.mule.config.builders.AbstractConfigurationBuilder
All Implemented Interfaces:
ConfigurationBuilder
Direct Known Subclasses:
AbstractResourceConfigurationBuilder, AnnotationsConfigurationBuilder, DefaultsConfigurationBuilder, GuiceConfigurationBuilder, SimpleConfigurationBuilder, SpringConfigurationBuilder

public abstract class AbstractConfigurationBuilder
extends Object
implements ConfigurationBuilder

A support class for ConfigurationBuilder implementations that handles the logic of creating config arrays and Properties arguments

See Also:
ConfigurationBuilder

Field Summary
protected  boolean configured
           
protected  Log logger
           
 
Constructor Summary
AbstractConfigurationBuilder()
           
 
Method Summary
protected  void applyLifecycle(LifecycleManager lifecycleManager)
          Allows a configuration builder to check and customise the lifecycle of objects in the registry being used.
 void configure(MuleContext muleContext)
          Will configure a MuleContext object based on the builders configuration settings.
protected abstract  void doConfigure(MuleContext muleContext)
          Will configure a MuleContext based on the configuration provided.
 boolean isConfigured()
          Has this builder been configured already
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final transient Log logger

configured

protected boolean configured
Constructor Detail

AbstractConfigurationBuilder

public AbstractConfigurationBuilder()
Method Detail

configure

public void configure(MuleContext muleContext)
               throws ConfigurationException
Will configure a MuleContext object based on the builders configuration settings. This method will delegate the actual processing to doConfigure(org.mule.api.MuleContext)

Specified by:
configure in interface ConfigurationBuilder
Parameters:
muleContext - The current MuleContext
Throws:
ConfigurationException - if the configuration fails i.e. an object cannot be created or initialised properly

doConfigure

protected abstract void doConfigure(MuleContext muleContext)
                             throws Exception
Will configure a MuleContext based on the configuration provided. The configuration will be set on the ConfigurationBuilder implementation as bean properties before this method has been called.

Parameters:
muleContext - The current MuleContext
Throws:
ConfigurationException - if the configuration fails i.e. an object cannot be created or initialised properly
Exception

applyLifecycle

protected void applyLifecycle(LifecycleManager lifecycleManager)
                       throws Exception
Allows a configuration builder to check and customise the lifecycle of objects in the registry being used. The ONLY time a user should implement this method is if the underlying container for the Registry is an IoC container had manages it's own lifecycle. If this is the case the lifecycle manager can be used to call the next lifecycle method on all the objects. For example for the Spring Registry only Initialise and Dispose phase is handled by Spring. The Start and Stop phases are handled by Mule by calling- // If the MuleContext is started, start all objects in the new Registry. if (lifecycleManager.isPhaseComplete(Startable.PHASE_NAME)) { lifecycleManager.applyPhase(registry.lookupObjects(Object.class), Startable.PHASE_NAME); }

Parameters:
lifecycleManager - the lifecycleManager for the current context
Throws:
Exception - if anything goes wrong. Usually this is an exeption bubbled up from calling a lifecycle method on an object in the registry

isConfigured

public boolean isConfigured()
Has this builder been configured already

Specified by:
isConfigured in interface ConfigurationBuilder
Returns:
true if the configure(org.mule.api.MuleContext) method has been called


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.