This component can be used to export an internal service out to an
external framework.
For example, the
NodeApplet uses this component to get the
NodeControlService .
Two parameters are required:
1) The Service class or classname, which can be
ServiceBroker .
2) The
GetServiceCallback listener, which can be
specified as a class, classname, or instance.
A third parameter is optional:
3) The service requestor, or "this" for this component, which
defaults to "this".
A fourth parameter is optional:
4) Use a late-binding service listener if the service is not
available at load time, defaults to "true".
Reflection is used to wrap the callback as the GetServiceCallback API, even
if it doesn't implement that API. This allows an external client to
specify:
public class MyCallback {
public void setService(Class cl, Object service) {..}
}
even though "MyCallback instanceof GetServiceCallback" is false. This is
supported to avoid awkward compile and classloader dependencies.
|