Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server
Class AsyncDispatcher

java.lang.Object
  extended by org.jboss.errai.bus.server.AsyncDispatcher
All Implemented Interfaces:
RequestDispatcher

public class AsyncDispatcher
extends Object
implements RequestDispatcher

The AsyncDispatcher provides asynchronous message delivery into the bus. This means that incoming remote requests do not block, and processing of the request continues even after the incoming network conversation has ended.

This dispatcher implementation can be used with the DefaultBlockingServlet as this pertains to incoming--as opposed to outgoing--message handling. Note: some appservers or servlet environments may restrict thread creation within the container, in which case this implementation cannot be used.

Author:
Mike Brock

Constructor Summary
AsyncDispatcher(ErraiService service)
          Constructs the AsyncDispatcher with the specified service.
 
Method Summary
 void dispatch(Message message)
          Dispatches a message to a single receiver on the bus
 void dispatchGlobal(Message message)
          Sends the message globally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncDispatcher

@Inject
public AsyncDispatcher(ErraiService service)
Constructs the AsyncDispatcher with the specified service. The injection makes it possible to obtain a reference to the ErraiService

Parameters:
service - the service where the bus is located
Method Detail

dispatchGlobal

public void dispatchGlobal(Message message)
                    throws InterruptedException
Sends the message globally. If the PriorityProcessing routing flag is set, then the message is sent globally on the bus. If not, the message is sent globally through the workerFactory

Specified by:
dispatchGlobal in interface RequestDispatcher
Parameters:
message - a message to dispatch globally
Throws:
InterruptedException

dispatch

public void dispatch(Message message)
              throws InterruptedException
Description copied from interface: RequestDispatcher
Dispatches a message to a single receiver on the bus

Specified by:
dispatch in interface RequestDispatcher
Parameters:
message - a message to dispatch
Throws:
InterruptedException

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.