S
- the generic typeSCTX
- the generic typeServiceDirectory<S,SCTX>
, ServiceLookup<S,SCTX>
public class ServiceDirectoryImpl<S extends Service<?>,SCTX extends ServiceContext<S>> extends Object implements ServiceDirectory<S,SCTX>
ServiceDirectoryImpl
implements the ServiceDirectory
.Constructor | Description |
---|---|
ServiceDirectoryImpl() |
Modifier and Type | Method | Description |
---|---|---|
void |
addService(ServiceDescriptor<S,SCTX> aServiceDescriptor) |
Registers a service to the service bus.
|
Set<ServiceDescriptor<S,SCTX>> |
getServiceDescriptors() |
Returns a collection containing the
ServiceDescriptor instances
known by the ServiceLookup . |
boolean |
hasService(ServiceDescriptor<S,SCTX> aServiceDescriptor) |
Determines whether the given service is known by the service bus by
taking the service type and the service Meta-Data as criteria, not the
service identity.
|
void |
removeService(ServiceDescriptor<S,SCTX> aServiceDescriptor) |
Unregisters a service to the service bus.
|
public Set<ServiceDescriptor<S,SCTX>> getServiceDescriptors()
ServiceDescriptor
instances
known by the ServiceLookup
.getServiceDescriptors
in interface ServiceLookup<S extends Service<?>,SCTX extends ServiceContext<S>>
ServiceDescriptor
instances
known by the ServiceLookup
.public boolean hasService(ServiceDescriptor<S,SCTX> aServiceDescriptor)
hasService
in interface ServiceLookup<S extends Service<?>,SCTX extends ServiceContext<S>>
aServiceDescriptor
- the service descriptorpublic void addService(ServiceDescriptor<S,SCTX> aServiceDescriptor) throws DuplicateServiceRuntimeException
addService
in interface ServiceDirectory<S extends Service<?>,SCTX extends ServiceContext<S>>
aServiceDescriptor
- the service descriptorDuplicateServiceRuntimeException
- in case the service cannot be
identified unambiguously by a matcher. A matcher declaration must
be possible to identify the given service unambiguously. The
service as being described by the service type and the service
Meta-Data is already registered to the service bus.public void removeService(ServiceDescriptor<S,SCTX> aServiceDescriptor) throws UnknownServiceRuntimeException
removeService
in interface ServiceDirectory<S extends Service<?>,SCTX extends ServiceContext<S>>
aServiceDescriptor
- the service descriptorUnknownServiceRuntimeException
- in case the service is not known.Copyright © 2018. All rights reserved.