1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* AppserverIo\Psr\EnterpriseBeans\TimerConfig |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Johann Zelger <[email protected]> |
15
|
|
|
* @author Tim Wagner <[email protected]> |
16
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
17
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
18
|
|
|
* @link https://github.com/appserver-io-psr/epb |
19
|
|
|
* @link http://www.appserver.io |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
namespace AppserverIo\Psr\EnterpriseBeans; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* TimerConfig is used to specify additional timer configuration settings during timer creation. |
26
|
|
|
* |
27
|
|
|
* The info object represents a serializable object made available to corresponding timer callbacks. |
28
|
|
|
* It is optional and defaults to null. |
29
|
|
|
* |
30
|
|
|
* The persistent property determines whether the corresponding timer has a lifetime. |
31
|
|
|
* It is optional and defaults to true. |
32
|
|
|
* |
33
|
|
|
* @author Johann Zelger <[email protected]> |
34
|
|
|
* @author Tim Wagner <[email protected]> |
35
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
36
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
37
|
|
|
* @link https://github.com/appserver-io-psr/epb |
38
|
|
|
* @link http://www.appserver.io |
39
|
|
|
*/ |
40
|
|
|
class TimerConfig |
41
|
|
|
{ |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var \Serializable |
45
|
|
|
*/ |
46
|
|
|
private $info; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Persistent by default |
50
|
|
|
* |
51
|
|
|
* @var boolean |
52
|
|
|
*/ |
53
|
|
|
private $persistent = true; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* TimerConfig constructor |
57
|
|
|
* |
58
|
|
|
* @param \Serializable $info The info object |
59
|
|
|
* @param boolean $persistent The persistence flag |
60
|
|
|
*/ |
61
|
|
|
public function __construct(\Serializable $info = null, $persistent = true) |
62
|
|
|
{ |
63
|
|
|
$this->info = $info; |
64
|
|
|
$this->persistent = $persistent; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Returns the serializable info object |
69
|
|
|
* |
70
|
|
|
* @return \Serializable |
71
|
|
|
*/ |
72
|
|
|
public function getInfo() |
73
|
|
|
{ |
74
|
|
|
return $this->info; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Returns if should be persistent |
79
|
|
|
* |
80
|
|
|
* @return boolean |
81
|
|
|
*/ |
82
|
|
|
public function isPersistent() |
83
|
|
|
{ |
84
|
|
|
return $this->persistent; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Sets the info object |
89
|
|
|
* |
90
|
|
|
* @param \Serializable $i The info object |
91
|
|
|
* |
92
|
|
|
* @return void |
93
|
|
|
*/ |
94
|
|
|
public function setInfo(\Serializable $i) |
95
|
|
|
{ |
96
|
|
|
$this->info = $i; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Sets the persistence flag |
101
|
|
|
* |
102
|
|
|
* @param boolean $p The persistence flag |
103
|
|
|
* |
104
|
|
|
* @return void |
105
|
|
|
*/ |
106
|
|
|
public function setPersistent($p) |
107
|
|
|
{ |
108
|
|
|
$this->persistent = $p; |
109
|
|
|
} |
110
|
|
|
} |
111
|
|
|
|