Search in sources :

Example 1 with QueueViewerComponent

use of org.jaffa.modules.messaging.components.queueviewer.ui.QueueViewerComponent in project jaffa-framework by jaffa-projects.

the class QueueListComponent method viewMessages.

public FormKey viewMessages(String queue, MessageModeEnum messageMode) throws ApplicationExceptions, FrameworkException {
    QueueViewerComponent viewComponent = (QueueViewerComponent) run("Jaffa.Messaging.QueueViewer");
    viewComponent.setReturnToFormKey(getResultsFormKey());
    viewComponent.setQueue(queue);
    viewComponent.setMessageMode(messageMode);
    viewComponent.addQueueViewerListener(new IQueueViewerListener() {

        public void processDone(EventObject source) throws ApplicationExceptions, FrameworkException {
            displayResults();
        }
    });
    return viewComponent.display();
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) IQueueViewerListener(org.jaffa.modules.messaging.components.queueviewer.ui.IQueueViewerListener) FrameworkException(org.jaffa.exceptions.FrameworkException) QueueViewerComponent(org.jaffa.modules.messaging.components.queueviewer.ui.QueueViewerComponent) EventObject(java.util.EventObject)

Example 2 with QueueViewerComponent

use of org.jaffa.modules.messaging.components.queueviewer.ui.QueueViewerComponent in project jaffa-framework by jaffa-projects.

the class TaskFinderComponent method viewFailedTasks.

/**
 * Calls the Jaffa.Messaging.QueueViewer component for viewing the failed tasks.
 * @throws ApplicationExceptions This will be thrown in case any invalid data has been set.
 * @throws FrameworkException Indicates some system error.
 * @return The FormKey for the QueueViewer screen.
 */
public FormKey viewFailedTasks(String scheduledTaskId, Object businessObject) throws ApplicationExceptions, FrameworkException {
    // Create a filter with the input scheduledTaskId
    String filter = new StringBuilder(JmsBrowser.HEADER_SCHEDULED_TASK_ID).append('=').append('\'').append(scheduledTaskId).append('\'').toString();
    // Figure out the appropriate queueName based on the businessObject, so that the QueueViewer displays the relevant columns
    String queueName = null;
    if (businessObject != null) {
        try {
            MessageInfo messageInfo = ConfigurationService.getInstance().getMessageInfo(businessObject.getClass().getName());
            if (messageInfo != null)
                queueName = messageInfo.getQueueName();
        } catch (ClassNotFoundException e) {
        // do nothing
        }
    }
    // Instantiate the QueueViewer
    QueueViewerComponent viewComponent = (QueueViewerComponent) run("Jaffa.Messaging.QueueViewer");
    viewComponent.setFilter(filter);
    if (queueName != null) {
        viewComponent.setQueue(queueName);
        viewComponent.setMessageMode(MessageModeEnum.ERROR);
    }
    viewComponent.setReturnToFormKey(FormKey.getCloseBrowserFormKey());
    return viewComponent.display();
}
Also used : QueueViewerComponent(org.jaffa.modules.messaging.components.queueviewer.ui.QueueViewerComponent) MessageInfo(org.jaffa.modules.messaging.services.configdomain.MessageInfo)

Aggregations

QueueViewerComponent (org.jaffa.modules.messaging.components.queueviewer.ui.QueueViewerComponent)2 EventObject (java.util.EventObject)1 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)1 FrameworkException (org.jaffa.exceptions.FrameworkException)1 IQueueViewerListener (org.jaffa.modules.messaging.components.queueviewer.ui.IQueueViewerListener)1 MessageInfo (org.jaffa.modules.messaging.services.configdomain.MessageInfo)1