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


Java DefaultIoFilterChainBuilder类代码示例

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

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

示例1: start

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * start Mina serversocket
 * @throws Exception
 */
public void start() throws Exception {
	IoBuffer.setUseDirectBuffer(false);
	IoBuffer.setAllocator(new SimpleBufferAllocator());

	acceptor = new NioSocketAcceptor(pool);
	acceptor.setReuseAddress(true);
	acceptor.getSessionConfig().setAll(getSessionConfig());

	int serverPort = GateServerConfig.serverPort;
	logger.info("socket server start at port:{},正在监听客户端的连接...", serverPort);
	DefaultIoFilterChainBuilder filterChain = acceptor.getFilterChain();
	filterChain.addLast("codec", new ProtocolCodecFilter(MessageCodecFactory.getInstance()));
	acceptor.setHandler( new ServerSocketIoHandler() );//指定业务逻辑处理器
	acceptor.setDefaultLocalAddress(new InetSocketAddress(serverPort) );//设置端口号
	acceptor.bind();//启动监听

}
 
开发者ID:kingston-csj,项目名称:jforgame,代码行数:22,代码来源:SocketServer.java


示例2: init

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public static IoFilterChainBuilder init( LdapServer server ) throws LdapException
{
    SSLContext sslCtx;
    try
    {
    	sslCtx = server.getSSLContext();
    	
    }
    catch ( Exception e )
    {
        throw new LdapException( I18n.err( I18n.ERR_683 ), e );
    }

    DefaultIoFilterChainBuilder chain = new DefaultIoFilterChainBuilder();
    SslFilter sslFilter = new SslFilter( sslCtx );

    List<String> cipherSuites = server.getEnabledCipherSuites();
    if( ( cipherSuites != null ) && !cipherSuites.isEmpty() )
    {
        sslFilter.setEnabledCipherSuites( cipherSuites.toArray( new String[cipherSuites.size()] ) );
    }
    
    sslFilter.setWantClientAuth( true );
    chain.addLast( "sslFilter", sslFilter );
    return chain;
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:27,代码来源:LdapsInitializer.java


示例3: init

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private void init(Config config) {
    connector = new NioDatagramConnector();
    connector.setHandler(new MinaClientHandler());
    DefaultIoFilterChainBuilder chain = connector.getFilterChain();
    if (connector.getFilterChain().get(LOGGER) == null) {
        chain.addLast(LOGGER, new LoggingFilter());
    }
    if (connector.getFilterChain().get(CODEC) == null) {
        ProtocolCodecFactory codecFactory = config.codec == null ?
                MinaUtil.getTextLineCodecFactory() : (ProtocolCodecFactory) config.codec;
        chain.addLast(CODEC, new ProtocolCodecFilter(codecFactory));
    }
    connector.getSessionConfig().setReadBufferSize(config.bufferSize);
    connector.getSessionConfig().setIdleTime(IdleStatus.WRITER_IDLE, 10);
    connector.getSessionConfig().setBroadcast(true);
    KeepAliveFilter keepAliveFilter = MinaUtil.initClientKeepAlive(config, this);
    if (keepAliveFilter != null) {
        connector.getFilterChain().addLast(HEARTBEAT, keepAliveFilter);
    }
}
 
开发者ID:EthanCo,项目名称:Halo-Turbo,代码行数:21,代码来源:MinaUdpClientSocket.java


示例4: init

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private void init(Config config) {
    address = new InetSocketAddress(config.sourcePort);

    acceptor = new NioDatagramAcceptor();
    acceptor.setHandler(new MinaServerHandler());
    DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
    if (acceptor.getFilterChain().get(LOGGER) == null) {
        chain.addLast(LOGGER, new LoggingFilter());
    }
    if (acceptor.getFilterChain().get(CODEC) == null) {
        ProtocolCodecFactory codecFactory = config.codec == null ?
                MinaUtil.getTextLineCodecFactory() : (ProtocolCodecFactory) config.codec;
        chain.addLast(CODEC, new ProtocolCodecFilter(codecFactory));
    }
    DatagramSessionConfig dcfg = acceptor.getSessionConfig();
    dcfg.setReuseAddress(true);
    dcfg.setReadBufferSize(config.bufferSize);
    dcfg.setIdleTime(IdleStatus.WRITER_IDLE, 10);
    dcfg.setBroadcast(true);

    KeepAliveFilter keepAliveFilter = MinaUtil.initServerKeepAlive(config, this);
    if (keepAliveFilter != null) {
        acceptor.getFilterChain().addLast(HEARTBEAT, keepAliveFilter);
    }
}
 
开发者ID:EthanCo,项目名称:Halo-Turbo,代码行数:26,代码来源:MinaUdpServerSocket.java


示例5: startServer

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * �������
 * @param args
 * @throws IOException 
 */
public  void startServer()  {
	 server = new NioSocketAcceptor();
	//�������ݹ�����
	DefaultIoFilterChainBuilder  filterChain = server.getFilterChain();
	filterChain.addLast("myChin", new ProtocolCodecFilter(  
               new ObjectSerializationCodecFactory()));
	
	//filterChain.addLast("textCode",new ProtocolCodecFilter(
	//			new TextLineCodecFactory(Charset.forName("UTF-8"))));
	
	serverIOHandler = new ServerIOHandler(severFrame);
	server.setHandler(serverIOHandler);
	//�����������˿� --- ����������
	try {
		server.bind(new InetSocketAddress(port));
	} catch (IOException e) {
		Tools.show(severFrame, "�˿��Ѿ�ռ�ã��뻻���˿ڣ�");
	}
}
 
开发者ID:ganhang,项目名称:My-ChatSystem,代码行数:25,代码来源:Server.java


示例6: main

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public static void main(String[] args) {
	int port = U.getInt("cleaner.server.port");
	int idleTime = U.getInt("cleaner.server.time");
	NioSocketAcceptor clientAcceptor = new NioSocketAcceptor();
	clientAcceptor.setReuseAddress(true);

	DefaultIoFilterChainBuilder chain = clientAcceptor.getFilterChain();
	SocketSessionConfig config = clientAcceptor.getSessionConfig();
	config.setIdleTime(IdleStatus.READER_IDLE, idleTime);// 读空闲 10秒
	config.setReuseAddress(true);
	config.setReadBufferSize(4096);// 默认2048
	config.setKeepAlive(true);
	config.setTcpNoDelay(true);// 开启nagle算法
	// 编解码
	chain.addLast("coder", new ProtocolCodecFilter(new TextLineCodecFactory(U.UTF8)));
	clientAcceptor.setHandler(new CleanerHandler());
	try {
		clientAcceptor.bind(new InetSocketAddress(port));
		log.info("心跳模块启动..");
	} catch (IOException e) {
		log.error("心跳模块启动失败", e);
	}
}
 
开发者ID:East196,项目名称:maker,代码行数:24,代码来源:BeatServer.java


示例7: initialize

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public void initialize() {
	idleTime = U.getInt("chat.server.idleTime");
	System.out.println(idleTime);

	clientAcceptor = new NioSocketAcceptor();
	clientAcceptor.setReuseAddress(true);

	DefaultIoFilterChainBuilder chain = clientAcceptor.getFilterChain();
	SocketSessionConfig config = clientAcceptor.getSessionConfig();
	config.setReuseAddress(true);
	config.setIdleTime(IdleStatus.READER_IDLE, idleTime);// 读空闲 20秒
	config.setReadBufferSize(4096);// 默认2048
	config.setKeepAlive(true);
	config.setTcpNoDelay(true);// 禁用/开启nagle算法
	// 编解码
	chain.addLast("coder", new ProtocolCodecFilter(new MessageCodecFactory()));
	// 日志
	chain.addLast("logger", new LoggingFilter());
	// 业务逻辑处理线程池
	chain.addLast("threadPool", new ExecutorFilter());
}
 
开发者ID:East196,项目名称:maker,代码行数:22,代码来源:TcpServer.java


示例8: startListner

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public  void startListner(IoHandler iohandler,int listenPort) throws Exception{
	acceptor = new NioSocketAcceptor();
	acceptor.setBacklog(100);
	acceptor.setReuseAddress(true);
	acceptor.setHandler(iohandler);
	
       DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
       IoFilter protocol = new ProtocolCodecFilter(new GameProtocolcodecFactory());
       chain.addLast("codec", protocol);
	threadpool = new OrderedThreadPoolExecutor(500);
	threadpool.setThreadFactory(new ServerThreadFactory("OrderedThreadPool"));
	chain.addLast("threadPool", new ExecutorFilter(threadpool));
	
	int recsize = 5120;
	int sendsize = 40480;                                                                                         
	int timeout = 10;
	SocketSessionConfig sc = acceptor.getSessionConfig();
	sc.setReuseAddress(true);// 设置每一个非主监听连接的端口可以重用
	sc.setReceiveBufferSize(recsize);// 设置输入缓冲区的大小
	sc.setSendBufferSize(sendsize);// 设置输出缓冲区的大小
	sc.setTcpNoDelay(true);// flush函数的调用 设置为非延迟发送,为true则不组装成大包发送,收到东西马上发出   
	sc.setSoLinger(0);
	sc.setIdleTime(IdleStatus.READER_IDLE, timeout);
	acceptor.bind(new InetSocketAddress(listenPort));
}
 
开发者ID:yongzhidai,项目名称:GameServer,代码行数:26,代码来源:NetManager.java


示例9: addFilterToChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
protected void addFilterToChain( final SocketAcceptor acceptor, final String filterName, final IoFilter filter )
{
    if ( acceptor == null )
    {
        Log.debug( "Not adding filter '{}' to acceptor that is null.", filterName );
        return;
    }

    final DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
    if ( chain.contains( COMPRESSION_FILTER_NAME ) )
    {
        Log.debug( "Adding filter '{}' as the first filter after the compression filter in acceptor {}", filterName, acceptor );
        chain.addAfter( COMPRESSION_FILTER_NAME, filterName, filter );
    }
    else if ( chain.contains( TLS_FILTER_NAME ) )
    {
        Log.debug( "Adding filter '{}' as the first filter after the TLS filter in acceptor {}", filterName, acceptor );
        chain.addAfter( TLS_FILTER_NAME, filterName, filter );
    }
    else
    {
        Log.debug( "Adding filter '{}' as the last filter in acceptor {}", filterName, acceptor );
        chain.addLast( filterName, filter );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:26,代码来源:DebuggerPlugin.java


示例10: initService

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private void initService() throws Exception
  {
      IoBuffer.setUseDirectBuffer(false);

      acceptor = new NioSocketAcceptor(
      		Runtime.getRuntime().availableProcessors() + 1);
      config = acceptor.getSessionConfig();
      config.setReuseAddress(true);
      DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();

      chain.addLast("codec", new ProtocolCodecFilter(
      		new TextLineCodecFactory(
              		MailsterConstants.DEFAULT_CHARSET, 
              		LineDelimiter.CRLF, 
              		LineDelimiter.CRLF)));

executor = Executors.newCachedThreadPool(
		ThreadFactoryUtilities.createFactory("POP3 Thread"));
chain.addLast("threadPool", new ExecutorFilter(executor));

      handler = new Pop3ProtocolHandler(userManager);
  }
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:23,代码来源:MailsterPop3Service.java


示例11: getFilterChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public final DefaultIoFilterChainBuilder getFilterChain() {
    if (filterChainBuilder instanceof DefaultIoFilterChainBuilder) {
        return (DefaultIoFilterChainBuilder) filterChainBuilder;
    }

    throw new IllegalStateException("Current filter chain builder is not a DefaultIoFilterChainBuilder.");
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:AbstractIoService.java


示例12: reloadSslContext

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * reloads the SSL context by replacing the existing SslFilter
 * with a new SslFilter after reloading the keystore.
 * 
 * Note: should be called to reload the keystore after changing the digital certificate.
 */
public void reloadSslContext() throws Exception
{
    if ( !started )
    {
        return;
    }

    LOG.info( "reloading SSL context..." );

    loadKeyStore();

    String sslFilterName = "sslFilter";
    for ( IoFilterChainBuilder chainBuilder : chainBuilders )
    {
        DefaultIoFilterChainBuilder dfcb = ( ( DefaultIoFilterChainBuilder ) chainBuilder );
        if ( dfcb.contains( sslFilterName ) )
        {
            DefaultIoFilterChainBuilder newChain = ( DefaultIoFilterChainBuilder ) LdapsInitializer
                .init( this );
            dfcb.replace( sslFilterName, newChain.get( sslFilterName ) );
            newChain = null;
        }
    }

    StartTlsHandler handler = ( StartTlsHandler ) getExtendedOperationHandler( StartTlsHandler.EXTENSION_OID );
    if ( handler != null )
    {
        handler.setLdapServer( this );
    }

    LOG.info( "reloaded SSL context successfully" );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:39,代码来源:LdapServer.java


示例13: initConnector

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private void initConnector(InetSocketAddress isa, TransportConfig config) {
    // create connector
    ioConnector = new NioSocketConnector(1);
    ioConnector.setConnectTimeoutMillis(config.getConnectTimeout());

    SocketSessionConfig sessionConfig = ioConnector.getSessionConfig();
    sessionConfig.setTcpNoDelay(true);
    sessionConfig.setReceiveBufferSize(8 * 1024);
    sessionConfig.setSendBufferSize(8 * 1024);

    DefaultIoFilterChainBuilder chainBuilder = ioConnector.getFilterChain();

    final TransportProtocolEncoder encoder = new TransportProtocolEncoder();
    final TransportProtocolDecoder decoder = new TransportProtocolDecoder();
    encoder.setMaxObjectSize(config.getMaxSize());
    decoder.setMaxObjectSize(config.getMaxSize());
    // add filter
    chainBuilder.addLast("codec", new ProtocolCodecFilter(encoder, decoder));

    // add keep alive filter
    ActiveKeepAliveMessageFactory messageFactory = new ActiveKeepAliveMessageFactory(config.getSerializeType());
    KeepAliveFilter kaFilter = new KeepAliveFilter(messageFactory, IdleStatus.BOTH_IDLE);
    kaFilter.setRequestInterval(config.getHeartbeatIntervalSeconds());
    kaFilter.setForwardEvent(true);
    chainBuilder.addLast("keepAlive", kaFilter);

    // set handler
    ioConnector.setHandler(new MinaIoHandler());

    ioConnector.setDefaultRemoteAddress(isa);
}
 
开发者ID:dinstone,项目名称:jrpc,代码行数:32,代码来源:MinaConnector.java


示例14: connect

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * �����ͻ�������
 */
public boolean connect() {
	// ʵ���� �������� Socket����
	client = new NioSocketConnector();
	// �������ݹ�����
	DefaultIoFilterChainBuilder filterChain = client.getFilterChain();
	//filterChain.addLast("textCode", new ProtocolCodecFilter(
	//		new TextLineCodecFactory(Charset.forName("UTF-8"))));
	filterChain.addLast("myChin", new ProtocolCodecFilter(
			new ObjectSerializationCodecFactory()));
	// �ͻ��˴������
	ClientIoHandler clientIoHandler = new ClientIoHandler(loginFrame,client);
	client.setHandler(clientIoHandler);
	clientIoHandler.setRegisterFrame(registerFrame);
	// ���ӷ�����
	ConnectFuture future = client.connect(new InetSocketAddress(
			IP, Port));
	// �ȴ�
	future.awaitUninterruptibly();
	// �õ��Ự����
	try {
		session = future.getSession();
		return true;
	} catch (Exception e) {
		Tools.show(loginFrame, "�޷����ӷ�������������û������");
		client.dispose();
		if(registerFrame!=null)
		registerFrame.dispose();
		return false;
	}
	// session.getCloseFuture().awaitUninterruptibly();

}
 
开发者ID:ganhang,项目名称:My-ChatSystem,代码行数:36,代码来源:Client.java


示例15: appendIoFiltersToChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private void appendIoFiltersToChain(List<IoFilter> filters, DefaultIoFilterChainBuilder filterChain) {
    if (filters != null && filters.size() > 0) {
        for (IoFilter ioFilter : filters) {
            filterChain.addLast(ioFilter.getClass().getCanonicalName(), ioFilter);
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:Mina2Producer.java


示例16: start

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public void start() throws Exception {
	buildExecutors();
	IoProcessor<NioSession> processor = new SimpleIoProcessorPool<NioSession>(
			NioProcessor.class, ioExecutor, coreSize);
	connector = new NioSocketConnector(connectorExecutor, processor);
	connector.setConnectTimeoutMillis((Integer) rule.get("timeout")); // 设置连接超时。见AbstractPollingIoConnector.processTimedOutSessions()与ConnectionRequest类
	// connector.getSessionConfig().setUseReadOperation(true); //
	// 亦可使用该方式实现同步发送并接收数据,这样无须设置Handler,通过session.read()获取
	handler = new ShortConnectorHandler();
	connector.setHandler(handler);
	DefaultIoFilterChainBuilder filterChain = connector.getFilterChain();
	filterChain.addLast("codec", new ProtocolCodecFilter(
			ProtocolCodecFactoryFactory.getInstance(rule)));
}
 
开发者ID:dreajay,项目名称:jcode,代码行数:15,代码来源:TcpConnector.java


示例17: buildFilterChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
protected void buildFilterChain() {
	DefaultIoFilterChainBuilder filterChain = acceptor.getFilterChain();
	filterChain.addLast("codec",new ProtocolCodecFilter(ProtocolCodecFactoryFactory.getInstance(rule)));
	IoEventType[] DEFAULT_EVENT_SET = new IoEventType[] {
	        IoEventType.MESSAGE_RECEIVED
	    };
	// businessPool用来处理DEFAULT_EVENT_SET事件,这里只处理获取
	filterChain.addLast("businessPool", new ExecutorFilter(businessExecutor, DEFAULT_EVENT_SET));
}
 
开发者ID:dreajay,项目名称:jcode,代码行数:10,代码来源:ShortTcpAcceptor.java


示例18: main

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public static void main(String[] args) {
	NioSocketConnector connector = new NioSocketConnector();
	DefaultIoFilterChainBuilder chain = connector.getFilterChain();
	SocketSessionConfig config = connector.getSessionConfig();
	config.setReuseAddress(true);
	config.setIdleTime(IdleStatus.READER_IDLE, 20);// 读空闲 20秒
	config.setReadBufferSize(4096);// 默认2048
	config.setKeepAlive(true);
	config.setTcpNoDelay(true);// 禁用/开启nagle算法
	// 编解码
	chain.addLast("coder", new ProtocolCodecFilter(new MessageCodecFactory()));
	// 日志
	chain.addLast("logger", new LoggingFilter());
	// 业务逻辑处理线程池
	chain.addLast("threadPool", new ExecutorFilter());
	connector.setHandler(new MinaMessageHandler());
	connector.setConnectTimeoutMillis(15 * 1000); // 设置连接超时 ,15秒
	connector.setConnectTimeoutCheckInterval(300);
	// 建立连接
	ConnectFuture cf = connector.connect(new InetSocketAddress("localhost", 8000));
	// 等待连接创建完成
	cf.awaitUninterruptibly();
	Packet packet = Packet.newBuilder().setCmdId(0).setChatMsgAck(ChatMsgAck.newBuilder().setResult(123)).build();
	cf.getSession().write(packet.toByteArray());
	packet = Packet.newBuilder().setCmdId(1).setChatMsgAck(ChatMsgAck.newBuilder().setResult(123)).build();
	cf.getSession().write(packet.toByteArray());

	// 等待连接断开
	cf.getSession().getCloseFuture().awaitUninterruptibly();
	// 释放连接
	connector.dispose();

}
 
开发者ID:East196,项目名称:maker,代码行数:34,代码来源:TcpClient.java


示例19: MinaAcceptor

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public MinaAcceptor(CodecFactory codecFactory, int maxIoThreads, int maxTaskThreads, TaskMapper taskMapper) {
	Objects.requireNonNull(codecFactory);

	log.info("Initializing acceptor {max I/O threads: {}, max task threads: {}}",
			maxIoThreads,
			maxTaskThreads > 0
					? Integer.toString(maxTaskThreads)
					: "unbounded");
	
	acceptor = new NioSocketAcceptor(maxIoThreads);
	DefaultIoFilterChainBuilder filters = acceptor.getFilterChain();

	// encoding
	filters.addLast("codec", new ProtocolCodecFilter(new MinaCodecFactory(codecFactory)));
	
	// thread model
	executor = newExecutor(maxTaskThreads, taskMapper);
	filters.addLast("threadPool", new ExecutorFilter(executor));

	// logging
	filters.addLast("logger", new LoggingFilter());

	// session handler
	minaAdapter = new MinaAdapter();
	acceptor.setHandler(minaAdapter);
	
	// acceptor configuration
	// disable disconnection on unbind
	acceptor.setCloseOnDeactivation(false);
	// port reuse when socket is in TIME_WAIT state
	acceptor.setReuseAddress(true);
	acceptor.getSessionConfig().setReuseAddress(true);
	acceptor.getSessionConfig().setKeepAlive(true);
	acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, DEFAULT_SESSION_IDLE_SECONDS);
	// no Nagle's algorithm
	acceptor.getSessionConfig().setTcpNoDelay(true);
}
 
开发者ID:ugcs,项目名称:ugcs-java-sdk,代码行数:38,代码来源:MinaAcceptor.java


示例20: MinaConnector

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public MinaConnector(CodecFactory codecFactory, int maxIoThreads, int maxTaskThreads, TaskMapper taskMapper) {
	Objects.requireNonNull(codecFactory);

	log.info("Initializing connector {max I/O threads: {}, max task threads: {}}",
			Integer.toString(maxIoThreads),
			maxTaskThreads > 0
					? Integer.toString(maxTaskThreads)
					: "unbounded");

	connector = new NioSocketConnector(maxIoThreads);
	DefaultIoFilterChainBuilder filters = connector.getFilterChain();
	
	// encoding
	filters.addLast("codec", new ProtocolCodecFilter(new MinaCodecFactory(codecFactory)));
	
	// thread model
	executor = newExecutor(maxTaskThreads, taskMapper);
	filters.addLast("threadPool", new ExecutorFilter(executor));

	// logging
	filters.addLast("logger", new LoggingFilter());

	// session handler
	minaAdapter = new MinaAdapter();
	connector.setHandler(minaAdapter);
	
	// connector configuration
	connector.getSessionConfig().setReuseAddress(true);
	connector.getSessionConfig().setKeepAlive(true);
	connector.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, DEFAULT_SESSION_IDLE_SECONDS);
	// no Nagle's algorithm
	connector.getSessionConfig().setTcpNoDelay(true);
}
 
开发者ID:ugcs,项目名称:ugcs-java-sdk,代码行数:34,代码来源:MinaConnector.java


示例21: addSSLSupport

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private static void addSSLSupport(DefaultIoFilterChainBuilder chain)
		throws Exception {
	SslFilter sslFilter = new SslFilter(BogusSslContextFactory
			.getInstance(true));
	chain.addLast("sslFilter", sslFilter);
	System.out.println("SSL ON");
}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:8,代码来源:PeerlessServerMain.java


示例22: initService

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * Initializes the runtime service.
 */
private void initService()
{
	try
	{
		IoBuffer.setUseDirectBuffer(false);
		acceptor = new NioSocketAcceptor(Runtime.getRuntime().availableProcessors() + 1);
		
		acceptor.getSessionConfig().setReuseAddress(true);
		DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();

		if (LOG.isTraceEnabled())
			chain.addLast("logger", new LoggingFilter());

		codecFactory = new SMTPCodecFactory(config);
		chain.addLast("codec", new ProtocolCodecFilter(codecFactory));
		
		executor = Executors.newCachedThreadPool(new ThreadFactory() {
			int sequence;
			
			public Thread newThread(Runnable r) 
			{					
				sequence += 1;
				return new Thread(r, "MailsterSMTP Thread "+sequence);
			}			
		});
		
		chain.addLast("threadPool", new ExecutorFilter(executor));
		
		handler = new SMTPConnectionHandler(getConfig(), getCommandHandler(),
				getDeliveryHandlerFactory());
	}
	catch (Exception ex)
	{
		throw new RuntimeException(ex);
	}
}
 
开发者ID:edeoliveira,项目名称:MailsterSMTP,代码行数:40,代码来源:SMTPServer.java


示例23: getDefaultIoFilterChainBuilder

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
@Override
public final DefaultIoFilterChainBuilder getDefaultIoFilterChainBuilder() {
	if (filterChainBuilder instanceof DefaultIoFilterChainBuilder) {
		return (DefaultIoFilterChainBuilder) filterChainBuilder;
	}

	throw new IllegalStateException("Current filter chain builder is not a DefaultIoFilterChainBuilder.");
}
 
开发者ID:dwing4g,项目名称:jane,代码行数:9,代码来源:AbstractIoService.java


示例24: init

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * Initialize the LDAPS server.
 *
 * @param ldapServer The LDAP server instance
 * @param transport The TCP transport that contains the SSL configuration
 * @return A IoFilter chain
 * @throws LdapException If we had a pb
 */
public static IoFilterChainBuilder init( LdapServer ldapServer, TcpTransport transport ) throws LdapException
{
    SSLContext sslCtx;

    try
    {
    	sslCtx = ldapServer.getSSLContext();
    	
    	//TODO see if this is correct
    	// Initialize the SSLContext to work with our key managers.
        //sslCtx = SSLContext.getInstance( "TLS" );
        //sslCtx.init( ldapServer.getKeyManagerFactory().getKeyManagers(), new TrustManager[]
        //    { new NoVerificationTrustManager() }, new SecureRandom() );
    	
    }
    catch ( Exception e )
    {
        throw new LdapException( I18n.err( I18n.ERR_683 ), e );
    }

    DefaultIoFilterChainBuilder chain = new DefaultIoFilterChainBuilder();
    SslFilter sslFilter = new SslFilter( sslCtx );

    // The ciphers
    List<String> cipherSuites = transport.getCipherSuite();

    if ( ( cipherSuites != null ) && !cipherSuites.isEmpty() )
    {
        sslFilter.setEnabledCipherSuites( cipherSuites.toArray( new String[cipherSuites.size()] ) );
    }

    // The protocols
    List<String> enabledProtocols = transport.getEnabledProtocols();

    if ( ( enabledProtocols != null ) && !enabledProtocols.isEmpty() )
    {
        sslFilter.setEnabledProtocols( enabledProtocols.toArray( new String[enabledProtocols.size()] ) );
    }
    else
    {
        // Be sure we disable SSLV3
        sslFilter.setEnabledProtocols( new String[]
            { "SSLv2Hello", "TLSv1", "TLSv1.1", "TLSv1.2" } );
    }

    // The remaining SSL parameters
    sslFilter.setNeedClientAuth( transport.isNeedClientAuth() );
    sslFilter.setWantClientAuth( transport.isWantClientAuth() );
    
    chain.addLast( "sslFilter", sslFilter );

    return chain;
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:62,代码来源:LdapsInitializer.java


示例25: customizeFilterChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
@Override
public void customizeFilterChain ( final DefaultIoFilterChainBuilder filterChain )
{
    filterChain.addFirst ( "logger", new LoggingFilter () );
}
 
开发者ID:ibh-systems,项目名称:neoscada-misc,代码行数:6,代码来源:Ngp2Modbus.java


示例26: bind

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
@Override
public MinaAcceptance bind() {
    // This socket acceptor will handle incoming connections
    acceptor = new NioSocketAcceptor(transportConfig.getNioProcessorCount());
    acceptor.setReuseAddress(true);
    acceptor.setBacklog(128);

    SocketSessionConfig sessionConfig = acceptor.getSessionConfig();
    sessionConfig.setTcpNoDelay(true);

    // set read buffer size
    sessionConfig.setReceiveBufferSize(16 * 1024);
    sessionConfig.setSendBufferSize(16 * 1024);

    // get filter chain builder
    DefaultIoFilterChainBuilder chainBuilder = acceptor.getFilterChain();

    // add message codec filter
    final TransportProtocolEncoder encoder = new TransportProtocolEncoder();
    final TransportProtocolDecoder decoder = new TransportProtocolDecoder();

    encoder.setMaxObjectSize(transportConfig.getMaxSize());
    decoder.setMaxObjectSize(transportConfig.getMaxSize());
    chainBuilder.addLast("codec", new ProtocolCodecFilter(encoder, decoder));

    // add keep alive filter
    KeepAliveFilter kaFilter = new KeepAliveFilter(new PassiveKeepAliveMessageFactory(), IdleStatus.BOTH_IDLE);
    kaFilter.setRequestInterval(transportConfig.getHeartbeatIntervalSeconds());
    kaFilter.setForwardEvent(true);
    chainBuilder.addLast("keepAlive", kaFilter);

    // add business handler
    acceptor.setHandler(new MinaIoHandler());

    try {
        acceptor.bind(serviceAddress);

        int processorCount = transportConfig.getBusinessProcessorCount();
        if (processorCount > 0) {
            NamedThreadFactory threadFactory = new NamedThreadFactory("Mina-BusinssProcessor");
            executorService = Executors.newFixedThreadPool(processorCount, threadFactory);
        }
    } catch (Exception e) {
        throw new RuntimeException("can't bind service on " + serviceAddress, e);
    }
    LOG.info("mina acceptance bind on {}", serviceAddress);

    return this;
}
 
开发者ID:dinstone,项目名称:jrpc,代码行数:50,代码来源:MinaAcceptance.java


示例27: getFilterChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public DefaultIoFilterChainBuilder getFilterChain() {
    return connector.getFilterChain();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:Mina2Producer.java


示例28: start

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private void start() {
	Config conf = ConfigFactory.load();
	String check_server_beat_ip = conf.getString("check_server_beat_ip");
	int check_server_beat_port = conf.getInt("check_server_beat_port");
	if (U.isEmpty(check_server_beat_ip)) {
		log.error("BeatClient 连接心跳服务器 没有配置!");
		return;
	}

	NioSocketConnector connector = new NioSocketConnector();
	DefaultIoFilterChainBuilder chain = connector.getFilterChain();
	chain.addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8"))));
	connector.setHandler(new BeatHanlder());
	connector.setConnectTimeoutMillis(15 * 1000); // 设置连接超时 ,15秒
	connector.setConnectTimeoutCheckInterval(300);

	long waitTimeConnect = 2 * 1000;
	final long waitTimeMAX = 30 * 1000;
	final long waitTimeSpace = 2 * 1000;
	for (;;) {
		try {
			ConnectFuture cf = connector
					.connect(new InetSocketAddress(check_server_beat_ip, check_server_beat_port));
			cf.awaitUninterruptibly();
			IoSession session = cf.getSession();// 获取会话
			if (session.isConnected()) {
				log.info("BeatClient 连接心跳服务器OK IP:" + check_server_beat_ip + ",PORT:" + check_server_beat_port);
				break;
			}
			Thread.sleep(waitTimeConnect);
		} catch (Exception e) {
			log.error("ERROR_connect :" + e.getMessage());
			try {
				Thread.sleep(waitTimeConnect);
			} catch (InterruptedException e1) {
			}
		} finally {
			waitTimeConnect += waitTimeSpace;
			if (waitTimeConnect > waitTimeMAX) {
				waitTimeConnect = waitTimeSpace;
			}
		}
	}
}
 
开发者ID:East196,项目名称:maker,代码行数:45,代码来源:BeatClient.java


示例29: start

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * Starts this acceptor by binding the socket acceptor. When the acceptor is already started, a warning will be
 * logged and the method invocation is otherwise ignored.
 */
@Override
public synchronized void start()
{
    if ( socketAcceptor != null )
    {
        Log.warn( "Unable to start acceptor (it is already started!)" );
        return;
    }

    try
    {
        // Configure the thread pool that is to be used.
        final int initialSize = ( configuration.getMaxThreadPoolSize() / 4 ) + 1;
        final ExecutorFilter executorFilter = new ExecutorFilter( initialSize, configuration.getMaxThreadPoolSize(), 60, TimeUnit.SECONDS );
        final ThreadPoolExecutor eventExecutor = (ThreadPoolExecutor) executorFilter.getExecutor();
        final ThreadFactory threadFactory = new NamedThreadFactory( name + "-thread-", eventExecutor.getThreadFactory(), true, null );
        eventExecutor.setThreadFactory( threadFactory );

        // Construct a new socket acceptor, and configure it.
        socketAcceptor = buildSocketAcceptor();

        if ( JMXManager.isEnabled() )
        {
            configureJMX( socketAcceptor, name );
        }

        final DefaultIoFilterChainBuilder filterChain = socketAcceptor.getFilterChain();
        filterChain.addFirst( ConnectionManagerImpl.EXECUTOR_FILTER_NAME, executorFilter );

        // Add the XMPP codec filter
        filterChain.addAfter( ConnectionManagerImpl.EXECUTOR_FILTER_NAME, ConnectionManagerImpl.XMPP_CODEC_FILTER_NAME, new ProtocolCodecFilter( new XMPPCodecFactory() ) );

        // Kill sessions whose outgoing queues keep growing and fail to send traffic
        filterChain.addAfter( ConnectionManagerImpl.XMPP_CODEC_FILTER_NAME, ConnectionManagerImpl.CAPACITY_FILTER_NAME, new StalledSessionsFilter() );

        // Ports can be configured to start connections in SSL (as opposed to upgrade a non-encrypted socket to an encrypted one, typically using StartTLS)
        if ( configuration.getTlsPolicy() == Connection.TLSPolicy.legacyMode )
        {
            final SslFilter sslFilter = encryptionArtifactFactory.createServerModeSslFilter();
            filterChain.addAfter( ConnectionManagerImpl.EXECUTOR_FILTER_NAME, ConnectionManagerImpl.TLS_FILTER_NAME, sslFilter );
        }

        // Throttle sessions who send data too fast
        if ( configuration.getMaxBufferSize() > 0 )
        {
            socketAcceptor.getSessionConfig().setMaxReadBufferSize( configuration.getMaxBufferSize() );
            Log.debug( "Throttling read buffer for connections to max={} bytes", configuration.getMaxBufferSize() );
        }

        // Start accepting connections
        socketAcceptor.setHandler( connectionHandler );
        socketAcceptor.bind( new InetSocketAddress( configuration.getBindAddress(), configuration.getPort() ) );
    }
    catch ( Exception e )
    {
        System.err.println( "Error starting " + configuration.getPort() + ": " + e.getMessage() );
        Log.error( "Error starting: " + configuration.getPort(), e );
        // Reset for future use.
        if (socketAcceptor != null) {
            try {
                socketAcceptor.unbind();
            } finally {
                socketAcceptor = null;
            }
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:72,代码来源:MINAConnectionAcceptor.java


示例30: reconfigure

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
@Override
public synchronized void reconfigure( ConnectionConfiguration configuration )
{
    this.configuration = configuration;

    if ( socketAcceptor == null )
    {
        return; // reconfig will occur when acceptor is started.
    }

    final DefaultIoFilterChainBuilder filterChain = socketAcceptor.getFilterChain();

    if ( filterChain.contains( ConnectionManagerImpl.EXECUTOR_FILTER_NAME ) )
    {
        final ExecutorFilter executorFilter = (ExecutorFilter) filterChain.get( ConnectionManagerImpl.EXECUTOR_FILTER_NAME );
        ( (ThreadPoolExecutor) executorFilter.getExecutor()).setCorePoolSize( ( configuration.getMaxThreadPoolSize() / 4 ) + 1 );
        ( (ThreadPoolExecutor) executorFilter.getExecutor()).setMaximumPoolSize( ( configuration.getMaxThreadPoolSize() ) );
    }

    if ( configuration.getTlsPolicy() == Connection.TLSPolicy.legacyMode )
    {
        // add or replace TLS filter (that's used only for 'direct-TLS')
        try
        {
            final SslFilter sslFilter = encryptionArtifactFactory.createServerModeSslFilter();
            if ( filterChain.contains( ConnectionManagerImpl.TLS_FILTER_NAME ) )
            {
                filterChain.replace( ConnectionManagerImpl.TLS_FILTER_NAME, sslFilter );
            }
            else
            {
                filterChain.addAfter( ConnectionManagerImpl.EXECUTOR_FILTER_NAME, ConnectionManagerImpl.TLS_FILTER_NAME, sslFilter );
            }
        }
        catch ( KeyManagementException | NoSuchAlgorithmException | UnrecoverableKeyException | KeyStoreException e )
        {
            Log.error( "An exception occurred while reloading the TLS configuration.", e );
        }
    }
    else
    {
        // The acceptor is in 'startTLS' mode. Remove TLS filter (that's used only for 'direct-TLS')
        if ( filterChain.contains( ConnectionManagerImpl.TLS_FILTER_NAME ) )
        {
            filterChain.remove( ConnectionManagerImpl.TLS_FILTER_NAME );
        }
    }

    if ( configuration.getMaxBufferSize() > 0 )
    {
        socketAcceptor.getSessionConfig().setMaxReadBufferSize( configuration.getMaxBufferSize() );
        Log.debug( "Throttling read buffer for connections to max={} bytes", configuration.getMaxBufferSize() );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:55,代码来源:MINAConnectionAcceptor.java


示例31: PeerlessUdpServer

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public PeerlessUdpServer(PeerlessDbSupport peerlessDbSupport, SigHashTable sht) throws IOException {
	
	this.sht=sht;
	this.peerlessDbSupport=peerlessDbSupport;

    NioDatagramAcceptor acceptor = new NioDatagramAcceptor();
    acceptor.setHandler(new PeerlessUdpServerHandler(this));

    DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
    chain.addLast("logger", new LoggingFilter());

    DatagramSessionConfig dcfg = acceptor.getSessionConfig();
    dcfg.setReuseAddress(true);

 chain.addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));        
    
     acceptor.bind(new InetSocketAddress(PORT));
    System.out.println("UDPServer listening on port " + PORT);
}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:20,代码来源:PeerlessUdpServer.java


示例32: main

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	NioSocketAcceptor acceptor = new NioSocketAcceptor();
	DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();

	MdcInjectionFilter mdcInjectionFilter = new MdcInjectionFilter();
	chain.addLast("mdc", mdcInjectionFilter);

	SigHashTable sht = new SigHashTable();

	/*
	 * FileSignature d0=new FileSignature("test data");
	 * SigManager.printByteArray(d0);
	 * 
	 * FileSignature d1=new FileSignature(new File("ftphome//test.txt"));
	 * SigManager.printByteArray(d1);
	 * 
	 * FileSignature d2=newFileSignature(
	 * "Design and Implementation of Virtualized Network Simulator");
	 * SigManager.printByteArray(d2);
	 * 
	 * sht.addSignature(d0); sht.addSignature(d1); sht.addSignature(d2);
	 */

	PeerlessDbSupport peerlessDbSupport = new PeerlessDbSupport(ServerConfig.ServerDb);
	peerlessDbSupport.connect();
	peerlessDbSupport.createSchema();

	SuperPeerManager superPeerManager = new SuperPeerManager();
	
	// Add SSL filter if SSL is enabled.
	if (USE_SSL) {
		addSSLSupport(chain);
	}

	// chain.addLast("codec", new ProtocolCodecFilter(new
	// TextLineCodecFactory()));
	chain.addLast("codec", new ProtocolCodecFilter(
			new ObjectSerializationCodecFactory()));

	addLogger(chain);

	// Bind
	acceptor.setHandler(new PeerlessProtocolHandler(sht, peerlessDbSupport, superPeerManager));
	acceptor.bind(new InetSocketAddress(ServerConfig.PORT));

	System.out.println("Listening on port " + ServerConfig.PORT);
	
	try {
		new PeerlessUdpServer(peerlessDbSupport, sht);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}


}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:57,代码来源:PeerlessServerMain.java


示例33: addLogger

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
private static void addLogger(DefaultIoFilterChainBuilder chain)
		throws Exception {
	chain.addLast("logger", new LoggingFilter());
	System.out.println("Logging ON");
}
 
开发者ID:knowpd,项目名称:p2p-file-sharing-system,代码行数:6,代码来源:PeerlessServerMain.java


示例34: setFilterChainBuilder

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
@Override
public final void setFilterChainBuilder(IoFilterChainBuilder builder) {
	filterChainBuilder = (builder != null ? builder : new DefaultIoFilterChainBuilder());
}
 
开发者ID:dwing4g,项目名称:jane,代码行数:5,代码来源:AbstractIoService.java


示例35: MyClient

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
     * Constructor
     */
    public MyClient() {
        connector = new NioSocketConnector();
        /**
         * 设置信息交换的IoHandler,负责接收和发送信息的处理
         */
        connector.setHandler(new ClientIoHandler());
        //配置过滤器
        DefaultIoFilterChainBuilder chain = connector.getFilterChain();
        //增加日志过滤器
        chain.addLast("logger", new LoggingFilter());
        //增加字符编码过滤器以及设置编码器和解码器
        //chain.addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8"))));
        /**
         * 默认编码器,解码器,遇到\n默认消息结束
         * 当然可以加参数指定解码字符,但解码字符会被截掉
         * 例如:new TextLineCodecFactory(Charset.forName("UTF-8"),"]","]");
         * 则会认为"]"为一条消息结束,遇到"]"则截取
         * 比如服务器给你发送的消息是aaaa]aaaa]
         * 会收到两条消息:
         * 1、aaaa
         * 2、aaaa
         * 后面的"]"则去掉了
         */
//        acceptor.getFilterChain().addLast(
//                "codec",
//                new ProtocolCodecFilter(new TextLineCodecFactory(Charset
//                        .forName("UTF-8"))));// 指定编码过滤器
        DemuxingProtocolCodecFactory pcf = new DemuxingProtocolCodecFactory();
        //自定义编码器
        pcf.addMessageEncoder(String.class, new MyMessageEncoder());
        //自定义解码器
        pcf.addMessageDecoder(new MyMessageDecoder());
        ProtocolCodecFilter codec = new ProtocolCodecFilter(pcf);
        chain.addLast("codec",codec);// 指定编码过滤器
        //设置默认连接的地址和端口
        connector.setDefaultRemoteAddress(new InetSocketAddress("localhost", 8888));
        /**
         * 重连机制
         * 如果没有连接,则过30 * 1000毫秒客户端会尝试重新连接服务器
         * 如果连接,则下面的代码不会执行
         */
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                if (null != connector && !connector.isActive()) {
                    try {
                        //尝试连接默认的地址和端口
                        ConnectFuture connFuture = connector.connect();
                        connFuture.awaitUninterruptibly();
                    } catch (Exception e) {
                        // TODO: handle exception
                        e.printStackTrace();
                    }
                }
            }
        }, new Date(), 30 * 1000);
    }
 
开发者ID:joezhjiang,项目名称:ics-mina,代码行数:61,代码来源:MyClient.java


示例36: getFilterChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * A shortcut for <tt>( ( DefaultIoFilterChainBuilder ) </tt>{@link #getFilterChainBuilder()}<tt> )</tt>.
 * Please note that the returned object is not a <b>real</b> {@link IoFilterChain}
 * but a {@link DefaultIoFilterChainBuilder}.  Modifying the returned builder
 * won't affect the existing {@link IoSession}s at all, because
 * {@link IoFilterChainBuilder}s affect only newly created {@link IoSession}s.
 *
 * @throws IllegalStateException if the current {@link IoFilterChainBuilder} is
 *                               not a {@link DefaultIoFilterChainBuilder}
 */
DefaultIoFilterChainBuilder getFilterChain();
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:IoService.java


示例37: getDefaultIoFilterChainBuilder

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
/**
 * A shortcut for <tt>( (DefaultIoFilterChainBuilder) </tt>{@link #getFilterChainBuilder()}<tt> )</tt>.
 * Modifying the returned builder won't affect the existing {@link IoSession}s at all,
 * because {@link IoFilterChainBuilder}s affect only newly created {@link IoSession}s.
 *
 * @return The filter chain in use
 * @throws IllegalStateException if the current {@link IoFilterChainBuilder} is not a {@link DefaultIoFilterChainBuilder}
 */
DefaultIoFilterChainBuilder getDefaultIoFilterChainBuilder();
 
开发者ID:dwing4g,项目名称:jane,代码行数:10,代码来源:IoService.java


示例38: customizeFilterChain

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder; //导入依赖的package包/类
public void customizeFilterChain ( DefaultIoFilterChainBuilder filterChain ); 
开发者ID:eclipse,项目名称:neoscada,代码行数:2,代码来源:SlaveHost.java



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