Package org.refcodes.servicebus
Interface ServiceBus<S extends Service<?>>
-
- Type Parameters:
S- the generic type
- All Known Implementing Classes:
ServiceBusImpl
public interface ServiceBus<S extends Service<?>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhasService(ServiceMatcher<S> aServiceMatcher)Determines whether the givenServiceMatcherwill result in a singleServiceto be looked up.SlookupService(ServiceMatcher<S> aServiceMatcher)Looks for a service matching the given service descriptor and returns it if found.
-
-
-
Method Detail
-
lookupService
S lookupService(ServiceMatcher<S> aServiceMatcher) throws UnknownServiceRuntimeException, AmbiguousServiceRuntimeException
Looks for a service matching the given service descriptor and returns it if found.- Parameters:
aServiceMatcher- TheServiceMatcherdescribing the service for which to look for.- Returns:
- The desired
ServiceConfigurationError. - Throws:
UnknownServiceRuntimeException- in case noServicematched.AmbiguousServiceRuntimeException- in case more than oneServicematched theServiceMatcher.
-
hasService
boolean hasService(ServiceMatcher<S> aServiceMatcher)
Determines whether the givenServiceMatcherwill result in a singleServiceto be looked up. I.e. theServiceMatchermust result in an unambiguousServiceto be identified.- Parameters:
aServiceMatcher- TheServiceMatcherdescribing theServicefor which to look for.- Returns:
- True in case if exactly one
Serviceis matching the matcher. Else false is returned (either more than one service was identified or none service was identified).
-
-