Package com.avanza.astrix.test
Interface AstrixRuleContext
-
public interface AstrixRuleContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> voidregisterProxy(Class<T> service)Registers a proxy for a given service in the service registry.<T> voidregisterProxy(Class<T> service, String qualifier)Registers a proxy for a given service in the service registry.<T> voidset(com.avanza.astrix.config.Setting<T> setting, T value)
-
-
-
Method Detail
-
set
<T> void set(com.avanza.astrix.config.Setting<T> setting, T value)
-
registerProxy
<T> void registerProxy(Class<T> service)
Registers a proxy for a given service in the service registry. The benefit of registering a proxy is that all consumers of the service will be able to bind to the proxy on the first service discovery attempt. The state of the proxy can later be changed by callingAstrixRule#setProxyState(Class, Object), after which all consumers immediately sees the new state of the service. No waiting for new service-discovery attempts by the consumers of the service i necessary. In the initial state the proxy always throwsServiceUnavailableExceptionon each invocation, i.e it behaves in the same way as if there where no provider available for the given service.- Parameters:
service- - The (unqualified) bean type to register a proxy for
-
registerProxy
<T> void registerProxy(Class<T> service, String qualifier)
Registers a proxy for a given service in the service registry. The benefit of registering a proxy is that all consumers of the service will be able to bind to the proxy on the first service discovery attempt. The state of the proxy can later be changed by callingAstrixRule#setProxyState(Class, Object), after which all consumers immediately sees the new state of the service. No waiting for new service-discovery attempts by the consumers of the service i necessary. In the initial state the proxy always throwsServiceUnavailableExceptionon each invocation, i.e it behaves in the same way as if there where no provider available for the given service.- Parameters:
service- - The qualified bean type to register a proxy forqualifier- - The qualifier of the bean type to register a proxy for
-
-