Interface BaseMemcacheService (2.0.0)

public interface BaseMemcacheService

Methods that are common between MemcacheService and AsyncMemcacheService.

Methods

getErrorHandler()

public abstract ErrorHandler getErrorHandler()

Fetches the current error handler.

See #setErrorHandler(ErrorHandler).

Returns
Type Description
ErrorHandler

getNamespace()

public abstract String getNamespace()

Method returns non-null value if the MemcacheService overrides the default namespace in API calls. Default namespace is the one returned by com.google.appengine.api.NamespaceManager#get().

Returns
Type Description
String

null if the MemcacheService uses default namespace in API calls. Otherwise it returns namespace which is overrides default namespace on the API calls.

setErrorHandler(ErrorHandler handler)

public abstract void setErrorHandler(ErrorHandler handler)

Registers a new ErrorHandler. The handler is 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 the handler but 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 is StrictErrorHandler, which will throw a MemcacheServiceException to surface errors to callers.

To guarantee that all instances of MemcacheServiceException are directed to the error handler, use a ConsistentErrorHandler such as ErrorHandlers#getConsistentLogAndContinue(Level) or ErrorHandlers#getStrict().

Parameter
Name Description
handler ErrorHandler

the new ErrorHandler to use