private void doProcess(IntegrationResourceHolder holder, Expression expression, MessageChannel messageChannel, String expressionType) { Message<?> message = holder.getMessage(); if (message != null) { if (expression != null) {
private Message<?> pollForMessage() { try { return this.pollingTask.call(); } catch (Exception e) { if (e instanceof MessagingException) { throw (MessagingException) e; } else { Message<?> failedMessage = null; if (this.transactionSynchronizationFactory != null) { Object resource = TransactionSynchronizationManager.getResource(getResourceToBind()); if (resource instanceof IntegrationResourceHolder) { failedMessage = ((IntegrationResourceHolder) resource).getMessage(); } } throw new MessagingException(failedMessage, e); // NOSONAR (null failedMessage) } } finally { if (this.transactionSynchronizationFactory != null) { Object resource = getResourceToBind(); if (TransactionSynchronizationManager.hasResource(resource)) { TransactionSynchronizationManager.unbindResource(resource); } } } }
@Override public void processAfterCommit(IntegrationResourceHolder holder) { String remoteDir = (String) holder.getMessage().getHeaders().get(FileHeaders.REMOTE_DIRECTORY); String remoteFile = (String) holder.getMessage().getHeaders().get(FileHeaders.REMOTE_FILE); this.template.remove(remoteDir + this.remoteFileSeparator + remoteFile); }
private void doProcess(IntegrationResourceHolder holder, Expression expression, MessageChannel messageChannel, String expressionType) { Message<?> message = holder.getMessage(); if (message != null) { if (expression != null) {
private Message<?> pollForMessage() { try { return this.pollingTask.call(); } catch (Exception e) { if (e instanceof MessagingException) { throw (MessagingException) e; } else { Message<?> failedMessage = null; if (this.transactionSynchronizationFactory != null) { Object resource = TransactionSynchronizationManager.getResource(getResourceToBind()); if (resource instanceof IntegrationResourceHolder) { failedMessage = ((IntegrationResourceHolder) resource).getMessage(); } } throw new MessagingException(failedMessage, e); // NOSONAR (null failedMessage) } } finally { if (this.transactionSynchronizationFactory != null) { Object resource = getResourceToBind(); if (TransactionSynchronizationManager.hasResource(resource)) { TransactionSynchronizationManager.unbindResource(resource); } } } }