Sometimes several plugins of the same type are expected to co-exist
simultaneously, and sometimes not.
For example, there may be several plugins which have resource requirements
for worker netlets. If each is added to the plugin manager then they
will all be queried so their requirements can be aggregated. Here's
how it might work:
- Plugin manager P is a WorkerPool . It organises workers.
- Plugin A would like workers to have access to port 53. It implements
IWorkerResourceRequester and gets added to P.
- Plugin B would like workers to have access to any port over 1024.
It also implements IWorkerResourceRequester and also gets
added to P.
- Plugin C would like workers to have file space of 2MB or more. It
implements IWorkerResourceRequester and gets added to P.
- Some time later the worker pool P wants to start a new worker. It
looks up every plugin that implements IWorkerResourceRequester
and finds A, B and C. It asks every one what its requirements are,
then goes to look for a node which has all those resources.
In this example the worker pool operates with several plugins all
of which implement the same interface.
Nik Silver
2002-03-09