Search in sources :

Example 1 with DefaultDeliverMessageJob

use of net.dempsy.container.DefaultDeliverMessageJob in project Dempsy by Dempsy.

the class NodeReceiver method propogateMessageToNode.

/**
 * This passes the message directly to the current node container(s) listed in the message.
 *
 * If the message is a resource (and therefore disposition isn't null) there's an assumption that
 * the message is "opened" and responsibility for the closing of it is being passed along to propogateMessageToNode
 */
public void propogateMessageToNode(final RoutedMessage message, final boolean justArrived, final MessageResourceManager disposition) {
    if (disposition == null) {
        final MessageDeliveryJob rejectable = new DefaultDeliverMessageJob(containers, statsCollector, message, justArrived);
        if (justArrived)
            threadModel.submitLimited(rejectable);
        else
            threadModel.submit(rejectable);
    } else {
        final MessageDeliveryJob rejectable = new DeliverResourceJob(containers, statsCollector, message, justArrived, disposition);
        if (justArrived)
            threadModel.submitLimited(rejectable);
        else {
            if (message.message.getClass().getSimpleName().equals("ThermalSamplingIntervalByCamera")) {
                int i = 0;
                i += 13;
                dump(i);
            }
            threadModel.submit(rejectable);
        }
    }
}
Also used : DefaultDeliverMessageJob(net.dempsy.container.DefaultDeliverMessageJob) DeliverResourceJob(net.dempsy.container.DeliverResourceJob) MessageDeliveryJob(net.dempsy.container.MessageDeliveryJob)

Aggregations

DefaultDeliverMessageJob (net.dempsy.container.DefaultDeliverMessageJob)1 DeliverResourceJob (net.dempsy.container.DeliverResourceJob)1 MessageDeliveryJob (net.dempsy.container.MessageDeliveryJob)1