|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.cometd.MessagePool
org.mortbay.cometd.client.BayeuxClient
public class BayeuxClient
Bayeux protocol Client.
Implements a Bayeux Ajax Push client as part of the cometd project.
http://cometd.com
Constructor Summary | |
---|---|
BayeuxClient(HttpClient client,
InetSocketAddress address,
String uri)
|
Method Summary | |
---|---|
void |
addListener(EventListener listener)
|
protected void |
customize(HttpExchange exchange)
Customize an Exchange. |
void |
deliver(Client from,
Message message)
Deprecated. use deliver(Client, String, Object, String) |
void |
deliver(Client from,
String toChannel,
Object data,
String id)
|
void |
endBatch()
End a batch of messages. |
String |
getId()
|
Listener |
getListener()
Deprecated. |
boolean |
hasMessages()
|
boolean |
isLocal()
|
boolean |
isPolling()
|
void |
publish(String toChannel,
Object data,
String msgId)
Publish data from this client. |
void |
remove(boolean timeout)
|
void |
removeListener(EventListener listener)
|
void |
setCookie(Cookie cookie)
|
void |
setListener(Listener listener)
Deprecated. |
void |
start()
|
void |
startBatch()
Start a batch of messages. |
void |
subscribe(String toChannel)
Subscribe this client to a channel. |
List<Message> |
takeMessages()
Take any messages queued for a client. |
void |
unsubscribe(String toChannel)
Unsubscribe this client from a channel. |
Methods inherited from class org.mortbay.cometd.MessagePool |
---|
getBatchJSON, getJSON, getMsgJSON, newMessage, newMessage, parse, parse, parseTo, recycleMessage, setBatchJSON, setJSON, setMsgJSON |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BayeuxClient(HttpClient client, InetSocketAddress address, String uri) throws IOException
IOException
Method Detail |
---|
public String getId()
getId
in interface Client
public void start()
public boolean isPolling()
public void deliver(Client from, Message message)
deliver(Client, String, Object, String)
deliver
in interface Client
from
- The Client that published the message, or null if not known/availabledojox.cometd.Client#deliver(dojox.cometd.Client, java.util.Map)
public void deliver(Client from, String toChannel, Object data, String id)
deliver
in interface Client
public Listener getListener()
getListener
in interface Client
public boolean hasMessages()
hasMessages
in interface Client
public boolean isLocal()
isLocal
in interface Client
public void publish(String toChannel, Object data, String msgId)
Client
Bayeux.publish(Client, String, Object, String)
with this client passed
as the fromClient.
publish
in interface Client
toChannel
- The Channel ID to which the data is targetteddata
- The data itself which must be an Object that can be encoded with JSON
.msgId
- optional message ID or null for automatic generation of a message ID.public void subscribe(String toChannel)
Client
Bayeux.subscribe(String, Client)
with this client passed.
Equivalent to getChannel(toChannel).subscribe(subscriber).
subscribe
in interface Client
public void unsubscribe(String toChannel)
Client
Bayeux.unsubscribe(String, Client)
with this client passed.
unsubscribe
in interface Client
public void remove(boolean timeout)
public void setListener(Listener listener)
setListener
in interface Client
public List<Message> takeMessages()
Client
takeMessages
in interface Client
public void endBatch()
Client
endBatch
in interface Client
public void startBatch()
Client
startBatch
in interface Client
protected void customize(HttpExchange exchange)
public void setCookie(Cookie cookie)
public void addListener(EventListener listener)
addListener
in interface Client
public void removeListener(EventListener listener)
removeListener
in interface Client
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |