本文整理匯總了Java中org.jboss.netty.handler.execution.ExecutionHandler類的典型用法代碼示例。如果您正苦於以下問題:Java ExecutionHandler類的具體用法?Java ExecutionHandler怎麽用?Java ExecutionHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExecutionHandler類屬於org.jboss.netty.handler.execution包,在下文中一共展示了ExecutionHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
OFChannelHandler handler = new OFChannelHandler(controller);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("ofmessagedecoder", new OFMessageDecoder());
pipeline.addLast("ofmessageencoder", new OFMessageEncoder());
pipeline.addLast("idle", idleHandler);
pipeline.addLast("timeout", readTimeoutHandler);
pipeline.addLast("handshaketimeout",
new HandshakeTimeoutHandler(handler, timer, 15));
if (pipelineExecutor != null)
pipeline.addLast("pipelineExecutor",
new ExecutionHandler(pipelineExecutor));
pipeline.addLast("handler", handler);
return pipeline;
}
示例2: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception
{
// Create a default pipeline implementation.
ChannelPipeline pipeline = pipeline();
// Add the text line codec combination first,
pipeline.addLast("framer", new DelimiterBasedFrameDecoder(3000000,
ChannelBuffers.wrappedBuffer(new byte[] {'E','O','F'})));
//pipeline.addLast("framer", new DelimiterBasedFrameDecoder(Integer.MAX_VALUE,
// Delimiters.lineDelimiter()));
//pipeline.addLast("eofFramer", new TextProtocolFrameDecoder());
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
// Insert OrderedMemoryAwareThreadPoolExecutor before your blocking handler
pipeline.addLast("pipelineExecutor", new ExecutionHandler(this.eventExecutor));
// and then business logic.
pipeline.addLast("handler", new TextProtocolHandler());
return pipeline;
}
示例3: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
OFChannelHandler handler = new OFChannelHandler(controller);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("ofmessagedecoder", new OFMessageDecoder());
pipeline.addLast("ofmessageencoder", new OFMessageEncoder());
pipeline.addLast("idle", idleHandler);
pipeline.addLast("timeout", readTimeoutHandler);
// XXX S ONOS: was 15 increased it to fix Issue #296
pipeline.addLast("handshaketimeout",
new HandshakeTimeoutHandler(handler, timer, 60));
if (pipelineExecutor != null) {
pipeline.addLast("pipelineExecutor",
new ExecutionHandler(pipelineExecutor));
}
pipeline.addLast("handler", handler);
return pipeline;
}
示例4: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
OFChannelState state = new OFChannelState();
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("ofmessagedecoder", new OFMessageDecoder());
pipeline.addLast("ofmessageencoder", new OFMessageEncoder());
pipeline.addLast("idle", idleHandler);
pipeline.addLast("timeout", readTimeoutHandler);
pipeline.addLast("handshaketimeout",
new HandshakeTimeoutHandler(state, timer, 15));
if (pipelineExecutor != null)
pipeline.addLast("pipelineExecutor",
new ExecutionHandler(pipelineExecutor));
pipeline.addLast("handler", controller.getChannelHandler(state));
return pipeline;
}
開發者ID:vishalshubham,項目名稱:Multipath-Hedera-system-in-Floodlight-controller,代碼行數:18,代碼來源:OpenflowPipelineFactory.java
示例5: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
final ControllerChannelHandler handler = new ControllerChannelHandler(
this.ctrl, this.sw);
final ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("reconnect", new ReconnectHandler(this.sw,
this.bootstrap, this.timer, 15, this.cg));
pipeline.addLast("ofmessagedecoder", new OVXMessageDecoder());
pipeline.addLast("ofmessageencoder", new OVXMessageEncoder());
pipeline.addLast("idle", this.idleHandler);
pipeline.addLast("timeout", this.readTimeoutHandler);
pipeline.addLast("handshaketimeout", new HandshakeTimeoutHandler(
handler, this.timer, 15));
pipeline.addLast("pipelineExecutor", new ExecutionHandler(
this.pipelineExecutor));
pipeline.addLast("handler", handler);
return pipeline;
}
示例6: run
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
private void run()
{
// Configure the server.
executionHandler = new ExecutionHandler(new RequestThreadPoolExecutor());
factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
ServerBootstrap bootstrap = new ServerBootstrap(factory);
bootstrap.setOption("child.tcpNoDelay", true);
// Set up the event pipeline factory.
final EncryptionOptions.ClientEncryptionOptions clientEnc = DatabaseDescriptor.getClientEncryptionOptions();
if (clientEnc.enabled)
{
logger.info("Enabling encrypted CQL connections between client and server");
bootstrap.setPipelineFactory(new SecurePipelineFactory(this, clientEnc));
}
else
{
bootstrap.setPipelineFactory(new PipelineFactory(this));
}
// Bind and start to accept incoming connections.
logger.info("Starting listening for CQL clients on {}...", socket);
Channel channel = bootstrap.bind(socket);
connectionTracker.allChannels.add(channel);
}
示例7: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline ret = Channels.pipeline();
ret.addLast("executor", new ExecutionHandler(
new OrderedMemoryAwareThreadPoolExecutor(8, 1048576, 1048576)));
ret.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
ret.addLast("protobufDecoder",
new ProtobufDecoder(GameMsg.getDefaultInstance()));
ret.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
ret.addLast("protobufEncoder", new ProtobufEncoder());
// ret.addLast("heartbeat", new IdleStateAwareChannelHandler() {
// @Override
// public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e)
// throws Exception {
// logger.warn("close the channel hearbeat {} type={}",
// e.getChannel(), e.getState());
// e.getChannel().close();
// }
// });
ret.addLast("handler", pdlServerHandlerFactory.get());
return ret;
}
示例8: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
OFChannelHandler handler = new OFChannelHandler(controller);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("ofmessagedecoder", new OFMessageDecoder());
pipeline.addLast("ofmessageencoder", new OFMessageEncoder());
pipeline.addLast("idle", idleHandler);
pipeline.addLast("timeout", readTimeoutHandler);
pipeline.addLast("handshaketimeout",
new HandshakeTimeoutHandler(handler, timer, HANDSHAKE_TIMEOUT_SECS));
if (pipelineExecutor != null)
pipeline.addLast("pipelineExecutor",
new ExecutionHandler(pipelineExecutor));
pipeline.addLast("handler", handler);
return pipeline;
}
示例9: postConstruct
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@PostConstruct
private void postConstruct() {
nettyThreadFactory = new NettyThreadFactory();
executionHandler = new ExecutionHandler(
new OrderedMemoryAwareThreadPoolExecutor(
configurationService.getIntValue("netty.maxChannels"),
configurationService.getIntValue("netty.maxChannelMemory"),
configurationService.getIntValue("netty.maxTotalMemory"),
60 * 5,
TimeUnit.SECONDS,
this,
nettyThreadFactory));
i18nService.registerBundle(RESOURCE_BUNDLE);
}
示例10: PipelineFactory
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
public PipelineFactory(Map<String, ChannelHandler> handlers,
ChannelHandler encoder, ChannelHandler decoder, int numThreads) {
this.handlers = handlers;
this.encoder = encoder;
this.decoder = decoder;
if (numThreads != 0) {
ThreadPoolExecutor executorThreadPool = new ThreadPoolExecutor(
NettyServer.cpus, NettyServer.cpus * 4, 60,
TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(),
new DescriptiveThreadFactory("Executor-Thread"));
this.executionHandler = new ExecutionHandler(executorThreadPool);
} else {
this.executionHandler = null;
}
}
示例11: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
@Override
public ChannelPipeline getPipeline() throws Exception {
OFChannelHandler handler = new OFChannelHandler(controller);
ChannelPipeline pipeline = Channels.pipeline();
if (sslContext != null) {
log.debug("OpenFlow SSL enabled.");
SSLEngine sslEngine = sslContext.createSSLEngine();
sslEngine.setNeedClientAuth(true);
sslEngine.setUseClientMode(false);
sslEngine.setEnabledProtocols(sslEngine.getSupportedProtocols());
sslEngine.setEnabledCipherSuites(sslEngine.getSupportedCipherSuites());
sslEngine.setEnableSessionCreation(true);
SslHandler sslHandler = new SslHandler(sslEngine);
pipeline.addLast("ssl", sslHandler);
} else {
log.debug("OpenFlow SSL disabled.");
}
pipeline.addLast("ofmessagedecoder", new OFMessageDecoder());
pipeline.addLast("ofmessageencoder", new OFMessageEncoder());
pipeline.addLast("idle", idleHandler);
pipeline.addLast("timeout", readTimeoutHandler);
// XXX S ONOS: was 15 increased it to fix Issue #296
pipeline.addLast("handshaketimeout",
new HandshakeTimeoutHandler(handler, timer, 60));
if (pipelineExecutor != null) {
pipeline.addLast("pipelineExecutor",
new ExecutionHandler(pipelineExecutor));
}
pipeline.addLast("handler", handler);
return pipeline;
}
示例12: AirPlayServer
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
private AirPlayServer(){
//create executor service
executorService = Executors.newCachedThreadPool();
//create channel execution handler
channelExecutionHandler = new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(4, 0, 0));
//channel group
channelGroup = new DefaultChannelGroup();
//list of mDNS services
jmDNSInstances = new java.util.LinkedList<JmDNS>();
}
示例13: run
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
private void run()
{
// Check that a SaslAuthenticator can be provided by the configured
// IAuthenticator. If not, don't start the server.
IAuthenticator authenticator = DatabaseDescriptor.getAuthenticator();
if (authenticator.requireAuthentication() && !(authenticator instanceof ISaslAwareAuthenticator))
{
logger.error("Not starting native transport as the configured IAuthenticator is not capable of SASL authentication");
isRunning.compareAndSet(true, false);
return;
}
// Configure the server.
executionHandler = new ExecutionHandler(new RequestThreadPoolExecutor());
factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
ServerBootstrap bootstrap = new ServerBootstrap(factory);
bootstrap.setOption("child.tcpNoDelay", true);
// Set up the event pipeline factory.
final EncryptionOptions.ClientEncryptionOptions clientEnc = DatabaseDescriptor.getClientEncryptionOptions();
if (clientEnc.enabled)
{
logger.info("Enabling encrypted CQL connections between client and server");
bootstrap.setPipelineFactory(new SecurePipelineFactory(this, clientEnc));
}
else
{
bootstrap.setPipelineFactory(new PipelineFactory(this));
}
// Bind and start to accept incoming connections.
logger.info("Starting listening for CQL clients on {}...", socket);
Channel channel = bootstrap.bind(socket);
connectionTracker.allChannels.add(channel);
}
示例14: getPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
public ChannelPipeline getPipeline() throws Exception
{
ChannelPipeline channelpipeline = Channels.pipeline();
channelpipeline.addLast("pipelineExecutor", new ExecutionHandler(orderedmemoryawarethreadpoolexecutor));
channelpipeline.addLast("handler", new RtmfpChannelUpstreamHandler(sessions));
return channelpipeline;
}
示例15: SwitchChannelPipeline
import org.jboss.netty.handler.execution.ExecutionHandler; //導入依賴的package包/類
public SwitchChannelPipeline(
final OpenVirteXController openVirteXController,
final ThreadPoolExecutor pipelineExecutor) {
super();
this.ctrl = openVirteXController;
this.pipelineExecutor = pipelineExecutor;
this.timer = PhysicalNetwork.getTimer();
this.idleHandler = new IdleStateHandler(this.timer, 20, 25, 0);
this.readTimeoutHandler = new ReadTimeoutHandler(this.timer, 30);
this.eh = new ExecutionHandler(this.pipelineExecutor);
}