Package org.refcodes.servicebus
Class ServiceLookupImpl<S extends Service<?>,SCTX>
- java.lang.Object
-
- org.refcodes.servicebus.ServiceLookupImpl<S,SCTX>
-
- Type Parameters:
S
- The type to be used for theService
.SCTX
- The type to be used for theService
's context.
- All Implemented Interfaces:
ServiceLookup<S,SCTX>
public class ServiceLookupImpl<S extends Service<?>,SCTX> extends java.lang.Object implements ServiceLookup<S,SCTX>
TheServiceLookupImpl
implements theServiceLookup
.
-
-
Constructor Summary
Constructors Constructor Description ServiceLookupImpl(org.refcodes.factory.CollectionFactory<java.util.Set<ServiceDescriptor<S,SCTX>>> aTypedTypeFactory)
Creates aServiceLookupImpl
for the required type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<ServiceDescriptor<S,SCTX>>
getServiceDescriptors()
Returns a collection containing theServiceDescriptor
instances known by theServiceLookup
.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.
-
-
-
Constructor Detail
-
ServiceLookupImpl
public ServiceLookupImpl(org.refcodes.factory.CollectionFactory<java.util.Set<ServiceDescriptor<S,SCTX>>> aTypedTypeFactory)
Creates aServiceLookupImpl
for the required type.- Parameters:
aTypedTypeFactory
- The factory to be used to lookup the given type's instances.
-
-
Method Detail
-
getServiceDescriptors
public java.util.Set<ServiceDescriptor<S,SCTX>> getServiceDescriptors()
Returns a collection containing theServiceDescriptor
instances known by theServiceLookup
.- Specified by:
getServiceDescriptors
in interfaceServiceLookup<S extends Service<?>,SCTX>
- Returns:
- A collection containing the
ServiceDescriptor
instances known by theServiceLookup
.
-
hasService
public 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. I.e. there must not be the same service twice on the service bus which can not be distinguished by its type and its Meta-Data (i.e. a matcher must be able to distinguish two services from each other).- Specified by:
hasService
in interfaceServiceLookup<S extends Service<?>,SCTX>
- Parameters:
aServiceDescriptor
- the service descriptor- Returns:
- True in case the given service is known by the service bus.
-
-