Example usage for javax.resource ResourceException getMessage

List of usage examples for javax.resource ResourceException getMessage

Introduction

In this page you can find the example usage for javax.resource ResourceException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns a detailed message string describing this exception.

Usage

From source file:org.ikasan.connector.basefiletransfer.outbound.command.RetrieveFileCommand.java

/**
 * (non-Javadoc)//from ww  w  .  j a va 2s  . c o m
 * @see org.ikasan.connector.base.command.AbstractTransactionalResourceCommand#doCommit()
 */
@Override
protected void doCommit() throws ResourceException {
    try {
        logger.info("commit called on this command:" + this + "]"); //$NON-NLS-1$ //$NON-NLS-2$);
        logger.info("isMoveOnSuccess [" + moveOnSuccess + "]"); //$NON-NLS-1$ //$NON-NLS-2$);
        logger.debug("isRenameOnSuccess [" + renameOnSuccess + "]"); //$NON-NLS-1$ //$NON-NLS-2$);
        logger.debug("isDestructive [" + destructive + "]"); //$NON-NLS-1$ //$NON-NLS-2$);

        if (renameOnSuccess) {
            renameFile(sourcePath, sourcePath + renameExtension);
        } else if (moveOnSuccess) {
            logger.info("moving file.."); //$NON-NLS-1$
            renameFile(sourcePath, moveOnSuccessNewPath);
        }
        // TODO Delete the checksum
        else if (destructive) {
            // trying to delete the file
            deleteFile(sourcePath);
        }
    } catch (ResourceException exception) {
        logger.info("Caught ResourceException", exception);
        TransactionCommitException transactionCommitException = new TransactionCommitException(
                exception.getMessage(), exception);
        super.notifyListeners(transactionCommitException);

        throw exception;
    }
}