Search in sources :

Example 1 with TcpConnectionFailedCorrelationEvent

use of org.springframework.integration.ip.tcp.connection.TcpConnectionFailedCorrelationEvent in project spring-integration by spring-projects.

the class TcpSendingMessageHandler method publishNoConnectionEvent.

private void publishNoConnectionEvent(MessageHandlingException messageHandlingException, String connectionId) {
    AbstractConnectionFactory cf = this.serverConnectionFactory != null ? this.serverConnectionFactory : this.clientConnectionFactory;
    ApplicationEventPublisher applicationEventPublisher = cf.getApplicationEventPublisher();
    if (applicationEventPublisher != null) {
        applicationEventPublisher.publishEvent(new TcpConnectionFailedCorrelationEvent(this, connectionId, messageHandlingException));
    }
}
Also used : TcpConnectionFailedCorrelationEvent(org.springframework.integration.ip.tcp.connection.TcpConnectionFailedCorrelationEvent) AbstractConnectionFactory(org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)

Example 2 with TcpConnectionFailedCorrelationEvent

use of org.springframework.integration.ip.tcp.connection.TcpConnectionFailedCorrelationEvent in project spring-integration by spring-projects.

the class TcpInboundGateway method publishNoConnectionEvent.

private void publishNoConnectionEvent(Message<?> message, String connectionId) {
    AbstractConnectionFactory cf = this.serverConnectionFactory != null ? this.serverConnectionFactory : this.clientConnectionFactory;
    ApplicationEventPublisher applicationEventPublisher = cf.getApplicationEventPublisher();
    if (applicationEventPublisher != null) {
        applicationEventPublisher.publishEvent(new TcpConnectionFailedCorrelationEvent(this, connectionId, new MessagingException(message, "Connection not found to process reply.")));
    }
}
Also used : TcpConnectionFailedCorrelationEvent(org.springframework.integration.ip.tcp.connection.TcpConnectionFailedCorrelationEvent) AbstractConnectionFactory(org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory) MessagingException(org.springframework.messaging.MessagingException) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)

Aggregations

ApplicationEventPublisher (org.springframework.context.ApplicationEventPublisher)2 AbstractConnectionFactory (org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory)2 TcpConnectionFailedCorrelationEvent (org.springframework.integration.ip.tcp.connection.TcpConnectionFailedCorrelationEvent)2 MessagingException (org.springframework.messaging.MessagingException)1