Interface BaseMemcacheService
-
- All Known Subinterfaces:
AsyncMemcacheService,MemcacheService
public interface BaseMemcacheServiceMethods that are common betweenMemcacheServiceandAsyncMemcacheService.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ErrorHandlergetErrorHandler()Fetches the current error handler.StringgetNamespace()Method returns non-null value if the MemcacheService overrides the default namespace in API calls.voidsetErrorHandler(ErrorHandler handler)Registers a newErrorHandler.
-
-
-
Method Detail
-
getNamespace
String getNamespace()
Method returns non-null value if the MemcacheService overrides the default namespace in API calls. Default namespace is the one returned byNamespaceManager.get().- Returns:
nullif the MemcacheService uses default namespace in API calls. Otherwise it returnsnamespacewhich is overrides default namespace on the API calls.
-
getErrorHandler
ErrorHandler getErrorHandler()
Fetches the current error handler. SeesetErrorHandler(ErrorHandler).
-
setErrorHandler
void setErrorHandler(ErrorHandler handler)
Registers a newErrorHandler. Thehandleris called for errors which are not the application's fault, like a network timeout. The handler can choose to propagate the error or suppress it. Errors which are caused by an incorrect use of the API will not be directed to thehandlerbut rather will be thrown directly.The default error handler is an instance of
LogAndContinueErrorHandler. In most cases, this will log exceptions without throwing, which looks like a cache-miss behavior to the caller. A less permissive alternative isStrictErrorHandler, which will throw aMemcacheServiceExceptionto surface errors to callers.To guarantee that all instances of
MemcacheServiceExceptionare directed to the error handler, use aConsistentErrorHandlersuch asErrorHandlers.getConsistentLogAndContinue(Level)orErrorHandlers.getStrict().- Parameters:
handler- the newErrorHandlerto use
-
-