1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.module.ibeans.config; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.MuleRuntimeException; |
11 | |
import org.mule.api.config.ConfigurationException; |
12 | |
import org.mule.api.context.MuleContextAware; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | 0 | public class IBeansLoader implements MuleContextAware |
18 | |
{ |
19 | |
public static final String SCAN_PACKAGES_PROPERTY = "org.mule.scan"; |
20 | |
|
21 | |
|
22 | |
|
23 | |
private static final String DEFAULT_BASEPATH = "org.mule, "; |
24 | |
|
25 | |
public void setMuleContext(MuleContext context) |
26 | |
{ |
27 | |
|
28 | 0 | String scanPackages = System.getProperty(SCAN_PACKAGES_PROPERTY, DEFAULT_BASEPATH); |
29 | 0 | String[] paths = scanPackages.split(","); |
30 | 0 | IBeanHolderConfigurationBuilder builder = new IBeanHolderConfigurationBuilder(paths); |
31 | |
try |
32 | |
{ |
33 | 0 | builder.configure(context); |
34 | |
} |
35 | 0 | catch (ConfigurationException e) |
36 | |
{ |
37 | 0 | throw new MuleRuntimeException(e); |
38 | 0 | } |
39 | 0 | } |
40 | |
} |