* This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ namespace OC\Hooks; /** * Class ForwardingEmitter * * allows forwarding all listen calls to other emitters * * @package OC\Hooks */ abstract class ForwardingEmitter extends BasicEmitter { /** * @var \OC\Hooks\Emitter[] array */ private $forwardEmitters = array(); /** * @param string $scope * @param string $method * @param callable $callback */ public function listen($scope, $method, $callback) { parent::listen($scope, $method, $callback); foreach ($this->forwardEmitters as $emitter) { $emitter->listen($scope, $method, $callback); } } /** * @param \OC\Hooks\Emitter $emitter */ protected function forward($emitter) { $this->forwardEmitters[] = $emitter; //forward all previously connected hooks foreach ($this->listeners as $key => $listeners) { list($scope, $method) = explode('::', $key, 2); foreach ($listeners as $listener) { $emitter->listen($scope, $method, $listener); } } } } n value='7.7.45-changelog'>7.7.45-changelog Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/frameworkwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/server/ServiceDestroyListener.java
blob: 4ce74e28d0b9d42f3bc86d63953a5c04f0830351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40