当前位置: 首页>>代码示例>>Java>>正文


Java GenericFile.bindToExchange方法代码示例

本文整理汇总了Java中org.apache.camel.component.file.GenericFile.bindToExchange方法的典型用法代码示例。如果您正苦于以下问题:Java GenericFile.bindToExchange方法的具体用法?Java GenericFile.bindToExchange怎么用?Java GenericFile.bindToExchange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.camel.component.file.GenericFile的用法示例。


在下文中一共展示了GenericFile.bindToExchange方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: begin

import org.apache.camel.component.file.GenericFile; //导入方法依赖的package包/类
@Override
public boolean begin(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, Exchange exchange, GenericFile<T> file) throws Exception {

    // must invoke super
    boolean result = super.begin(operations, endpoint, exchange, file);
    if (!result) {
        return false;
    }

    // okay we got the file then execute the begin renamer
    if (beginRenamer != null) {
        GenericFile<T> newName = beginRenamer.renameFile(exchange, file);
        GenericFile<T> to = renameFile(operations, file, newName);
        if (to != null) {
            to.bindToExchange(exchange);
        }
    }

    return true;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:GenericFileDeleteProcessStrategy.java

示例2: rollback

import org.apache.camel.component.file.GenericFile; //导入方法依赖的package包/类
@Override
public void rollback(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, Exchange exchange, GenericFile<T> file) throws Exception {
    try {
        deleteLocalWorkFile(exchange);
        operations.releaseRetreivedFileResources(exchange);

        // moved the failed file if specifying the moveFailed option
        if (failureRenamer != null) {
            // create a copy and bind the file to the exchange to be used by the renamer to evaluate the file name
            Exchange copy = exchange.copy();
            file.bindToExchange(copy);
            // must preserve message id
            copy.getIn().setMessageId(exchange.getIn().getMessageId());
            copy.setExchangeId(exchange.getExchangeId());

            GenericFile<T> newName = failureRenamer.renameFile(copy, file);
            renameFile(operations, file, newName);
        }
    } finally {
        // must release lock last
        if (exclusiveReadLockStrategy != null) {
            exclusiveReadLockStrategy.releaseExclusiveReadLockOnRollback(operations, file, exchange);
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:GenericFileDeleteProcessStrategy.java

示例3: begin

import org.apache.camel.component.file.GenericFile; //导入方法依赖的package包/类
@Override
public boolean begin(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, Exchange exchange, GenericFile<T> file) throws Exception {
    // must invoke super
    boolean result = super.begin(operations, endpoint, exchange, file);
    if (!result) {
        return false;
    }

    // okay we got the file then execute the begin renamer
    if (beginRenamer != null) {
        GenericFile<T> newName = beginRenamer.renameFile(exchange, file);
        GenericFile<T> to = renameFile(operations, file, newName);
        if (to != null) {
            to.bindToExchange(exchange);
        }
    }

    return true;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:GenericFileRenameProcessStrategy.java

示例4: rollback

import org.apache.camel.component.file.GenericFile; //导入方法依赖的package包/类
@Override
public void rollback(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, Exchange exchange, GenericFile<T> file) throws Exception {
    try {
        operations.releaseRetreivedFileResources(exchange);

        if (failureRenamer != null) {
            // create a copy and bind the file to the exchange to be used by the renamer to evaluate the file name
            Exchange copy = exchange.copy();
            file.bindToExchange(copy);
            // must preserve message id
            copy.getIn().setMessageId(exchange.getIn().getMessageId());
            copy.setExchangeId(exchange.getExchangeId());

            GenericFile<T> newName = failureRenamer.renameFile(copy, file);
            renameFile(operations, file, newName);
        }
    } finally {
        if (exclusiveReadLockStrategy != null) {
            exclusiveReadLockStrategy.releaseExclusiveReadLockOnRollback(operations, file, exchange);
        }
        deleteLocalWorkFile(exchange);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:24,代码来源:GenericFileRenameProcessStrategy.java

示例5: commit

import org.apache.camel.component.file.GenericFile; //导入方法依赖的package包/类
@Override
public void commit(GenericFileOperations<T> operations, GenericFileEndpoint<T> endpoint, Exchange exchange, GenericFile<T> file) throws Exception {
    try {
        if (commitRenamer != null) {
            // create a copy and bind the file to the exchange to be used by the renamer to evaluate the file name
            Exchange copy = exchange.copy();
            file.bindToExchange(copy);
            // must preserve message id
            copy.getIn().setMessageId(exchange.getIn().getMessageId());
            copy.setExchangeId(exchange.getExchangeId());

            GenericFile<T> newName = commitRenamer.renameFile(copy, file);
            renameFile(operations, file, newName);
        }
    } finally {
        // must invoke super
        super.commit(operations, endpoint, exchange, file);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:GenericFileRenameProcessStrategy.java

示例6: createExchange

import org.apache.camel.component.file.GenericFile; //导入方法依赖的package包/类
@Override
public Exchange createExchange(GenericFile<T> file) {
    Exchange answer = super.createExchange();
    if (file != null) {
        file.bindToExchange(answer);
    }
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:RemoteFileEndpoint.java


注:本文中的org.apache.camel.component.file.GenericFile.bindToExchange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。