Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.client.api.base
Class ServiceCanceller

java.lang.Object
  extended by org.jboss.errai.bus.client.api.base.ServiceCanceller
All Implemented Interfaces:
MessageCallback

public class ServiceCanceller
extends Object
implements MessageCallback

Reusable bus subscriber which, upon receipt of any message, unsubscribes all subscribers (including itself) on the subject it is subscribed to. This effectively makes all listeners on the subject that ServiceCanceller is subscribed into "one shot" receivers.

Within the framework, ServiceCanceller is used for cleaning up conversational message endpoints (because they are only expected to receive a single message).


Constructor Summary
ServiceCanceller(Subscription subscription)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceCanceller

public ServiceCanceller(Subscription subscription)
Method Detail

callback

public void callback(Message message)
Description copied from interface: MessageCallback
Called by the Message Bus every time it processes a message with the subject this callback is registered for.

Specified by:
callback in interface MessageCallback
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.