|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Allows to register, unregister and access Services for a subdialog.
The functionality of SubDialogServiceAccess is an integral part of
SubDialogControl. Every SubDialogControl is (per inheritence) a
SubDialogServiceAccess!
The Services can only be found by the subdialog and it's childs
using their
DialogControl.findServiceInHierarchy(Class)
methods - they are not part of the public interface of the subdialog.
Public interfaces can only be provided by the subdialog itself.
To ease service handling, the subdialog cannot overwrite services provided
for it using this interface (in this case the registration would throw an error
(depending on where the subdialog was embedded to), because services must be
uninstalled and cannot be overwritten).
It just can shadow the service implementation. This can happen only when
looking for service implementations along the hierarchy (see
DialogControl.findServiceInHierarchy(Class))
where services are searched along the following order (on each dialog node for a
special service key class):
SubDialogServiceAccess)
| Method Summary | |
Service |
getService(java.lang.Class service)
Returns the implementation of a desired service registered at the controlled dialog. |
boolean |
hasService(java.lang.Class service)
Tests if a service is registered at the controlled dialog. |
void |
registerService(java.lang.Class service,
Service implementation)
Registers a service for this node. |
void |
registerService(java.lang.Class service,
Service implementation,
java.lang.String registrationContext)
Registers a service for this node. |
void |
unregisterService(java.lang.Class service,
Service implementation)
Unregisters a service for this node. |
void |
unregisterServices(java.lang.String registrationContext)
Unregisters all services registered with the same registration context |
| Method Detail |
public Service getService(java.lang.Class service)
service - the class of the service interface that is requested
java.lang.IllegalArgumentException - if the id is unknown, if the
service class is not an interface that extends
Service, or if the service is not available at the
given nodepublic boolean hasService(java.lang.Class service)
service - the class of the service interface that is searched for
public void registerService(java.lang.Class service,
Service implementation,
java.lang.String registrationContext)
Service,
and the implementation implement that interface.
If there is already an implementation registered for that service, that implementation is replaced by the passed as a parameter.
Please note that a a registered service should be unregistered when the life cycle of the provider ends.
service - the interface that defines the serviceimplementation - the implementation of the serviceregistrationContext - an optional registration context (may be null);
may be used for easy unregistration of services to an context (see #unregisterServices(Object))
java.lang.IllegalArgumentException - if the providerId is unknown,
service is not an interface or does not extend Service, or the
implementation does not implement the interface that defines the service.
public void registerService(java.lang.Class service,
Service implementation)
Service,
and the implementation implement that interface.
If there is already an implementation registered for that service, that implementation is replaced by the passed as a parameter.
Please note that a a registered service should be unregistered when the life cycle of the provider ends.
service - the interface that defines the serviceimplementation - the implementation of the service
java.lang.IllegalArgumentException - if the providerId is unknown,
service is not an interface or does not extend Service, or the
implementation does not implement the interface that defines the service.
public void unregisterService(java.lang.Class service,
Service implementation)
If the service is not registered for this node or the given implementation is not the one that is registered, nothing happens.
Therefore, if a service implementation is replaced by another implementation, the unregistering of the first implementation is harmless since the second implementation will stay registered. However, if the second implementation is unregistered first, then no service will be available, even though the first service implementation hasn't been unregistered yet.
service - the interface that defines the serviceimplementation - the registered implementation of the service
java.lang.IllegalArgumentException - if the providerId is unknown,
service is not an interface or does not extend Service, or the
implementation does not implement the interface that defines the service.public void unregisterServices(java.lang.String registrationContext)
registrationContext - the registration context object that mark the
services to unregister
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||