org.projectodd.stilts.stomplet.simple
Class SimpleSubscribableStomplet
java.lang.Object
org.projectodd.stilts.stomplet.helpers.AbstractStomplet
org.projectodd.stilts.stomplet.simple.SimpleSubscribableStomplet
- All Implemented Interfaces:
- MessageSink, Stomplet
- Direct Known Subclasses:
- SimpleQueueStomplet, SimpleTopicStomplet
public abstract class SimpleSubscribableStomplet
- extends AbstractStomplet
- implements MessageSink
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleSubscribableStomplet
public SimpleSubscribableStomplet()
send
public void send(StompMessage message)
throws StompException
- Specified by:
send
in interface MessageSink
- Throws:
StompException
onSubscribe
public void onSubscribe(Subscriber subscriber)
throws StompException
- Description copied from interface:
Stomplet
- Handle a subscription request.
For subscription requests matching destinations mapped to this
stomplet, the Stomplet.onSubscribe(Subscriber)
method will be invoked
with a Subscriber
object. If the stomplet chooses to
allow the subscription, it may route further messages to the
Subscriber
to satisfy the subscription.
If it chooses to deny the subscription request (for any reason),
throwing a StompException
is appropriate.
- Specified by:
onSubscribe
in interface Stomplet
- Parameters:
subscriber
- The live subscriber making the request.
- Throws:
StompException
- If an error occurs processing the subscription request.
onUnsubscribe
public void onUnsubscribe(Subscriber subscriber)
throws StompException
- Description copied from interface:
Stomplet
- Handle the cancellation of a subscription.
When a client explicitly cancels a subscription, or disconnects,
the stomplet is notified through Stomplet.onUnsubscribe(Subscriber)
,
having the same Subscriber
instance passed to it.
- Specified by:
onUnsubscribe
in interface Stomplet
- Parameters:
subscriber
- The subscriber cancelling the subscription.
- Throws:
StompException
- If an error occurs processing the subscription cancellation request.
sendToAllSubscribers
protected void sendToAllSubscribers(StompMessage message)
throws StompException
- Throws:
StompException
sendToOneSubscriber
protected void sendToOneSubscriber(StompMessage message)
throws StompException
- Throws:
StompException
Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.