当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionObserver类代码示例

本文整理汇总了Java中net.spy.memcached.ConnectionObserver的典型用法代码示例。如果您正苦于以下问题:Java ConnectionObserver类的具体用法?Java ConnectionObserver怎么用?Java ConnectionObserver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConnectionObserver类属于net.spy.memcached包,在下文中一共展示了ConnectionObserver类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getObject

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
@Override
public Object getObject() throws IOException {
    List<URI> addresses = getAddresses(connectionURI);
    long timeout = Math.max(readTimeout, writeTimeout);
    //TODO make all the below properties configurable via properties file
    ConnectionFactoryBuilder builder = new CouchbaseConnectionFactoryBuilder()
            .setOpTimeout(timeout)                      // wait up to timeout seconds for an operation to succeed
            .setOpQueueMaxBlockTime(enqueueTimeout)     // wait up to 'enqueueTimeout' seconds when trying to enqueue an operation
            .setDaemon(true)
            .setProtocol(Protocol.BINARY)
            .setHashAlg(DefaultHashAlgorithm.KETAMA_HASH)
            .setFailureMode(FailureMode.Redistribute)
            .setInitialObservers(Collections.singleton((ConnectionObserver) new CouchbaseAlerter()));
    if(transcoder!=null) {
        builder.setTranscoder(transcoder);
    }

    //assuming there isn't any password set for Couchbase
    CouchbaseConnectionFactory connectionFactory
        = ((CouchbaseConnectionFactoryBuilder)builder).buildCouchbaseConnection(addresses, "default", "", "");

    return new CouchbaseClient(connectionFactory);
}
 
开发者ID:parekhparth,项目名称:SimpleJavaWS,代码行数:24,代码来源:CouchbaseFactory.java

示例2: setInitialObservers

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
public void setInitialObservers(final Collection<ConnectionObserver> obs) {
  connectionFactoryBuilder.setInitialObservers(obs);
}
 
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:4,代码来源:MemcachedClientFactoryBean.java

示例3: addObserver

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
@Override
   public boolean addObserver(ConnectionObserver obs) {
return false;
   }
 
开发者ID:forcedotcom,项目名称:3levelmemcache,代码行数:5,代码来源:EmptyMemcachedConnection.java

示例4: removeObserver

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
@Override
   public boolean removeObserver(ConnectionObserver obs) {
return false;
   }
 
开发者ID:forcedotcom,项目名称:3levelmemcache,代码行数:5,代码来源:EmptyMemcachedConnection.java

示例5: getInitialObservers

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
public Collection<ConnectionObserver> getInitialObservers() {
    return super.getInitialObservers();
}
 
开发者ID:Netflix,项目名称:EVCache,代码行数:4,代码来源:BaseConnectionFactory.java

示例6: addObserver

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
/**
 * TODO 添加方法注释.
 *
 * @param obs obs
 */
public void addObserver(ConnectionObserver obs) {
    memcachedClient.addObserver(obs);
}
 
开发者ID:NeilRen,项目名称:NEILREN4J,代码行数:9,代码来源:MemcachedManager.java

示例7: removeObserver

import net.spy.memcached.ConnectionObserver; //导入依赖的package包/类
/**
 * TODO 添加方法注释.
 *
 * @param obs obs
 */
public void removeObserver(ConnectionObserver obs) {
    memcachedClient.removeObserver(obs);
}
 
开发者ID:NeilRen,项目名称:NEILREN4J,代码行数:9,代码来源:MemcachedManager.java


注:本文中的net.spy.memcached.ConnectionObserver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。