Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.client.api.messaging
Interface MessageCallback

All Known Implementing Classes:
AbstractCDIEventCallback, AbstractRPCMethodCallback, AsyncRPCEndpointCallback, CommandBindingsCallback, EndpointCallback, EntitySyncCallback, EventDispatcher, JGroupsClusteringProvider, RemoteServiceCallback, ServerMessageBusImpl.RemoteMessageCallback, ServiceCanceller, ServiceMethodCallback, ValueReplyRPCEndpointCallback, VoidRPCEndpointCallback

public interface MessageCallback

Callback interface for receiving messages on the bus. To receive messages on the message bus, create an implementation of this interface, then either annotate it with @Service or register it with the bus via a call to MessageBus.subscribe(String, MessageCallback) or MessageBus.subscribeLocal(String, MessageCallback).

The subject of messages that a particular MessageCallback is interested in is specified when it is registered with the bus, however it is common practice for a MessageCallback class to have the same name as the bus subject it receives messages for. The @Service annotation makes this approach quite natural.

See Also:
Service, MessageBus

Method Summary
 void callback(Message message)
          Called by the Message Bus every time it processes a message with the subject this callback is registered for.
 

Method Detail

callback

void callback(Message message)
Called by the Message Bus every time it processes a message with the subject this callback is registered for.

Parameters:
message - The message on the bus. Avoid making changes to this object, because it will continue to be reused by the framework and the same Message instance will be passed to other callbacks.

Errai 3.0.1-SNAPSHOT

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