|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Allows registration of services that are hierarchically organized along a dialog hierarchy.
Implementations of this interface should be threadsafe.
Note: if we'd use java 1.5, this would be a generic.
DialogServiceProvider| Method Summary | |
void |
registerService(ID providerId,
java.lang.Class service,
Service implementation)
Registers a public service implementation for the node with the given id. |
void |
registerServiceForHierarchy(ID providerId,
java.lang.Class service,
Service implementation)
Registers a service implmentation for the node with the given id for hierarchical use only. |
void |
registerServiceFromParent(ID providerId,
java.lang.Class service,
Service implementation)
Registers a service for the node with the given id for hierarchical use only; in opposite to registerServiceForHierarchy(ID, Class, Service),
the service will be found after the hierarchical service and the
direct service was found.
|
void |
unregisterService(ID providerId,
java.lang.Class service,
Service implementation)
Unregisters a service for a given node. |
| Methods inherited from interface com.sdm.quasar.client.core.dialog.impl.DialogServiceProvider |
collectSystemInfo, findServiceInHierarchy, findServiceInHierarchy, getServiceDirect, hasServiceDirect, hasServiceInHierarchy, hasServiceInHierarchy |
| Method Detail |
public void registerService(ID providerId,
java.lang.Class service,
Service implementation)
Service,
and the implementation implement that interface.
Public services will be accessible by DialogServiceProvider.getServiceDirect(ID, Class)
and will be found by DialogServiceProvider.findServiceInHierarchy(ID, Class)
after a potentially registered hierarchy-only service was found
(see registerServiceForHierarchy(ID, Class, Service)} for this case.
If there is already a public implementation registered for that service,
an IllegalArgumentException will be thrown.
Please note that a a registered service should be unregistered when the life cycle of the provider ends.
providerId - the id of the node where the service should be registeredservice - 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 or
there is already a public service implementation registered
public void registerServiceForHierarchy(ID providerId,
java.lang.Class service,
Service implementation)
The service implementation will not be found by accessing it via
DialogServiceProvider.getServiceDirect(ID, Class); it will be found
only via DialogServiceProvider.findServiceInHierarchy(ID, Class).
Please note, that different service implementations of a service interface can
be registered for hierarchical use (this method) and for direct use
(see registerService(ID, Class, Service)).
By using DialogServiceProvider.findServiceInHierarchy(ID, Class) the
service implementation registered using this method will be found before
the service registered using registerService(ID, Class, Service).
The service class must be an interface that extend Service,
and the implementation implement that interface.
IllegalArgumentException will be thrown.
Please note that a a registered service should be unregistered when the life cycle of the provider ends.
providerId - the id of the node where the service should be registeredservice - 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 or
there is already a hierarchical service implementation registered
public void registerServiceFromParent(ID providerId,
java.lang.Class service,
Service implementation)
registerServiceForHierarchy(ID, Class, Service),
the service will be found after the hierarchical service and the
direct service was found.
The service class must be an interface that extend Service,
and the implementation implement that interface.
IllegalArgumentException will be thrown.
Please note that a a registered service should be unregistered when the life cycle of the provider ends.
providerId - the id of the node where the service should be registeredservice - 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 or
there is already a parent service implementation registered
public void unregisterService(ID providerId,
java.lang.Class service,
Service implementation)
If the service is not registered for the given 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.
providerId - the id of the node where the service should be unregisteredservice - 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 | ||||||||||