blob: 94dfce7bb6070252176214627b36703c3dc7dc05 [file] [log] [blame]
Pierre De Rop3a00a212015-03-01 09:27:46 +000017 feb 2014 (marrs & uiterlix):
2
3This prototype demonstrates the new concurrency principles that form the basis for the DM:
4
5 * All external events that influence the state of dependencies are recorded and given
6 to the serial executor of the component. We record whatever data comes in, so when the
7 actual job is run by the serial executor, we still have access to the original data
8 without having to access other sources whose state might have changed since.
9 * The serial executor of a component will execute a job immediately if it is being called
10 by the thread that is already executing jobs.
11 * If the serial executor of a component had not yet started a job, it will queue and start
12 it on the current thread.
13 * If the serial executor gets invoked from a different thread than the one currently
14 executing jobs, the job will be put at the end of the queue. As mentioned before, any
15 data associated with the event will also be recorded so it is available when the job
16 executes.
17 * State in the component and dependency can only be modified via the serial executor
18 thread. This means we don't need explicit synchronization anywhere.
19
2020 sept 2014 (pderop):
21
22 * Added support for parallelism: To allow components to be started and handled in parallel, you can
23 now register in the OSGi service registry a ComponentExecutorFactory service that is used to get
24 an Executor for the management of all components dependencies/lifecycle callbacks. See javadoc
25 from the org.apache.felix.dm.ComponentExecutorFactory interface for more informations.
26
27 You can also take a look at the the org.apache.felix.dependencymanager.samples project, which is
28 registering a ComponentExecutorFactory from org.apache.felix.dependencymanager.samples.tpool
29 bundle.
30
31 See also the following property in the org.apache.felix.dependencymanager.samples/bnd.bnd
32
33 org.apache.felix.dependencymanager.parallel=\
34 '!org.apache.felix.dependencymanager.samples.tpool, *',\
35
36 Here, all components will be handled by Executors provided by the ComponentExecutorFactory,
37 except those having a package starting with "org.apache.felix.dependencymanager.samples.tpool"
38 (because the threadpool is itself defined using the Dependency Manager API).
39
40
41
42
43
44
45
46
47