Service |
LightWeightPeerGroup.lookupService(ID name,
int ignoredForNow)
Lookup for a service by class ID and index in a map.
More than one service in a group may be of a given ModuleClass.
However each of them has a unique assigned ID which serves as the
index in the map of services. In most cases, there is only one
service of each given Module Class, and the ID of that Module Class
is the assigned ID. Otherwise, the group may have a list of existing
assigned ID per base class. This routine may be used to retrieve
services of the given Module Class and index in that list.
In the absence of a mapping, index 0 is still valid and
corresponds to the service which assigned ID is exactly the
given ID.
Group objects with a map are normaly wrappers taylored
specially by the loader of a module (often the group itself) in order
to provide a map appropriate for that module. Modules that do not use
more than one service of a given base class normally never need to call
this method; lookupService(ID) is equivalent to lookupService(ID, 0)
and will transparently remap index 0 to whatever the group's
structure defines as the default for the invoking service.
Note: traditionaly, the given ID is expected to be a base Module
Class ID, and the assigned ID of a Module is a Class ID of the
same base class with a role suffix to make it unique. If the given
ID already contains a role suffix, there may exist an entry for
it in the map anyway, if not (which is the expected use pattern),
then only index 0 exists and the given ID is used whole and
untranslated. |