1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.config.builders; |
12 | |
|
13 | |
import org.mule.api.MuleContext; |
14 | |
import org.mule.api.config.ConfigurationBuilder; |
15 | |
import org.mule.api.config.ConfigurationException; |
16 | |
import org.mule.config.i18n.CoreMessages; |
17 | |
|
18 | |
import org.apache.commons.logging.Log; |
19 | |
import org.apache.commons.logging.LogFactory; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | 2308 | public abstract class AbstractConfigurationBuilder implements ConfigurationBuilder |
29 | |
{ |
30 | 2 | protected static final Log logger = LogFactory.getLog(AbstractConfigurationBuilder.class); |
31 | |
|
32 | 2308 | private boolean configured = false; |
33 | |
|
34 | |
public void configure(MuleContext muleContext) throws ConfigurationException |
35 | |
{ |
36 | |
try |
37 | |
{ |
38 | 2308 | doConfigure(muleContext); |
39 | 2304 | configured = true; |
40 | |
} |
41 | 4 | catch (Exception e) |
42 | |
{ |
43 | 4 | logger.error(CoreMessages.configurationBuilderError(this), e); |
44 | 4 | throw new ConfigurationException(e); |
45 | 2304 | } |
46 | 2304 | } |
47 | |
|
48 | |
protected abstract void doConfigure(MuleContext muleContext) throws Exception; |
49 | |
|
50 | |
public boolean isConfigured() |
51 | |
{ |
52 | 0 | return configured; |
53 | |
} |
54 | |
} |