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


Java IoFilterChain.contains方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例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(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

示例7: 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

示例8: 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

示例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.");
	}
	parent.getSession().setAttribute(STATE, new State());
	adjustReadBufferSize(parent.getSession());
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:9,代码来源:TrafficShapingFilter.java

示例10: onPreAdd

import org.apache.mina.core.filterchain.IoFilterChain; //导入方法依赖的package包/类
/**
 * Called before the filter is added into the filter chain.
 * Checks if chain already holds an {@link ProxyFilter} instance. 
 * 
 * @param chain the filter chain
 * @param name the name assigned to this filter
 * @param nextFilter the next filter
 * @throws IllegalStateException if chain already contains an instance of 
 * {@link ProxyFilter}
 */
@Override
public void onPreAdd(final IoFilterChain chain, final String name, final NextFilter nextFilter) {
    if (chain.contains(ProxyFilter.class)) {
        throw new IllegalStateException("A filter chain cannot contain more than one ProxyFilter.");
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:ProxyFilter.java


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