Transaction.js 828 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Supporting Class for Ext.Direct (not intended to be used directly).
  3. */
  4. Ext.define('Ext.direct.Transaction', {
  5. /* Begin Definitions */
  6. alias: 'direct.transaction',
  7. alternateClassName: 'Ext.Direct.Transaction',
  8. statics: {
  9. TRANSACTION_ID: 0
  10. },
  11. /* End Definitions */
  12. /**
  13. * Creates new Transaction.
  14. * @param {Object} [config] Config object.
  15. */
  16. constructor: function(config){
  17. var me = this;
  18. Ext.apply(me, config);
  19. me.id = me.tid = ++me.self.TRANSACTION_ID;
  20. me.retryCount = 0;
  21. },
  22. send: function(){
  23. this.provider.queueTransaction(this);
  24. },
  25. retry: function(){
  26. this.retryCount++;
  27. this.send();
  28. },
  29. getProvider: function(){
  30. return this.provider;
  31. }
  32. });