本文整理匯總了Java中org.apache.zookeeper.AsyncCallback.VoidCallback方法的典型用法代碼示例。如果您正苦於以下問題:Java AsyncCallback.VoidCallback方法的具體用法?Java AsyncCallback.VoidCallback怎麽用?Java AsyncCallback.VoidCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.zookeeper.AsyncCallback
的用法示例。
在下文中一共展示了AsyncCallback.VoidCallback方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: MultiCallback
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
MultiCallback(int expected, AsyncCallback.VoidCallback cb, Object context) {
this.expected = expected;
this.cb = cb;
this.context = context;
if (expected == 0) {
cb.processResult(Code.OK.intValue(), null, context);
}
}
示例2: performBackgroundOperation
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void performBackgroundOperation(final OperationAndData<String> operationAndData)
throws Exception
{
try
{
final TimeTrace trace = client.getZookeeperClient().startTracer("RemoteWatches-Background");
AsyncCallback.VoidCallback callback = new AsyncCallback.VoidCallback()
{
@Override
public void processResult(int rc, String path, Object ctx)
{
trace.commit();
CuratorEvent event = new CuratorEventImpl(client, CuratorEventType.REMOVE_WATCHES, rc, path, null, ctx, null, null, null, null, null, null);
client.processBackgroundOperation(operationAndData, event);
}
};
ZooKeeper zkClient = client.getZooKeeper();
NamespaceWatcher namespaceWatcher = makeNamespaceWatcher(operationAndData.getData());
if(namespaceWatcher == null)
{
zkClient.removeAllWatches(operationAndData.getData(), watcherType, local, callback, operationAndData.getContext());
}
else
{
zkClient.removeWatches(operationAndData.getData(), namespaceWatcher, watcherType, local, callback, operationAndData.getContext());
}
}
catch ( Throwable e )
{
backgrounding.checkError(e, null);
}
}
示例3: sync
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
public void sync(String path, AsyncCallback.VoidCallback cb, Object ctx) throws KeeperException {
checkZk().sync(path, null, null);
}
示例4: sync
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
public void sync(String path, AsyncCallback.VoidCallback cb, Object ctx) {
this.zk.sync(path, null, null);
}
示例5: sync
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
public void sync(String path, AsyncCallback.VoidCallback cb, Object ctx) throws KeeperException {
long startTime = EnvironmentEdgeManager.currentTime();
checkZk().sync(path, cb, null);
}
示例6: delete
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void delete(String path, int version, AsyncCallback.VoidCallback cb, Object ctx) {
delegate.delete(path, version, cb, ctx);
}
示例7: sync
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void sync(String path, AsyncCallback.VoidCallback cb, Object ctx) {
delegate.sync(path, cb, ctx);
}
示例8: delete
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
void delete(String path, int version, AsyncCallback.VoidCallback cb, Object ctx);
示例9: sync
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
void sync(String path, AsyncCallback.VoidCallback cb, Object ctx);