|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.core.common.services.AbstractServiceManager
com.sdm.quasar.client.core.dialog.impl.DefaultDialogServiceManager
This service manager manages services of type
Service.
Hint: You can use interfaces that don't implement
Service
by deriving an empty interface that implements
Service
and use a dynamic proxy redirection to the implementation.
| Field Summary |
| Fields inherited from class com.sdm.quasar.client.core.common.services.AbstractServiceManager |
DIRECT, FROM_PARENT, HIERARCHY, virtualRootNode |
| Constructor Summary | |
DefaultDialogServiceManager(HierarchyManager hierarchyProvider)
Constructor that initializes this com.sdm.quasar.client.core.dialog.DialogServiceManager without
forwarding to an ServiceManager. |
|
DefaultDialogServiceManager(HierarchyManager hierarchyProvider,
ID virtualRootNode,
ServiceProvider parentServiceProvider)
Constructor that initializes this com.sdm.quasar.client.core.dialog.DialogServiceManager with a
forwarding to an ServiceManager for requests concerning
the given virtual root node. |
|
| Method Summary | |
void |
collectSystemInfo(ID id,
SystemInfoNode root,
SystemInfoOptions options)
Builds the system information tree upon local information of the implementor about the dialog with the ID given. |
Service |
findServiceInHierarchy(ID id,
java.lang.Class service)
Returns the first implementation of a desired service in the hierarchy starting from the node with the given id to the root node. |
Service |
findServiceInHierarchy(ID id,
ID rootID,
java.lang.Class service)
Returns the first implementation of a desired service in the hierarchy starting from the node with the given id to the specified root 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(ID id,
java.lang.Class service)
Tests whether the service is offered in the hierarchy starting from the node with the given id. |
boolean |
hasServiceInHierarchy(ID id,
ID rootID,
java.lang.Class service)
Tests whether the service is offered in the hierarchy starting from the node with the given id to the specified root node. |
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 class com.sdm.quasar.client.core.common.services.AbstractServiceManager |
dispose, genericFindServiceInHierarchy, genericGetAllServiceImplementations, genericGetAllServices, genericGetServiceDirect, genericHasServiceDirect, genericHasServiceInHierarchy, genericRegisterService, genericUnregisterService, hasID |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultDialogServiceManager(HierarchyManager hierarchyProvider)
com.sdm.quasar.client.core.dialog.DialogServiceManager without
forwarding to an ServiceManager.
hierarchyProvider - the HierarchyManager that governs the hierarchy
that is used to organize the Services.
public DefaultDialogServiceManager(HierarchyManager hierarchyProvider,
ID virtualRootNode,
ServiceProvider parentServiceProvider)
com.sdm.quasar.client.core.dialog.DialogServiceManager with a
forwarding to an ServiceManager for requests concerning
the given virtual root node. See AbstractServiceManager.virtualRootNode for more information.
hierarchyProvider - the HierarchyManager that governs the hierarchy
that is used to organize the Services.virtualRootNode - the id of the virtual root nodeparentServiceProvider - the ServiceManager
to which requests concerning the virtual root node are forwarded.| Method Detail |
public void registerService(ID providerId,
java.lang.Class service,
Service implementation)
DialogServiceManagerService,
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 DialogServiceManager.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.
registerService in interface DialogServiceManagerproviderId - the id of the node where the service should be registeredservice - the interface that defines the serviceimplementation - the implementation of the servicecom.sdm.quasar.client.core.dialog.DialogServiceManager#registerService(com.sdm.quasar.client.core.common.ID, java.lang.Class, com.sdm.quasar.client.core.common.services.Service)
public void registerServiceForHierarchy(ID providerId,
java.lang.Class service,
Service implementation)
DialogServiceManager
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 DialogServiceManager.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 DialogServiceManager.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.
registerServiceForHierarchy in interface DialogServiceManagerproviderId - the id of the node where the service should be registeredservice - the interface that defines the serviceimplementation - the implementation of the servicecom.sdm.quasar.client.core.dialog.DialogServiceManager#registerServiceForHierarchy(com.sdm.quasar.client.core.common.ID, java.lang.Class, com.sdm.quasar.client.core.common.services.Service)
public void registerServiceFromParent(ID providerId,
java.lang.Class service,
Service implementation)
DialogServiceManagerDialogServiceManager.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.
registerServiceFromParent in interface DialogServiceManagerproviderId - the id of the node where the service should be registeredservice - the interface that defines the serviceimplementation - the implementation of the servicecom.sdm.quasar.client.core.dialog.DialogServiceManager#registerServiceFromParent(com.sdm.quasar.client.core.common.ID, java.lang.Class, com.sdm.quasar.client.core.common.services.Service)
public void unregisterService(ID providerId,
java.lang.Class service,
Service implementation)
DialogServiceManagerIf 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.
unregisterService in interface DialogServiceManagerproviderId - the id of the node where the service should be unregisteredservice - the interface that defines the serviceimplementation - the registered implementation of the servicecom.sdm.quasar.client.core.dialog.DialogServiceManager#unregisterService(com.sdm.quasar.client.core.common.ID, java.lang.Class, com.sdm.quasar.client.core.common.services.Service)
public boolean hasServiceInHierarchy(ID id,
java.lang.Class service)
DialogServiceProvider
hasServiceInHierarchy in interface DialogServiceProviderid - the id of the node at which the search starts towards the root nodeservice - the class of the service interface that is searched for
com.sdm.quasar.client.core.dialog.DialogServiceProvider#hasServiceInHierarchy(com.sdm.quasar.client.core.common.ID, java.lang.Class)
public boolean hasServiceInHierarchy(ID id,
ID rootID,
java.lang.Class service)
DialogServiceProvider
hasServiceInHierarchy in interface DialogServiceProviderid - the id of the node at which the search starts towards the root noderootID - the root id where to stop looking for a parent provider (may
be null or not contained in id's hierarchy tree, which will be
threated at the root of the current hierarchy tree)service - the class of the service interface that is searched for
com.sdm.quasar.client.core.dialog.DialogServiceProvider#hasServiceInHierarchy(com.sdm.quasar.client.core.common.ID, com.sdm.quasar.client.core.common.ID, java.lang.Class)
public Service findServiceInHierarchy(ID id,
java.lang.Class service)
DialogServiceProvider
findServiceInHierarchy in interface DialogServiceProviderid - the id of the node at which the search starts towards the root nodeservice - 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 findServiceInHierarchy(ID id,
ID rootID,
java.lang.Class service)
DialogServiceProvider
findServiceInHierarchy in interface DialogServiceProviderid - the id of the node at which the search starts towards the root noderootID - the root id where to stop looking for a parent provider (may
be null or not contained in id's hierarchy tree, which will be
threated at the root of the current hierarchy tree)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, com.sdm.quasar.client.core.common.ID, java.lang.Class)
public boolean hasServiceDirect(ID id,
java.lang.Class service)
DialogServiceProvider
hasServiceDirect in interface DialogServiceProviderid - the id of the nodeservice - the class of the service interface that is searched for
com.sdm.quasar.client.core.dialog.DialogServiceProvider#hasServiceDirect(com.sdm.quasar.client.core.common.ID, java.lang.Class)
public Service getServiceDirect(ID id,
java.lang.Class service)
DialogServiceProvider
getServiceDirect in interface DialogServiceProviderid - the id of the nodeservice - the class of the service interface that is requested
com.sdm.quasar.client.core.dialog.DialogServiceProvider#getServiceDirect(com.sdm.quasar.client.core.common.ID, java.lang.Class)
public void collectSystemInfo(ID id,
SystemInfoNode root,
SystemInfoOptions options)
DialogServiceProviderID given.
collectSystemInfo in interface DialogServiceProviderid - the ID to append system information to the node givenroot - the SystemInfoNode to add information to (guaranteed to be not null)options - contains additional options, that might influence the amount of
information added to the tree (guaranteed to be not null)DialogServiceProvider.collectSystemInfo(com.sdm.quasar.client.core.common.ID, com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode, com.sdm.quasar.client.core.common.sysinfo.SystemInfoOptions)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||