1 | <?php |
||
52 | class TimedObjectInvoker extends GenericStackable implements TimedObjectInvokerInterface |
||
53 | { |
||
54 | |||
55 | /** |
||
56 | * The execution environment. |
||
57 | * |
||
58 | * @var \AppserverIo\Appserver\Core\Environment |
||
59 | */ |
||
60 | public static $environment; |
||
61 | |||
62 | /** |
||
63 | * The annotation reader instance singleton. |
||
64 | * |
||
65 | * @var \Doctrine\Common\Annotations\AnnotationReader |
||
66 | */ |
||
67 | public static $annotationReaderInstance; |
||
68 | |||
69 | /** |
||
70 | * Return's the annotation reader instance. |
||
71 | * |
||
72 | * @return \Doctrine\Common\Annotations\AnnotationReader |
||
73 | */ |
||
74 | public function getAnnotationReader() |
||
85 | |||
86 | /** |
||
87 | * Return's the method annotation with the passed name, if available. |
||
88 | * |
||
89 | * @param \AppserverIo\Lang\Reflection\MethodInterface $reflectionMethod The reflection method to return the annotation for |
||
90 | * @param string $annotationName The name of the annotation to return |
||
91 | * |
||
92 | * @return object|null The method annotation, or NULL if not available |
||
93 | */ |
||
94 | public function getMethodAnnotation(MethodInterface $reflectionMethod, $annotationName) |
||
98 | |||
99 | /** |
||
100 | * Injects the timed object instance. |
||
101 | * |
||
102 | * @param \AppserverIo\Lang\Reflection\ClassInterface $timedObject The timed object instance |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | public function injectTimedObject(ClassInterface $timedObject) |
||
110 | |||
111 | /** |
||
112 | * Injects the storage for the timeout methods. |
||
113 | * |
||
114 | * @param \AppserverIo\Storage\StorageInterface $timeoutMethods The storage for the timeout methods |
||
115 | * |
||
116 | * @return void |
||
117 | */ |
||
118 | public function injectTimeoutMethods(StorageInterface $timeoutMethods) |
||
122 | |||
123 | /** |
||
124 | * Injects the application instance. |
||
125 | * |
||
126 | * @param \AppserverIo\Psr\Application\ApplicationInterface $application The application instance |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | public function injectApplication(ApplicationInterface $application) |
||
134 | |||
135 | /** |
||
136 | * Return the timed object instance. |
||
137 | * |
||
138 | * @return \AppserverIo\Lang\Reflection\ClassInterface The timed object instance |
||
139 | */ |
||
140 | public function getTimedObject() |
||
144 | |||
145 | /** |
||
146 | * Returns the timeout methods. |
||
147 | * |
||
148 | * @return \AppserverIo\Storage\StorageInterface A collection of timeout methods |
||
149 | **/ |
||
150 | public function getTimeoutMethods() |
||
154 | |||
155 | /** |
||
156 | * Returns the application instance. |
||
157 | * |
||
158 | * @return \AppserverIo\Psr\Application\ApplicationInterface The application instance |
||
159 | */ |
||
160 | public function getApplication() |
||
164 | |||
165 | /** |
||
166 | * The globally unique identifier for this timed object invoker. |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getTimedObjectId() |
||
174 | |||
175 | /** |
||
176 | * Responsible for invoking the timeout method on the target object. |
||
177 | * |
||
178 | * The timerservice implementation invokes this method as a callback when a timeout occurs for the |
||
179 | * passed timer. The timerservice implementation will be responsible for passing the correct |
||
180 | * timeout method corresponding to the <code>timer</code> on which the timeout has occurred. |
||
181 | * |
||
182 | * @param \AppserverIo\Psr\EnterpriseBeans\TimerInterface $timer The timer that is passed to timeout |
||
183 | * @param \AppserverIo\Lang\Reflection\MethodInterface $timeoutMethod The timeout method |
||
184 | * |
||
185 | * @return void |
||
186 | */ |
||
187 | public function callTimeout(TimerInterface $timer, MethodInterface $timeoutMethod = null) |
||
235 | |||
236 | /** |
||
237 | * Initializes the timed object invoker with the methods annotated |
||
238 | * with the @Timeout or @Schedule annotation. |
||
239 | * |
||
240 | * @return void |
||
241 | */ |
||
242 | public function start() |
||
268 | } |
||
269 |