13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Service_WindowsAzure |
16 * @package Zend_Service_WindowsAzure |
17 * @subpackage RetryPolicy |
17 * @subpackage RetryPolicy |
18 * @version $Id: RetryN.php 20785 2010-01-31 09:43:03Z mikaelkael $ |
18 * @version $Id: RetryN.php 24593 2012-01-05 20:35:02Z matthew $ |
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @see Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract |
24 * @see Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract |
25 */ |
25 */ |
26 require_once 'Zend/Service/WindowsAzure/RetryPolicy/RetryPolicyAbstract.php'; |
26 require_once 'Zend/Service/WindowsAzure/RetryPolicy/RetryPolicyAbstract.php'; |
27 |
27 |
28 /** |
28 /** |
29 * @see Zend_Service_WindowsAzure_RetryPolicy_Exception |
|
30 */ |
|
31 require_once 'Zend/Service/WindowsAzure/RetryPolicy/Exception.php'; |
|
32 |
|
33 /** |
|
34 * @category Zend |
29 * @category Zend |
35 * @package Zend_Service_WindowsAzure |
30 * @package Zend_Service_WindowsAzure |
36 * @subpackage RetryPolicy |
31 * @subpackage RetryPolicy |
37 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
32 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
38 * @license http://framework.zend.com/license/new-bsd New BSD License |
33 * @license http://framework.zend.com/license/new-bsd New BSD License |
39 */ |
34 */ |
40 class Zend_Service_WindowsAzure_RetryPolicy_RetryN extends Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract |
35 class Zend_Service_WindowsAzure_RetryPolicy_RetryN extends Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract |
41 { |
36 { |
42 /** |
37 /** |
80 try { |
75 try { |
81 $returnValue = call_user_func_array($function, $parameters); |
76 $returnValue = call_user_func_array($function, $parameters); |
82 return $returnValue; |
77 return $returnValue; |
83 } catch (Exception $ex) { |
78 } catch (Exception $ex) { |
84 if ($retriesLeft == 1) { |
79 if ($retriesLeft == 1) { |
|
80 require_once 'Zend/Service/WindowsAzure/RetryPolicy/Exception.php'; |
85 throw new Zend_Service_WindowsAzure_RetryPolicy_Exception("Exceeded retry count of " . $this->_retryCount . ". " . $ex->getMessage()); |
81 throw new Zend_Service_WindowsAzure_RetryPolicy_Exception("Exceeded retry count of " . $this->_retryCount . ". " . $ex->getMessage()); |
86 } |
82 } |
87 |
83 |
88 usleep($this->_retryInterval * 1000); |
84 usleep($this->_retryInterval * 1000); |
89 } |
85 } |