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>
allCallbacks
private 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 void
addCallbacks(GetOperation o)
void
complete()
Called whenever an operation completes.void
gotData(java.lang.String key, int flags, byte[] data)
Callback for each result from a get.int
numCallbacks()
int
numKeys()
void
receivedStatus(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.Callback
Callback for each result from a get.- Specified by:
gotData
in 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:OperationCallback
Method invoked with the status when the operation is complete.- Specified by:
receivedStatus
in interfaceOperationCallback
- Parameters:
status
- the result of the operation
-
complete
public void complete()
Description copied from interface:OperationCallback
Called whenever an operation completes.- Specified by:
complete
in interfaceOperationCallback
-
numKeys
public int numKeys()
-
numCallbacks
public int numCallbacks()
-
-