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


Java IoFilterChain.fireExceptionCaught方法代码示例

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


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

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

示例2: flush

import org.apache.mina.core.filterchain.IoFilterChain; //导入方法依赖的package包/类
/**
 * Write all the pending messages
 */
private void flush(long currentTime) {
    if (flushingSessions.isEmpty()) {
        return;
    }

    do {
        S session = flushingSessions.poll(); // the same one with firstSession

        if (session == null) {
            // Just in case ... It should not happen.
            break;
        }

        // Reset the Schedule for flush flag for this session,
        // as we are flushing it now
        session.unscheduledForFlush();

        SessionState state = getState(session);

        switch (state) {
        case OPENED:
            try {
                boolean flushedAll = flushNow(session, currentTime);

                if (flushedAll && !session.getWriteRequestQueue().isEmpty(session)
                        && !session.isScheduledForFlush()) {
                    scheduleFlush(session);
                }
            } catch (Exception e) {
                scheduleRemove(session);
                IoFilterChain filterChain = session.getFilterChain();
                filterChain.fireExceptionCaught(e);
            }

            break;

        case CLOSING:
            // Skip if the channel is already closed.
            break;

        case OPENING:
            // Retry later if session is not yet fully initialized.
            // (In case that Session.write() is called before addSession()
            // is processed)
            scheduleFlush(session);
            return;

        default:
            throw new IllegalStateException(String.valueOf(state));
        }

    } while (!flushingSessions.isEmpty());
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:57,代码来源:AbstractPollingIoProcessor.java


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