如何在Camel中的自定义组件中获取uri参数?

时间:2015-11-20 10:16:53

标签: java apache-camel camel-ftp

如果我想在apache-camel中使用ftp自定义组件,如何将ftp uri参数设置为ftpConfiguration?我尝试使用Uri param注释来获取uri参数但失败了。有没有人有想法?以下是我的示例代码:

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;
    }
}

0 个答案:

没有答案