|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The DialogServiceAccess provides methods for acessing and providing
services.
The functionality of DialogServiceAccess is an integral part of
DialogControl. Every DialogControl is (per inheritence) a
DialogServiceAccess!
DialogServiceAccess allows a dialog to:
registerServiceForHierarchy(Class, Service)
and registerService(Class, Service)),findServiceInHierarchy(Class)),DialogInstanceId's (see
getServiceDirect(ID, Class)).
The look-up of Services along the hierarchy looks for the three(!)
possibly registered service instances at this dialog node in the following order:
SubDialogControl that has the parent dialog to control this dialog node)
Service| Method Summary | |
Service |
findServiceInHierarchy(java.lang.Class service)
Returns the first implementation of a desired service in the hierarchy of the node. |
Service |
findServiceInParentHierarchy(java.lang.Class service)
Returns the first implementation of a desired service in the hierarchy of the parent node. |
Service |
getServiceDirect(ID id,
java.lang.Class service)
Returns the implementation of a desired service registered at the node with the given id. |
boolean |
hasServiceDirect(ID id,
java.lang.Class service)
Tests whether a specific node offers a service. |
boolean |
hasServiceInHierarchy(java.lang.Class service)
Tests if a service exists in the hierarchy of the node. |
boolean |
hasServiceInParentHierarchy(java.lang.Class service)
Tests if a service exists in the hierarchy of the parent node. |
void |
registerService(java.lang.Class service,
Service implementation)
Registers a service for this node. |
void |
registerServiceForHierarchy(java.lang.Class service,
Service implementation)
Registers a service for this node for hierarchical use only. |
void |
unregisterService(java.lang.Class service,
Service implementation)
Unregisters a service for this node. |
| Method Detail |
public boolean hasServiceDirect(ID id,
java.lang.Class service)
id - the id of the nodeservice - the class of the service interface that is searched for
java.lang.IllegalArgumentException - if the id is unknown or if the
service class is not an interface that extends Service.
public Service getServiceDirect(ID id,
java.lang.Class service)
id - the id of the nodeservice - 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 hasServiceInHierarchy(java.lang.Class service)
service - the class of the service interface that is searched for
DialogServiceProvider.hasServiceInHierarchy(ID, java.lang.Class)public boolean hasServiceInParentHierarchy(java.lang.Class service)
service - the class of the service interface that is searched for
DialogServiceProvider.hasServiceInHierarchy(ID, java.lang.Class)public Service findServiceInHierarchy(java.lang.Class service)
service - the class of the service interface that is searched for
com.sdm.quasar.client.core.dialog.DialogServiceProvider#findServiceInHierarchy(com.sdm.quasar.client.core.common.ID, java.lang.Class)public Service findServiceInParentHierarchy(java.lang.Class service)
service - the class of the service interface that is searched for
com.sdm.quasar.client.core.dialog.DialogServiceProvider#findServiceInHierarchy(com.sdm.quasar.client.core.common.ID, java.lang.Class)
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 registerServiceForHierarchy(java.lang.Class service,
Service implementation)
getServiceDirect(ID, Class); it will be found
only via findServiceInHierarchy(Class).
Please note, that a service interface can eighter be registered for hierarchical
use (this method) or for direct and hierarchical use
(see #registerService(ID, Class, Service)).
The last registration overwrites the previous; it is not possible to
register two different implementations: one for hierarchical and one for direct
use!
The service class must be an interface that extend Service,
and the implementation implement that interface.
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.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||