public interface Client
A Client instance represents a consumer/producer of messages in bayeux. A client may subscribe to channels and publish messages to channels.
Client instances should not be directly created by uses, but should
be obtained via the Bayeux.getClient(String) or Bayeux#newClient(String, Receiver)
methods.
Two types of client may be represented by this interface:
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ClientListener listener) |
void |
deliver(Client from,
String toChannel,
Object data,
String id) |
void |
endBatch()
End a batch of messages.
|
String |
getId() |
int |
getMaxQueue() |
Queue<Message> |
getQueue()
Access the message queue.
|
boolean |
hasMessages() |
boolean |
isLocal() |
void |
removeListener(ClientListener listener) |
void |
setMaxQueue(int max) |
void |
startBatch()
Start a batch of messages.
|
List<Message> |
takeMessages()
Deprecated.
use listeners
|
String getId()
boolean hasMessages()
List<Message> takeMessages()
void addListener(ClientListener listener)
void removeListener(ClientListener listener)
boolean isLocal()
void startBatch()
void endBatch()
Queue<Message> getQueue()
void setMaxQueue(int max)
max - The size which if a client queue exceeds, forces a call to
QueueListener.queueMaxed(Client, Message) to check if the message should be
added. If set to -1, there is no queue limit. If set to zero, messages are
not queued.int getMaxQueue()
Copyright © 2012 Dojo Foundation. All Rights Reserved.