66 lines
3.7 KiB
Java
66 lines
3.7 KiB
Java
package com.inteligr8.activiti.mq;
|
|
|
|
import java.io.IOException;
|
|
import java.util.concurrent.TimeoutException;
|
|
|
|
import javax.jms.JMSException;
|
|
|
|
import com.inteligr8.activiti.mq.model.DeliveredMessage;
|
|
import com.inteligr8.activiti.mq.model.PreparedMessage;
|
|
|
|
public interface MqCommunicator {
|
|
|
|
boolean validateConnection();
|
|
|
|
<BodyType> PreparedMessage<BodyType> createPreparedMessage();
|
|
|
|
<BodyType> DeliveredMessage<BodyType> send(GenericDestination destination, PreparedMessage<BodyType> message) throws JMSException, IOException, TimeoutException;
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, -1L, null, null, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, MqSubscriptionListener listener) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, -1L, null, listener, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, long timeoutInMillis) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, timeoutInMillis, null, null, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, long timeoutInMillis, MqSubscriptionListener listener) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, timeoutInMillis, null, listener, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, String correlationId) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, -1L, correlationId, null, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, String correlationId, MqSubscriptionListener listener) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, -1L, correlationId, listener, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, long timeoutInMillis, String correlationId) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, timeoutInMillis, correlationId, null, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, long timeoutInMillis, String correlationId, MqSubscriptionListener listener) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, timeoutInMillis, correlationId, listener, null);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, MqSubscriptionListener listener, TransactionalMessageHandler<BodyType> handler) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, -1L, null, listener, handler);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, long timeoutInMillis, MqSubscriptionListener listener, TransactionalMessageHandler<BodyType> handler) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, timeoutInMillis, null, listener, handler);
|
|
}
|
|
|
|
default <BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, String correlationId, MqSubscriptionListener listener, TransactionalMessageHandler<BodyType> handler) throws JMSException, IOException, TimeoutException {
|
|
return this.receive(destination, -1L, correlationId, listener, handler);
|
|
}
|
|
|
|
<BodyType> DeliveredMessage<BodyType> receive(GenericDestination destination, long timeoutInMillis, String correlationId, MqSubscriptionListener listener, TransactionalMessageHandler<BodyType> handler) throws JMSException, IOException, TimeoutException;
|
|
|
|
}
|