org.apache.activemq.command.Response

Here are the examples of the java api class org.apache.activemq.command.Response taken from open source projects.

1. UdpTestSupport#sendResponse()

Project: activemq-artemis
File: UdpTestSupport.java
protected void sendResponse(Command command) {
    Response response = new Response();
    response.setCorrelationId(command.getCommandId());
    try {
        consumer.oneway(response);
    } catch (IOException e) {
        LOG.info("Caught: " + e);
        e.printStackTrace();
        throw new RuntimeException(e);
    }
}

2. OpenWireConnection#convertException()

Project: activemq-artemis
File: OpenWireConnection.java
private Response convertException(Exception e) {
    Response resp;
    if (e instanceof ActiveMQSecurityException) {
        resp = new ExceptionResponse(new JMSSecurityException(e.getMessage()));
    } else if (e instanceof ActiveMQNonExistentQueueException) {
        resp = new ExceptionResponse(new InvalidDestinationException(e.getMessage()));
    } else {
        resp = new ExceptionResponse(e);
    }
    return resp;
}

3. ResponseTest#populateObject()

Project: activemq-artemis
File: ResponseTest.java
@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    Response info = (Response) object;
    info.setCorrelationId(1);
}

4. ResponseTest#populateObject()

Project: activemq-artemis
File: ResponseTest.java
@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    Response info = (Response) object;
    info.setCorrelationId(1);
}

5. ResponseTest#populateObject()

Project: activemq-artemis
File: ResponseTest.java
@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    Response info = (Response) object;
    info.setCorrelationId(1);
}

6. UdpTransportUsingServerTest#testRequestResponse()

Project: activemq-artemis
File: UdpTransportUsingServerTest.java
public void testRequestResponse() throws Exception {
    ConsumerInfo expected = new ConsumerInfo();
    expected.setSelector("Edam");
    expected.setResponseRequired(true);
    LOG.info("About to send: " + expected);
    Response response = (Response) producer.request(expected, 2000);
    LOG.info("Received: " + response);
    assertNotNull("Received a response", response);
    assertTrue("Should not be an exception", !response.isException());
}

7. ResponseTest#createObject()

Project: activemq-artemis
File: ResponseTest.java
@Override
public Object createObject() throws Exception {
    Response info = new Response();
    populateObject(info);
    return info;
}

8. ResponseTest#createObject()

Project: activemq-artemis
File: ResponseTest.java
@Override
public Object createObject() throws Exception {
    Response info = new Response();
    populateObject(info);
    return info;
}

9. ResponseTest#createObject()

Project: activemq-artemis
File: ResponseTest.java
@Override
public Object createObject() throws Exception {
    Response info = new Response();
    populateObject(info);
    return info;
}

10. OpenWireConnection#sendException()

Project: activemq-artemis
File: OpenWireConnection.java
public void sendException(Exception e) {
    Response resp = convertException(e);
    try {
        dispatch(resp);
    } catch (IOException e2) {
        ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e2);
    }
}