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


Java ProtocolCodec类代码示例

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


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

示例1: create

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public static <I extends Operation.Request, O, T extends CodecConnection<? super I, ? extends O,? extends ProtocolCodec<?,?,?,?>,?>> ClientPingTask<I,O,T> create(
        T connection,
        TimeOutParameters parameters,
        ScheduledExecutorService executor) {
    Logger logger = LogManager.getLogger(ClientPingTask.class);
    ClientPingTask<I,O,T> task = new ClientPingTask<I,O,T>(
            connection,
            parameters, 
            executor,
            Sets.<Pair<Runnable,Executor>>newHashSet(),
            SettableFuturePromise.<Void>create(),
            logger);
    LoggingFutureListener.listen(logger, task);
    // TODO: replay connection events?
    return task;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:17,代码来源:PingingClient.java

示例2: getDefaultClientBuilder

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
@Override
protected ClientBuilder getDefaultClientBuilder() {
    ClientBuilder builder = getClientBuilder();
    if (builder.getConnectionBuilder() == null) {
        builder = builder.setConnectionBuilder(
                ClientConnectionFactoryBuilder.defaults()
                    .setClientModule(getNetModule().clients())
                    .setCodecFactory(
                            new Factory<ProtocolTracingCodec>() {
                                @Override
                                public ProtocolTracingCodec get() {
                                    // TODO Auto-generated method stub
                                    return ProtocolTracingCodec.defaults(getTracingBuilder().getTracePublisher().getPublisher());
                                }
                            })
                    .setConnectionFactory(
                            new ParameterizedFactory<CodecConnection<Message.ClientSession, Message.ServerSession, ProtocolCodec<Message.ClientSession,Message.ServerSession,Message.ClientSession,Message.ServerSession>,?>, ClientProtocolConnection<Message.ClientSession, Message.ServerSession,?,?>>() {
                                @Override
                                public ClientProtocolConnection<Message.ClientSession, Message.ServerSession,?,?> get(CodecConnection<Message.ClientSession, Message.ServerSession, ProtocolCodec<Message.ClientSession,Message.ServerSession,Message.ClientSession,Message.ServerSession>,?> value) {
                                    return ClientProtocolConnection.newInstance(value);
                                }
                            }));
    }
    return builder.setDefaults();
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-proxy,代码行数:26,代码来源:TracingProxyServerBuilder.java

示例3: getDefaultClientBuilder

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected ClientBuilder getDefaultClientBuilder() {
    ClientBuilder builder = getClientBuilder();
    if (builder.getConnectionBuilder() == null) {
        builder = builder.setConnectionBuilder(
                ClientConnectionFactoryBuilder.defaults()
                    .setClientModule(getNetModule().clients())
                    .setConnectionFactory(
                            new ParameterizedFactory<CodecConnection<Message.ClientSession, Message.ServerSession, ProtocolCodec<Message.ClientSession,Message.ServerSession,Message.ClientSession,Message.ServerSession>,?>, ClientProtocolConnection<Message.ClientSession, Message.ServerSession,?,?>>() {
                                @Override
                                public ClientProtocolConnection<Message.ClientSession, Message.ServerSession,?,?> get(CodecConnection<Message.ClientSession, Message.ServerSession, ProtocolCodec<Message.ClientSession,Message.ServerSession,Message.ClientSession,Message.ServerSession>,?> value) {
                                    return ClientProtocolConnection.newInstance(value);
                                }
                            }));
    }
    return builder.setDefaults();
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-proxy,代码行数:17,代码来源:ProxyServerExecutorBuilder.java

示例4: ServerConnectionFactoryBuilder

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public ServerConnectionFactoryBuilder(
        RuntimeModule runtime,
        NetServerModule serverModule,
        Factory<? extends ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>> codecFactory,
        ParameterizedFactory<CodecConnection<Message.Server,Message.Client,ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>,?>, ? extends ServerProtocolConnection<?,?>> connectionFactory,
        ServerInetAddressView address) {
    this.runtime = runtime;
    this.serverModule = serverModule;
    this.codecFactory = codecFactory;
    this.connectionFactory = connectionFactory;
    this.address = address;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:13,代码来源:ServerConnectionFactoryBuilder.java

示例5: setCodecFactory

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public ServerConnectionFactoryBuilder setCodecFactory(
        Factory<? extends ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>> codecFactory) {
    if (this.codecFactory == codecFactory) {
        return this;
    } else {
    return newInstance(runtime, serverModule, codecFactory, connectionFactory, address);
    }
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:9,代码来源:ServerConnectionFactoryBuilder.java

示例6: newInstance

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected ServerConnectionFactoryBuilder newInstance(
        RuntimeModule runtime,
        NetServerModule serverModule,
        Factory<? extends ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>> codecFactory,
        ParameterizedFactory<CodecConnection<Message.Server,Message.Client,ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>,?>, ? extends ServerProtocolConnection<?,?>> connectionFactory,
        ServerInetAddressView address) {
    return new ServerConnectionFactoryBuilder(runtime, serverModule, codecFactory, connectionFactory, address);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:9,代码来源:ServerConnectionFactoryBuilder.java

示例7: getDefaultCodecFactory

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected Factory<? extends ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>> getDefaultCodecFactory() {
    return new Factory<ServerProtocolCodec>() {
        @Override
        public ServerProtocolCodec get() {
            return ServerProtocolCodec.defaults();
        }
    };
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:9,代码来源:ServerConnectionFactoryBuilder.java

示例8: getDefaultConnectionFactory

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected ParameterizedFactory<CodecConnection<Message.Server,Message.Client,ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>,?>, ? extends ServerProtocolConnection<?,?>> getDefaultConnectionFactory() {
    return new ParameterizedFactory<CodecConnection<Message.Server,Message.Client,ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>,?>, ServerProtocolConnection<?,?>>() {
        @Override
        public ServerProtocolConnection<?,?> get(
                CodecConnection<Message.Server, Message.Client, ProtocolCodec<Message.Server, Message.Client, Message.Server, Message.Client>, ?> value) {
            return ServerProtocolConnection.newInstance(value);
        }
    };
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:10,代码来源:ServerConnectionFactoryBuilder.java

示例9: ClientConnectionFactoryBuilder

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public ClientConnectionFactoryBuilder(
        RuntimeModule runtime,
        NetClientModule clientModule,
        TimeValue timeOut,
        Factory<? extends ProtocolCodec<Message.ClientSession, Message.ServerSession, Message.ClientSession, Message.ServerSession>> codecFactory,
        ParameterizedFactory<CodecConnection<Message.ClientSession, Message.ServerSession, ProtocolCodec<Message.ClientSession,Message.ServerSession, Message.ClientSession, Message.ServerSession>,?>, ? extends ClientProtocolConnection<Message.ClientSession, Message.ServerSession,?,?>> connectionFactory) {
    super();
    this.runtime = runtime;
    this.clientModule = clientModule;
    this.timeOut = timeOut;
    this.codecFactory = codecFactory;
    this.connectionFactory = connectionFactory;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:14,代码来源:ClientConnectionFactoryBuilder.java

示例10: setCodecFactory

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public ClientConnectionFactoryBuilder setCodecFactory(
        Factory<? extends ProtocolCodec<Message.ClientSession, Message.ServerSession, Message.ClientSession, Message.ServerSession>> codecFactory) {
    if (this.codecFactory == codecFactory) {
        return this;
    } else {
        return newInstance(runtime, clientModule, timeOut, codecFactory, connectionFactory);
    }
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:9,代码来源:ClientConnectionFactoryBuilder.java

示例11: newInstance

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected ClientConnectionFactoryBuilder newInstance(
        RuntimeModule runtime,
        NetClientModule clientModule,
        TimeValue timeOut,
        Factory<? extends ProtocolCodec<Message.ClientSession, Message.ServerSession, Message.ClientSession, Message.ServerSession>> codecFactory,
        ParameterizedFactory<CodecConnection<Message.ClientSession, Message.ServerSession, ProtocolCodec<Message.ClientSession,Message.ServerSession, Message.ClientSession, Message.ServerSession>,?>, ? extends ClientProtocolConnection<Message.ClientSession, Message.ServerSession,?,?>> connectionFactory) {
    return new ClientConnectionFactoryBuilder(runtime, clientModule, timeOut, codecFactory, connectionFactory);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:9,代码来源:ClientConnectionFactoryBuilder.java

示例12: getDefaultCodecFactory

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected Factory<? extends ProtocolCodec<Message.ClientSession, Message.ServerSession, Message.ClientSession, Message.ServerSession>> getDefaultCodecFactory() {
    return new Factory<ClientProtocolCodec>(){
        @Override
        public ClientProtocolCodec get() {
            return ClientProtocolCodec.defaults();
        }
    };
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:9,代码来源:ClientConnectionFactoryBuilder.java

示例13: factory

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public static <I extends Operation.Request, O, V extends ProtocolCodec<?,?,?,?>, T extends CodecConnection<? super I, ? extends O, V, ?>> ParameterizedFactory<T, PingingClient<I,O,V,T>> factory(
            final TimeValue defaultTimeOut,
            final ScheduledExecutorService executor) {
    return new ParameterizedFactory<T, PingingClient<I,O,V,T>>() {
                @Override
                public PingingClient<I,O,V,T> get(T value) {
                    return PingingClient.<I,O,V,T>newInstance(
                            TimeOutParameters.milliseconds(defaultTimeOut.value(TimeUnit.MILLISECONDS)),
                            executor,
                            value);
                }
            };
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-lite,代码行数:14,代码来源:PingingClient.java

示例14: newInstance

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
public static OperationTracingCodec newInstance(
        PubSubSupport<? super TraceEvent> publisher,
        ProtocolCodec<Message.ClientSession, Message.ServerSession, Message.ClientSession, Message.ServerSession> delegate) {
    return new OperationTracingCodec(
            publisher, 
            Queues.<RequestSentEvent>newConcurrentLinkedQueue(), 
            delegate);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:9,代码来源:OperationTracingCodec.java

示例15: OperationTracingCodec

import edu.uw.zookeeper.protocol.ProtocolCodec; //导入依赖的package包/类
protected OperationTracingCodec(
        PubSubSupport<? super TraceEvent> publisher, 
        Queue<RequestSentEvent> times,
        ProtocolCodec<Message.ClientSession, Message.ServerSession, Message.ClientSession, Message.ServerSession> delegate) {
    super();
    this.times = times;
    this.publisher = publisher;
    this.delegate = delegate;
    this.sessionId = Session.uninitialized().id();
    
    delegate.subscribe(this);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:13,代码来源:OperationTracingCodec.java


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