本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
}
示例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);
}
示例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();
}
};
}
示例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);
}
};
}
示例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;
}
示例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);
}
}
示例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);
}
示例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();
}
};
}
示例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);
}
};
}
示例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);
}
示例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);
}