public class ServiceFacade<D extends SharedStoreSetter> extends Object implements SharedStoreSetter
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceFacade.FacadeOperation |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_PREFIX |
static long |
DEFAULT_TIMEOUT_MS |
protected D |
legacySvc |
protected D |
lightblueSvc |
| Constructor and Description |
|---|
ServiceFacade(D legacySvc,
D lightblueSvc,
String implementationName) |
ServiceFacade(D legacySvc,
D lightblueSvc,
String implementationName,
Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
callSvcMethod(ServiceFacade.FacadeOperation facadeOperation,
boolean callInParallel,
Method methodCalled,
Object... values)
Call service method according to settings specified in togglz.
|
ConsistencyChecker |
getConsistencyChecker() |
D |
getLegacySvc() |
D |
getLightblueSvc() |
SharedStore |
getSharedStore() |
TimeoutConfiguration |
getTimeoutConfiguration() |
void |
setConsistencyChecker(ConsistencyChecker consistencyChecker) |
void |
setLogResponseDataEnabled(boolean logResponsesEnabled) |
void |
setMaxInconsistencyLogLength(int length) |
void |
setSharedStore(SharedStore shareStore) |
void |
setTimeoutConfiguration(TimeoutConfiguration timeoutConfiguration) |
static void |
shutdown()
Shutdown thread pool executor for all facades.
|
protected final D extends SharedStoreSetter legacySvc
protected final D extends SharedStoreSetter lightblueSvc
public static final String CONFIG_PREFIX
public static final long DEFAULT_TIMEOUT_MS
public ServiceFacade(D legacySvc, D lightblueSvc, String implementationName, Properties properties)
public SharedStore getSharedStore()
public void setSharedStore(SharedStore shareStore)
setSharedStore in interface SharedStoreSetterpublic ConsistencyChecker getConsistencyChecker()
public void setConsistencyChecker(ConsistencyChecker consistencyChecker)
public <T> T callSvcMethod(ServiceFacade.FacadeOperation facadeOperation, boolean callInParallel, Method methodCalled, Object... values) throws Throwable
facadeOperation - READ/WRITE operation, used by togglz flagscallInParallel - true means both oracle and lightblue will be called
in parallel and state sharing between services will not be possiblereturnedType - type of the returned objectmethodName - method name to calltypes - List of parameter typesvalues - List of parametersExceptionThrowablepublic void setLogResponseDataEnabled(boolean logResponsesEnabled)
public void setMaxInconsistencyLogLength(int length)
public D getLegacySvc()
public D getLightblueSvc()
public TimeoutConfiguration getTimeoutConfiguration()
public void setTimeoutConfiguration(TimeoutConfiguration timeoutConfiguration)
public static void shutdown()
Copyright © 2016. All rights reserved.