This interface defines a method that is used to request a service from an object.
public Object queryService(Object id) throws ServiceNotFoundException;
Requests a service from an object. The object that provides the service can be the current object or a different object.
To determine whether the object supports the requested service, a typical implementation would check to see if any of the following items are true:
- The object is an instance of the requested service.
- The object implements the requested service.
- The object can construct or use another object that is an instance of or implements the requested service.
If the object does not support the requested service, it delegates the method call to an upper level object (such as a containing frame). Finally, if no object in the chain supports the requested service, a ServiceNotFoundException is thrown.
Return Value:
Returns the service object, if it is available.
Parameter | Description |
id
| The identifier of the requested service.
|
Exceptions:
ServiceNotFoundException
if no object supports the requested service.