Search in sources :

Example 6 with MessageAdminResponse

use of org.jaffa.qm.apis.data.MessageAdminResponse in project jaffa-framework by jaffa-projects.

the class QueueManager method deleteMessage.

public MessageAdminResponse[] deleteMessage(MessageGraph[] graphs) {
    // TODO-SWAT fire custom handler here
    try {
        if (log.isDebugEnabled())
            log.debug("Input to deleteMessage: " + graphs);
        MessageAdminResponse[] aggregateResponse = null;
        IQueueAdmin[] implementations = findImplementations();
        if (implementations != null && implementations.length > 0) {
            for (IQueueAdmin implementation : implementations) {
                MessageAdminResponse[] response = implementation.deleteMessage(graphs);
                if (response != null && response.length > 0)
                    aggregateResponse = concatenate(aggregateResponse, response);
            }
        }
        if (log.isDebugEnabled())
            log.debug("Response from deleteMessage: " + aggregateResponse);
        return aggregateResponse;
    } catch (Exception e) {
        log.error("Error in obtaining IQueueAdmin implementations", e);
        return new MessageAdminResponse[] { new MessageAdminResponse(null, ServiceError.generate(e)) };
    }
}
Also used : MessageAdminResponse(org.jaffa.qm.apis.data.MessageAdminResponse)

Aggregations

MessageAdminResponse (org.jaffa.qm.apis.data.MessageAdminResponse)6 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)4 MessageGraph (org.jaffa.qm.apis.data.MessageGraph)4 IntrospectionException (java.beans.IntrospectionException)2 LinkedList (java.util.LinkedList)2 JMSException (javax.jms.JMSException)2 ApplicationException (org.jaffa.exceptions.ApplicationException)2 FrameworkException (org.jaffa.exceptions.FrameworkException)2 JaffaMessagingFrameworkException (org.jaffa.modules.messaging.services.JaffaMessagingFrameworkException)2 UOW (org.jaffa.persistence.UOW)2 IllegalPersistentStateRuntimeException (org.jaffa.persistence.exceptions.IllegalPersistentStateRuntimeException)2 PostLoadFailedException (org.jaffa.persistence.exceptions.PostLoadFailedException)2 QueryFailedException (org.jaffa.persistence.exceptions.QueryFailedException)2 Transaction (org.jaffa.transaction.domain.Transaction)2