Added additional libs property

master
Vishnu Piskala 2013-09-10 18:47:38 +05:30
parent ab8d285968
commit 716363aec4
4 changed files with 512 additions and 511 deletions

View File

@ -31,9 +31,9 @@ public interface CamelSEConfigMBean {
public String getIncludeCamelLibs();
public void setExcludeCamelLibs(String excludeLibs);
public void setAdditionalLibs(String additionalLibs);
public String getExcludeCamelLibs();
public String getAdditionalLibs();
public static class CamelSEConfigMBeanImpl implements CamelSEConfigMBean {
@ -42,7 +42,7 @@ public interface CamelSEConfigMBean {
//private static final String PROP_CAMEL_HOME = "camel.home";
private static final String PROP_CAMEL_HOME = "CamelHome";
//private static final String PROP_EXCLUDE_CAMEL_LIBS = "exclude.camel.libs";
private static final String PROP_EXCLUDE_CAMEL_LIBS = "ExcludeCamelLibs";
private static final String PROP_ADDITIONAL_LIBS = "AdditionalLibs";
//private static final String PROP_INCLUDE_CAMEL_LIBS = "include.camel.libs";
private static final String PROP_INCLUDE_CAMEL_LIBS = "IncludeCamelLibs";
@ -79,7 +79,7 @@ public interface CamelSEConfigMBean {
public void setInitialConfigurations(ComponentConfig props) {
setCamelHome(props.getProperty(PROP_CAMEL_HOME).getValue());
setIncludeCamelLibs(props.getProperty(PROP_INCLUDE_CAMEL_LIBS).getValue());
setExcludeCamelLibs(props.getProperty(PROP_EXCLUDE_CAMEL_LIBS).getValue());
setAdditionalLibs(props.getProperty(PROP_ADDITIONAL_LIBS).getValue());
}
private File createConfigFile(String configRootPath) {
@ -193,13 +193,13 @@ public interface CamelSEConfigMBean {
return this.mConfigProps.getProperty(PROP_INCLUDE_CAMEL_LIBS, "");
}
public void setExcludeCamelLibs(String excludeLibs) {
this.mConfigProps.setProperty(PROP_EXCLUDE_CAMEL_LIBS, excludeLibs);
public void setAdditionalLibs(String excludeLibs) {
this.mConfigProps.setProperty(PROP_ADDITIONAL_LIBS, excludeLibs);
this.saveProperties(mConfigFile, mConfigProps);
}
public String getExcludeCamelLibs() {
return this.mConfigProps.getProperty(PROP_EXCLUDE_CAMEL_LIBS, "");
public String getAdditionalLibs() {
return this.mConfigProps.getProperty(PROP_ADDITIONAL_LIBS, "");
}
}

View File

@ -48,6 +48,7 @@ import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.jbi.management.DeploymentException;
@ -132,7 +133,7 @@ public class CamelSEServiceUnit extends ServiceUnit {
}
String camelHome = configMBean.getCamelHome();
String includes = configMBean.getIncludeCamelLibs();
String excludes = configMBean.getExcludeCamelLibs();
String additional = configMBean.getAdditionalLibs();
if ( camelHome == null || camelHome.trim().length() == 0 ) {
return cp;
@ -144,8 +145,8 @@ public class CamelSEServiceUnit extends ServiceUnit {
return cp;
}
List<String> includePaths = getPaths(camelHome, includes);
List<String> excludePaths = getPaths(camelHome, excludes);
includePaths.removeAll(excludePaths);
String[] additionalPaths = additional.split(",");
includePaths.addAll(Arrays.asList(additionalPaths));
for ( String path : includePaths ) {
try {
URL pathURL = (new File(path)).toURL();

View File

@ -66,7 +66,7 @@
<config:Configuration>
<config:Property defaultValue="" displayDescription="Apache Camel Installation Directory" displayName="Apache Camel Home" isApplicationRestartRequired="true" isComponentRestartRequired="false" name="CamelHome" showDisplay="all" type="xsd:string"/>
<config:Property defaultValue="" displayDescription="comma(,) separated names of Apache Camel Libraries to include in the Camel application classpath" displayName="Included Camel Libraries" isApplicationRestartRequired="true" isComponentRestartRequired="false" name="IncludeCamelLibs" showDisplay="all" type="xsd:string"/>
<config:Property defaultValue="" displayDescription="comma(,) separated names of Apache Camel Libraries to exclude from the Camel application classpath" displayName="Excluded Camel Libraries" isApplicationRestartRequired="true" isComponentRestartRequired="false" name="ExcludeCamelLibs" showDisplay="all" type="xsd:string"/>
<config:Property defaultValue="" displayDescription="comma(,) separated full path of the jar files to include in the Camel application classpath" displayName="Additional Libraries" isApplicationRestartRequired="true" isComponentRestartRequired="false" name="AdditionalLibs" showDisplay="all" type="xsd:string"/>
</config:Configuration>
</component>
</jbi>