public interface Client
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, Listener)
methods.
Three types of client may be represented by this interface:Bayeux.newClient(String, Listener)
method
Modifier and Type | Method and Description |
---|---|
void |
deliver(Message message)
Deliver a message to this client only
Deliver a message directly to the client.
|
void |
deliver(Message[] message)
Deliver a batch of messages to this client only
Deliver a batch messages directly to the client.
|
void |
endBatch()
Ends a batch.
|
String |
getId()
Returns a unique id for this client.
|
boolean |
hasMessages()
Returns true if this client is holding messages to be delivered to the remote client.
|
boolean |
isLocal() |
void |
startBatch()
Starts a batch, no messages will be delivered until endBatch is called.
|
String getId()
boolean hasMessages()
void deliver(Message message)
message
- void deliver(Message[] message)
message
- boolean isLocal()
void startBatch()
void endBatch()
Copyright © 2013 JBoss by Red Hat. All rights reserved.