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 boolean
hasService(ServiceMatcher<S> aServiceMatcher)
Determines whether the givenServiceMatcher
will result in a singleService
to be looked up.S
lookupService(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
- TheServiceMatcher
describing the service for which to look for.- Returns:
- The desired
ServiceConfigurationError
. - Throws:
UnknownServiceRuntimeException
- in case noService
matched.AmbiguousServiceRuntimeException
- in case more than oneService
matched theServiceMatcher
.
-
hasService
boolean hasService(ServiceMatcher<S> aServiceMatcher)
Determines whether the givenServiceMatcher
will result in a singleService
to be looked up. I.e. theServiceMatcher
must result in an unambiguousService
to be identified.- Parameters:
aServiceMatcher
- TheServiceMatcher
describing theService
for which to look for.- Returns:
- True in case if exactly one
Service
is matching the matcher. Else false is returned (either more than one service was identified or none service was identified).
-
-