Package net.spy.memcached.protocol
Class ProxyCallback
- java.lang.Object
-
- net.spy.memcached.protocol.ProxyCallback
-
- All Implemented Interfaces:
GetOperation.Callback,OperationCallback
public class ProxyCallback extends java.lang.Object implements GetOperation.Callback
Proxy callback used for dispatching callbacks over optimized gets.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<GetOperation.Callback>allCallbacksprivate java.util.Map<java.lang.String,java.util.Collection<GetOperation.Callback>>callbacks
-
Constructor Summary
Constructors Constructor Description ProxyCallback()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCallbacks(GetOperation o)voidcomplete()Called whenever an operation completes.voidgotData(java.lang.String key, int flags, byte[] data)Callback for each result from a get.intnumCallbacks()intnumKeys()voidreceivedStatus(OperationStatus status)Method invoked with the status when the operation is complete.
-
-
-
Field Detail
-
callbacks
private final java.util.Map<java.lang.String,java.util.Collection<GetOperation.Callback>> callbacks
-
allCallbacks
private final java.util.Collection<GetOperation.Callback> allCallbacks
-
-
Method Detail
-
addCallbacks
public void addCallbacks(GetOperation o)
-
gotData
public void gotData(java.lang.String key, int flags, byte[] data)Description copied from interface:GetOperation.CallbackCallback for each result from a get.- Specified by:
gotDatain interfaceGetOperation.Callback- Parameters:
key- the key that was retrievedflags- the flags for this valuedata- the data stored under this key
-
receivedStatus
public void receivedStatus(OperationStatus status)
Description copied from interface:OperationCallbackMethod invoked with the status when the operation is complete.- Specified by:
receivedStatusin interfaceOperationCallback- Parameters:
status- the result of the operation
-
complete
public void complete()
Description copied from interface:OperationCallbackCalled whenever an operation completes.- Specified by:
completein interfaceOperationCallback
-
numKeys
public int numKeys()
-
numCallbacks
public int numCallbacks()
-
-