• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IoFilterChain类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onPostRemove

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPostRemove(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    super.onPostRemove(parent, name, nextFilter);
    IoSession session = parent.getSession();
    if (session == null) {
        return;
    }

    Zlib inflater = (Zlib) session.getAttribute(INFLATER);
    Zlib deflater = (Zlib) session.getAttribute(DEFLATER);
    if (deflater != null) {
        deflater.cleanUp();
    }

    if (inflater != null) {
        inflater.cleanUp();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:19,代码来源:CompressionFilter.java


示例2: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
/**
 * Executed just before the filter is added into the chain, we do :
 * <ul>
 * <li>check that we don't have a SSL filter already present
 * <li>we update the next filter
 * <li>we create the SSL handler helper class
 * <li>and we store it into the session's Attributes
 * </ul>
 */
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws SSLException {
    // Check that we don't have a SSL filter already present in the chain
    if (parent.contains(SslFilter.class)) {
        String msg = "Only one SSL filter is permitted in a chain.";
        LOGGER.error(msg);
        throw new IllegalStateException(msg);
    }

    LOGGER.debug("Adding the SSL Filter {} to the chain", name);

    IoSession session = parent.getSession();
    session.setAttribute(NEXT_FILTER, nextFilter);

    // Create a SSL handler and start handshake.
    SslHandler handler = new SslHandler(this, session);
    handler.init();
    session.setAttribute(SSL_HANDLER, handler);
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:29,代码来源:SslFilter.java


示例3: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
/**
 * Executed just before the filter is added into the chain, we do :
 * <ul>
 * <li>check that we don't have a SSL filter already present
 * <li>we update the next filter
 * <li>we create the SSL handler helper class
 * <li>and we store it into the session's Attributes
 * </ul>
 */
@Override
public void onPreAdd(IoFilterChain chain, String name, NextFilter nextFilter) throws SSLException {
	// Check that we don't have a SSL filter already present in the chain
	if (chain.getEntry(SslFilter.class) != null) {
		throw new IllegalStateException("Only one SSL filter is permitted in a chain.");
	}

	IoSession session = chain.getSession();

	// Create a SSL handler and start handshake.
	SslHandler sslHandler = new SslHandler(this, session);

	// Adding the supported ciphers in the SSLHandler
	if (enabledCipherSuites == null || enabledCipherSuites.length == 0) {
		enabledCipherSuites = sslContext.getServerSocketFactory().getSupportedCipherSuites();
	}

	sslHandler.init();

	session.setAttribute(SSL_HANDLER, sslHandler);
}
 
开发者ID:dwing4g,项目名称:jane,代码行数:31,代码来源:SslFilter.java


示例4: fireSessionCreated

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
/**
 * Calls {@link IoServiceListener#sessionCreated(IoSession)} for all registered listeners.
 *
 * @param session The session which has been created
 */
public final void fireSessionCreated(IoSession session) {
	boolean firstSession = false;

	if (session.getService() instanceof IoConnector) {
		firstSession = managedSessions.isEmpty();
	}

	// If already registered, ignore.
	if (managedSessions.putIfAbsent(session.getId(), session) != null) {
		return;
	}

	// If the first connector session, fire a virtual service activation event.
	if (firstSession) {
		fireServiceActivated();
	}

	// Fire session events.
	IoFilterChain filterChain = session.getFilterChain();
	filterChain.fireSessionCreated();
	filterChain.fireSessionOpened();
}
 
开发者ID:dwing4g,项目名称:jane,代码行数:28,代码来源:AbstractIoService.java


示例5: buildFilterChain

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void buildFilterChain ( final IoFilterChain chain )
{
    for ( final Entry entry : this.filters )
    {
        final IoFilter filter = entry.getFactory ().create ();
        if ( filter != null )
        {
            chain.addLast ( entry.getName (), filter );
        }
    }

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:FilterChainBuilder.java


示例6: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    if (parent.contains(CompressionFilter.class)) {
        throw new IllegalStateException("Only one " + CompressionFilter.class + " is permitted.");
    }

    Zlib deflater = new Zlib(compressionLevel, Zlib.MODE_DEFLATER);
    Zlib inflater = new Zlib(compressionLevel, Zlib.MODE_INFLATER);

    IoSession session = parent.getSession();

    session.setAttribute(DEFLATER, deflater);
    session.setAttribute(INFLATER, inflater);
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:CompressionFilter.java


示例7: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    Class<? extends IoFilterAdapter> clazz = getClass();
    if (parent.contains(clazz)) {
        throw new IllegalStateException("Only one " + clazz.getName() + " is permitted.");
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:AbstractStreamWriteFilter.java


示例8: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    if (parent.contains(this)) {
        throw new IllegalArgumentException("You can't add the same filter instance more than once. "
                + "Create another instance and add it.");
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:KeepAliveFilter.java


示例9: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    if (parent.contains(this)) {
        throw new IllegalArgumentException(
                "You can't add the same filter instance more than once.  Create another instance and add it.");
    }

    IoSession session = parent.getSession();
    session.setAttribute(RESPONSE_INSPECTOR, responseInspectorFactory.getResponseInspector());
    session.setAttribute(REQUEST_STORE, createRequestStore(session));
    session.setAttribute(UNRESPONDED_REQUEST_STORE, createUnrespondedRequestStore(session));
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:RequestResponseFilter.java


示例10: onPostRemove

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPostRemove(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    IoSession session = parent.getSession();

    destroyUnrespondedRequestStore(getUnrespondedRequestStore(session));
    destroyRequestStore(getRequestStore(session));

    session.removeAttribute(UNRESPONDED_REQUEST_STORE);
    session.removeAttribute(REQUEST_STORE);
    session.removeAttribute(RESPONSE_INSPECTOR);
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:RequestResponseFilter.java


示例11: onPreRemove

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPreRemove(IoFilterChain parent, String name, NextFilter nextFilter) throws SSLException {
    IoSession session = parent.getSession();
    stopSsl(session);
    session.removeAttribute(NEXT_FILTER);
    session.removeAttribute(SSL_HANDLER);
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:SslFilter.java


示例12: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    if (parent.contains(this)) {
        throw new IllegalArgumentException(
                "You can't add the same filter instance more than once.  Create another instance and add it.");
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:ProtocolCodecFilter.java


示例13: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
public synchronized void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    if (0 == count) {
        filter.init();
    }

    ++count;

    filter.onPreAdd(parent, name, nextFilter);
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:10,代码来源:ReferenceCountingFilter.java


示例14: onPostRemove

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
public synchronized void onPostRemove(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    filter.onPostRemove(parent, name, nextFilter);

    --count;

    if (0 == count) {
        filter.destroy();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:10,代码来源:ReferenceCountingFilter.java


示例15: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void onPreAdd(IoFilterChain parent, String name, NextFilter nextFilter) throws Exception {
    if (parent.contains(this)) {
        throw new IllegalArgumentException(
                "You can't add the same filter instance more than once.  Create another instance and add it.");
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:ExecutorFilter.java


示例16: removeNow

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
private boolean removeNow(S session) {
    clearWriteRequestQueue(session);

    try {
        destroy(session);
        return true;
    } catch (Exception e) {
        IoFilterChain filterChain = session.getFilterChain();
        filterChain.fireExceptionCaught(e);
    } finally {
        clearWriteRequestQueue(session);
        ((AbstractIoService) session.getService()).getListeners().fireSessionDestroyed(session);
    }
    return false;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:AbstractPollingIoProcessor.java


示例17: buildFilterChain

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void buildFilterChain ( final IoFilterChain chain )
{
    if ( this.loggerName != null && Boolean.getBoolean ( "org.eclipse.scada.protocol.sfp.common.logger.raw" ) )
    {
        chain.addFirst ( "logger.raw", new LoggingFilter ( this.loggerName ) );
    }

    if ( !Boolean.getBoolean ( "org.eclipse.scada.protocol.sfp.common.disableStats" ) )
    {
        chain.addFirst ( StatisticsFilter.DEFAULT_NAME, new StatisticsFilter () );
    }

    if ( this.loggerName != null && Boolean.getBoolean ( "org.eclipse.scada.protocol.sfp.common.logger" ) )
    {
        chain.addFirst ( "logger", new LoggingFilter ( this.loggerName ) );
    }

    chain.addLast ( "closeidle", new IoFilterAdapter () {
        @Override
        public void sessionIdle ( final NextFilter nextFilter, final IoSession session, final IdleStatus status ) throws Exception
        {
            session.close ( true );
        }
    } );
    chain.addLast ( "codec", new ProtocolCodecFilter ( new ProtocolEncoderImpl (), new ProtocolDecoderImpl () ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:28,代码来源:FilterChainBuilder.java


示例18: addCompression

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
@Override
public void addCompression() {
    IoFilterChain chain = ioSession.getFilterChain();
    String baseFilter = EXECUTOR_FILTER_NAME;
    if (chain.contains(TLS_FILTER_NAME)) {
        baseFilter = TLS_FILTER_NAME;
    }
    chain.addAfter(baseFilter, COMPRESSION_FILTER_NAME, new CompressionFilter(true, false, CompressionFilter.COMPRESSION_MAX));
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:10,代码来源:NIOConnection.java


示例19: write

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
/**
 * 发送对象的底层入口
 */
public static boolean write(IoSession session, WriteRequest wr)
{
	if(session.isClosing() || wr == null) return false;
	IoFilterChain ifc = session.getFilterChain();
	synchronized(session)
	{
		ifc.fireFilterWrite(wr);
	}
	return true;
}
 
开发者ID:dwing4g,项目名称:jane,代码行数:14,代码来源:NetManager.java


示例20: addIpAddressFilter

import org.apache.mina.core.filterchain.IoFilterChain; //导入依赖的package包/类
/**
 * IP Address filter.
 * <p>
 * This needs to be the first filter in the chain to block blacklisted host in the early stage of
 * the connection, preventing network and computation load from unwanted hosts.
 */
protected void addIpAddressFilter(IoFilterChain chain) {
  boolean enableIpAddressFilter = Config.getBoolean("proxy.filter.ipaddress.enable", false);

  if (enableIpAddressFilter) {
    if (ipAddressFilter == null) ipAddressFilter = new IpAddressFilter();
    chain.addLast("ipAddressFilter", ipAddressFilter);
  }
}
 
开发者ID:darkmi,项目名称:rtspproxy,代码行数:15,代码来源:RtspFilters.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HeaderContentNegotiationStrategy类代码示例发布时间:2022-05-22
下一篇:
Java SetPermissionRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap