S
- the generic typeSCTX
- the generic typepublic class ServiceDirectoryImpl<S extends Service<?>,SCTX extends ServiceContext<S>> extends Object implements ServiceDirectory<S,SCTX>
ServiceDirectoryImpl
implements the ServiceDirectory
.Constructor and Description |
---|
ServiceDirectoryImpl() |
Modifier and Type | Method and 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 a service descriptorpublic void addService(ServiceDescriptor<S,SCTX> aServiceDescriptor) throws DuplicateServiceRuntimeException
addService
in interface ServiceDirectory<S extends Service<?>,SCTX extends ServiceContext<S>>
aServiceDescriptor
- the a 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 a service descriptorUnknownServiceRuntimeException
- in case the service is not known.Copyright © 2017. All rights reserved.