4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-direct-Provider'>/**
19 </span> * @class Ext.direct.Provider
20 * <p>Ext.direct.Provider is an abstract class meant to be extended.</p>
22 * <p>For example ExtJs implements the following subclasses:</p>
23 * <pre><code>
26 +---{@link Ext.direct.JsonProvider JsonProvider}
28 +---{@link Ext.direct.PollingProvider PollingProvider}
30 +---{@link Ext.direct.RemotingProvider RemotingProvider}
31 * </code></pre>
34 Ext.define('Ext.direct.Provider', {
36 /* Begin Definitions */
38 alias: 'direct.provider',
41 observable: 'Ext.util.Observable'
46 <span id='Ext-direct-Provider-cfg-id'> /**
47 </span> * @cfg {String} id
48 * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}).
49 * You should assign an id if you need to be able to access the provider later and you do
50 * not have an object reference available, for example:
51 * <pre><code>
52 Ext.direct.Manager.addProvider({
57 var p = {@link Ext.direct.Manager}.{@link Ext.direct.Manager#getProvider getProvider}('poll-provider');
59 * </code></pre>
62 constructor : function(config){
65 Ext.apply(me, config);
67 <span id='Ext-direct-Provider-event-connect'> /**
68 </span> * @event connect
69 * Fires when the Provider connects to the server-side
70 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
73 <span id='Ext-direct-Provider-event-disconnect'> /**
74 </span> * @event disconnect
75 * Fires when the Provider disconnects from the server-side
76 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
79 <span id='Ext-direct-Provider-event-data'> /**
81 * Fires when the Provider receives data from the server-side
82 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
83 * @param {event} e The Ext.Direct.Event type that occurred.
86 <span id='Ext-direct-Provider-event-exception'> /**
87 </span> * @event exception
88 * Fires when the Provider receives an exception from the server-side
92 me.mixins.observable.constructor.call(me, config);
95 <span id='Ext-direct-Provider-method-isConnected'> /**
96 </span> * Returns whether or not the server-side is currently connected.
97 * Abstract method for subclasses to implement.
99 isConnected: function(){
103 <span id='Ext-direct-Provider-method-connect'> /**
104 </span> * Abstract methods for subclasses to implement.
107 connect: Ext.emptyFn,
109 <span id='Ext-direct-Provider-method-disconnect'> /**
110 </span> * Abstract methods for subclasses to implement.
113 disconnect: Ext.emptyFn