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>
TheServiceLookupImplimplements theServiceLookup.
-
-
Constructor Summary
Constructors Constructor Description ServiceLookupImpl(org.refcodes.factory.CollectionFactory<java.util.Set<ServiceDescriptor<S,SCTX>>> aTypedTypeFactory)Creates aServiceLookupImplfor 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 theServiceDescriptorinstances known by theServiceLookup.booleanhasService(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 aServiceLookupImplfor 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 theServiceDescriptorinstances known by theServiceLookup.- Specified by:
getServiceDescriptorsin interfaceServiceLookup<S extends Service<?>,SCTX>- Returns:
- A collection containing the
ServiceDescriptorinstances 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:
hasServicein interfaceServiceLookup<S extends Service<?>,SCTX>- Parameters:
aServiceDescriptor- the service descriptor- Returns:
- True in case the given service is known by the service bus.
-
-