本文整理匯總了Java中org.apache.zookeeper.AsyncCallback.StatCallback方法的典型用法代碼示例。如果您正苦於以下問題:Java AsyncCallback.StatCallback方法的具體用法?Java AsyncCallback.StatCallback怎麽用?Java AsyncCallback.StatCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.zookeeper.AsyncCallback
的用法示例。
在下文中一共展示了AsyncCallback.StatCallback方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: performBackgroundOperation
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void performBackgroundOperation(final OperationAndData<String> operationAndData) throws Exception
{
try
{
final OperationTrace trace = client.getZookeeperClient().startAdvancedTracer("ExistsBuilderImpl-Background");
AsyncCallback.StatCallback callback = new AsyncCallback.StatCallback()
{
@Override
public void processResult(int rc, String path, Object ctx, Stat stat)
{
watching.commitWatcher(rc, true);
trace.setReturnCode(rc).setPath(path).setWithWatcher(watching.hasWatcher()).setStat(stat).commit();
CuratorEvent event = new CuratorEventImpl(client, CuratorEventType.EXISTS, rc, path, null, ctx, stat, null, null, null, null, null);
client.processBackgroundOperation(operationAndData, event);
}
};
if ( watching.isWatched() )
{
client.getZooKeeper().exists(operationAndData.getData(), true, callback, backgrounding.getContext());
}
else
{
client.getZooKeeper().exists(operationAndData.getData(), watching.getWatcher(operationAndData.getData()), callback, backgrounding.getContext());
}
}
catch ( Throwable e )
{
backgrounding.checkError(e, watching);
}
}
示例2: exists
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void exists(String path, Watcher watcher, AsyncCallback.StatCallback cb, Object ctx) {
delegate.exists(path, watcher, cb, ctx);
}
示例3: setData
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void setData(String path, byte[] data, int version, AsyncCallback.StatCallback cb, Object ctx) {
delegate.setData(path, data, version, cb, ctx);
}
示例4: setACL
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
@Override
public void setACL(String path, List<ACL> acl, int version, AsyncCallback.StatCallback cb, Object ctx) {
delegate.setACL(path, acl, version, cb, ctx);
}
示例5: exists
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
void exists(String path, Watcher watcher, AsyncCallback.StatCallback cb, Object ctx);
示例6: setData
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
void setData(String path, byte[] data, int version, AsyncCallback.StatCallback cb, Object ctx);
示例7: setACL
import org.apache.zookeeper.AsyncCallback; //導入方法依賴的package包/類
void setACL(String path, List<ACL> acl, int version, AsyncCallback.StatCallback cb, Object ctx);