Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: count(): Parameter must be an array or an object that implements Countable in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/JavaScriptSymbol.php on line 69

dojox/cometd/_base.js

  • Provides:

    • dojox.cometd._base
  • Requires:

    • dojo.AdapterRegistry in common
  • dojox.cometd

    • type
      Object
  • dojox.cometd.Connection

    • parameters:
      • prefix
    • returns
      dojo.Deferred
    • type
      Function
  • dojox.cometd.Connection.state

    • type
      Function
  • dojox.cometd.Connection.init

    • parameters:
      • root: (typeof String)
        The URL of the cometd server. If the root is absolute, the host
        is examined to determine if xd transport is needed. Otherwise the
        same domain is assumed.
      • props: (typeof Object)
        An optional object that is used as the basis of the handshake message
      • bargs: (typeof Object)
        An optional object of bind args mixed in with the send of the handshake
    • summary
      Initialize the cometd implementation of the Bayeux protocol
    • description
      Initialize the cometd implementation of the Bayeux protocol by
      sending a handshake message. The cometd state will be changed to CONNECTING
      until a handshake response is received and the first successful connect message
      has returned.
      The protocol state changes may be monitored
      by subscribing to the dojo topic "/prefix/meta" (typically "/cometd/meta") where
      events are published in the form
      {cometd:this,action:"handshake",successful:true,state:this.state()}
    • example
      	dojox.cometd.init("/cometd");
      	dojox.cometd.init("http://xdHost/cometd",{ext:{user:"fred",pwd:"secret"}});
    • type
      Function
  • dojox.cometd.Connection.url

    • type
      Object
  • dojox.cometd.Connection._isXD

    • type
      bool
  • dojox.cometd.Connection._props

  • dojox.cometd.Connection._messageQ

    • type
      Array
  • dojox.cometd.Connection._subscriptions

    • type
      Array
  • dojox.cometd.Connection._initialized

    • type
      bool
  • dojox.cometd.Connection._status

    • type
      String
  • dojox.cometd.Connection.batch

    • type
      Number
  • dojox.cometd.Connection.publish

    • parameters:
      • channel: (typeof String)
        the destination channel for the message
      • data: (typeof Object)
        a JSON object containing the message "payload"
        properties:
        Optional. Other meta-data to be mixed into the top-level of the
        message
      • props: (typeof Object)
    • summary
      publishes the passed message to the cometd server for delivery
      on the specified topic
    • type
      Function
  • dojox.cometd.Connection.subscribe

    • parameters:
      • channel: (typeof String)
        name of the cometd channel to subscribe to
      • objOrFunc: (typeof Object)
        an object scope for funcName or the name or reference to a
        function to be called when messages are delivered to the
        channel
      • funcName: (typeof String)
        the second half of the objOrFunc/funcName pair for identifying
        a callback function to notifiy upon channel message delivery
      • props: (typeof Object)
    • returns
      dojo.Deferred
    • summary
      inform the server of this client's interest in channel
    • description
      `dojox.cometd.subscribe()` handles all the hard work of telling
      the server that we want to be notified when events are
      published on a particular topic. `subscribe` accepts a function
      to handle messages and returns a `dojo.Deferred` object which
      has an extra property added to it which makes it suitable for
      passing to `dojox.cometd.unsubscribe()` as a "subscription
      handle" (much like the handle object that `dojo.connect()`
      produces and which `dojo.disconnect()` expects).
      
      Note that of a subscription is registered before a connection
      with the server is established, events sent before the
      connection is established will not be delivered to this client.
      The deferred object which `subscribe` returns will callback
      when the server successfuly acknolwedges receipt of our
      "subscribe" request.
    • example
      Simple subscribe use-case
      	dojox.cometd.init("http://myserver.com:8080/cometd");
      	// log out all incoming messages on /foo/bar
      	dojox.cometd.subscribe("/foo/bar", console, "debug");
    • example
      Subscribe before connection is initialized
      	dojox.cometd.subscribe("/foo/bar", console, "debug");
      	dojox.cometd.init("http://myserver.com:8080/cometd");
    • example
      Subscribe an unsubscribe
      	dojox.cometd.init("http://myserver.com:8080/cometd");
      	var h = dojox.cometd.subscribe("/foo/bar", console, "debug");
      	dojox.cometd.unsubscribe(h);
    • example
      Listen for successful subscription:
      	dojox.cometd.init("http://myserver.com:8080/cometd");
      	var h = dojox.cometd.subscribe("/foo/bar", console, "debug");
      	h.addCallback(function(){
      		console.debug("subscription to /foo/bar established");
      	});
    • type
      Function
  • dojox.cometd.Connection._deferredSubscribes

  • dojox.cometd.Connection.unsubscribe

    • parameters:
      • channel: (typeof String)
        name of the cometd channel to unsubscribe from
      • objOrFunc: (typeof Object)
        an object scope for funcName or the name or reference to a
        function to be called when messages are delivered to the
        channel. If null then all subscribers to the channel are unsubscribed.
      • funcName: (typeof String)
        the second half of the objOrFunc/funcName pair for identifying
        a callback function to notifiy upon channel message delivery
      • props: (typeof Object)
    • returns
      dojo.Deferred
    • summary
      inform the server of this client's disinterest in channel
    • type
      Function
  • dojox.cometd.Connection.disconnect

    • summary
      Disconnect from the server.
    • description
      Disconnect from the server by sending a disconnect message
    • example
      	dojox.cometd.disconnect();
    • type
      Function
  • dojox.cometd.Connection._handshook

    • type
      Object
  • dojox.cometd.Connection.subscribed

    • parameters:
      • channel: (typeof String)
      • message: (typeof Object)
    • type
      Function
  • dojox.cometd.Connection.unsubscribed

    • parameters:
      • channel: (typeof String)
      • message: (typeof Object)
    • type
      Function
  • dojox.cometd.Connection.tunnelInit

    • parameters:
      • childLocation
      • childDomain
    • type
      Function
  • dojox.cometd.Connection.tunnelCollapse

    • type
      Function
  • dojox.cometd.Connection._backoff

    • type
      Function
  • dojox.cometd.Connection._advice

    • type
      Object
  • dojox.cometd.Connection._advice.interval

    • type
      Number
  • dojox.cometd.Connection._backon

    • type
      Function
  • dojox.cometd.Connection._backoffInterval

    • type
      Number
  • dojox.cometd.Connection._interval

    • type
      Function
  • dojox.cometd.Connection._publishMeta

    • parameters:
      • action
      • successful
      • props
    • type
      Function
  • dojox.cometd.Connection._finishInit

    • parameters:
      • data
    • summary
      Handle the handshake return from the server and initialize
      connection if all is OK
    • type
      Function
  • dojox.cometd.Connection.handshakeReturn

  • dojox.cometd.Connection._advice.reconnect

    • type
      String
  • dojox.cometd.Connection.currentTransport

    • type
      Object
  • dojox.cometd.Connection.currentTransport._cometd

    • type
      Object
  • dojox.cometd.Connection.currentTransport.version

  • dojox.cometd.Connection.clientId

  • dojox.cometd.Connection._extendIn

    • parameters:
      • message
    • summary
      Handle extensions for inbound messages
    • type
      Function
  • dojox.cometd.Connection._extendOut

    • parameters:
      • message
    • summary
      Handle extensions for inbound messages
    • type
      Function
  • dojox.cometd.Connection.deliver

    • parameters:
      • messages
    • type
      Function
  • dojox.cometd.Connection._deliver

    • parameters:
      • message
    • type
      Function
  • dojox.cometd.Connection.lastMessage

  • dojox.cometd.Connection._sendMessage

    • parameters:
      • message: (typeof object)
    • type
      Function
  • dojox.cometd.Connection.startBatch

    • type
      Function
  • dojox.cometd.Connection.endBatch

    • type
      Function
  • dojox.cometd.Connection._onUnload

    • type
      Function
  • dojox.cometd.Connection._connectTimeout

    • summary
      Return the connect timeout in ms, calculated as the minimum of the advised timeout
      and the configured timeout. Else 0 to indicate no client side timeout
    • type
      Function
  • dojox.cometd.connectionTypes

    • type
      Object
  • dojox.cometd._base

    • type
      Object
  • dojox

    • type
      Object