org.mortbay.cometd.client
Class BayeuxClient

java.lang.Object
  extended by org.mortbay.cometd.MessagePool
      extended by org.mortbay.cometd.client.BayeuxClient
All Implemented Interfaces:
dojox.cometd.Client

public class BayeuxClient
extends MessagePool
implements dojox.cometd.Client

Bayeux protocol Client.

Implements a Bayeux Ajax Push client as part of the cometd project.

Author:
gregw
See Also:
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(dojox.cometd.Client from, dojox.cometd.Message message)
          Deprecated. use deliver(Client, String, Object, String)
 void deliver(dojox.cometd.Client from, String toChannel, Object data, String id)
           
 void endBatch()
           
 String getId()
           
 dojox.cometd.Listener getListener()
          Deprecated.  
 boolean hasMessages()
           
 boolean isLocal()
           
 boolean isPolling()
           
 void publish(String toChannel, Object data, String msgId)
           
 void remove(boolean timeout)
           
 void removeListener(EventListener listener)
           
 void setCookie(Cookie cookie)
           
 void setListener(dojox.cometd.Listener listener)
          Deprecated.  
 void start()
           
 void startBatch()
           
 void subscribe(String toChannel)
           
 List<dojox.cometd.Message> takeMessages()
           
 void unsubscribe(String toChannel)
           
 
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

BayeuxClient

public BayeuxClient(HttpClient client,
                    InetSocketAddress address,
                    String uri)
             throws IOException
Throws:
IOException
Method Detail

getId

public String getId()
Specified by:
getId in interface dojox.cometd.Client

start

public void start()

isPolling

public boolean isPolling()

deliver

public void deliver(dojox.cometd.Client from,
                    dojox.cometd.Message message)
Deprecated. use deliver(Client, String, Object, String)

(non-Javadoc)

Specified by:
deliver in interface dojox.cometd.Client
See Also:
dojox.cometd.Client#deliver(dojox.cometd.Client, java.util.Map)

deliver

public void deliver(dojox.cometd.Client from,
                    String toChannel,
                    Object data,
                    String id)
Specified by:
deliver in interface dojox.cometd.Client

getListener

public dojox.cometd.Listener getListener()
Deprecated. 

Specified by:
getListener in interface dojox.cometd.Client

hasMessages

public boolean hasMessages()
Specified by:
hasMessages in interface dojox.cometd.Client

isLocal

public boolean isLocal()
Specified by:
isLocal in interface dojox.cometd.Client

publish

public void publish(String toChannel,
                    Object data,
                    String msgId)
Specified by:
publish in interface dojox.cometd.Client

subscribe

public void subscribe(String toChannel)
Specified by:
subscribe in interface dojox.cometd.Client

unsubscribe

public void unsubscribe(String toChannel)
Specified by:
unsubscribe in interface dojox.cometd.Client

remove

public void remove(boolean timeout)

setListener

public void setListener(dojox.cometd.Listener listener)
Deprecated. 

Specified by:
setListener in interface dojox.cometd.Client

takeMessages

public List<dojox.cometd.Message> takeMessages()
Specified by:
takeMessages in interface dojox.cometd.Client

endBatch

public void endBatch()
Specified by:
endBatch in interface dojox.cometd.Client

startBatch

public void startBatch()
Specified by:
startBatch in interface dojox.cometd.Client

customize

protected void customize(HttpExchange exchange)
Customize an Exchange. Called when an exchange is about to be sent to allow Cookies and Credentials to be customized. Default implementation sets any cookies


setCookie

public void setCookie(Cookie cookie)

addListener

public void addListener(EventListener listener)
Specified by:
addListener in interface dojox.cometd.Client

removeListener

public void removeListener(EventListener listener)
Specified by:
removeListener in interface dojox.cometd.Client


Copyright © 2008 Mort Bay Consulting. All Rights Reserved.