Java 如何在Camel中的自定义组件中获取uri参数?
如果我想在ApacheCamel中拥有一个ftp自定义组件,那么如何将ftp uri参数设置为ftpConfiguration?我尝试使用Uri参数注释获取Uri参数,但失败。有人知道吗?下面是我的示例代码:Java 如何在Camel中的自定义组件中获取uri参数?,java,apache-camel,camel-ftp,Java,Apache Camel,Camel Ftp,如果我想在ApacheCamel中拥有一个ftp自定义组件,那么如何将ftp uri参数设置为ftpConfiguration?我尝试使用Uri参数注释获取Uri参数,但失败。有人知道吗?下面是我的示例代码: public class FtpConfigurationExt extends FtpConfiguration { private static final Logger LOGGER = LoggerFactory.getLogger(FtpConfigurationExt.
public class FtpConfigurationExt extends FtpConfiguration {
private static final Logger LOGGER = LoggerFactory.getLogger(FtpConfigurationExt.class);
@UriParam(name = "ftpCommands")
private String ftpCommands;
public FtpConfigurationExt() {
super();
}
public FtpConfigurationExt(URI uri) {
super(uri);
setProtocol("ftp");
}
public String getFtpCommands() {
return ftpCommands;
}
public void setFtpCommands(String ftpCommands) {
LOGGER.info(" FtpConfigurationExt ftpCommands : " + ftpCommands);
this.ftpCommands = ftpCommands;
}
}
将@UriParams添加到类中,就像FtpConfiguration那样将@UriParams添加到类中,就像FtpConfiguration一样