Module org.refcodes.servicebus
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 Object
implements ServiceLookup<S,SCTX>
The
ServiceLookupImpl
implements the ServiceLookup
.-
Constructor Summary
ConstructorDescriptionServiceLookupImpl
(org.refcodes.factory.CollectionFactory<Set<ServiceDescriptor<S, SCTX>>> aTypedTypeFactory) Creates aServiceLookupImpl
for the required type. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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 Details
-
ServiceLookupImpl
public ServiceLookupImpl(org.refcodes.factory.CollectionFactory<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 Details
-
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
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.
-