EMMA Coverage Report (generated Tue Dec 20 11:01:01 KST 2005)
[all classes][org.apache.mina.io.filter]

COVERAGE SUMMARY FOR SOURCE FILE [IoLoggingFilter.java]

nameclass, %method, %block, %line, %
IoLoggingFilter.java0%   (0/1)0%   (0/9)0%   (0/98)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class IoLoggingFilter0%   (0/1)0%   (0/9)0%   (0/98)0%   (0/25)
<static initializer> 0%   (0/1)0%   (0/5)0%   (0/2)
IoLoggingFilter (): void 0%   (0/1)0%   (0/3)0%   (0/2)
dataRead (IoFilter$NextFilter, IoSession, ByteBuffer): void 0%   (0/1)0%   (0/16)0%   (0/3)
dataWritten (IoFilter$NextFilter, IoSession, Object): void 0%   (0/1)0%   (0/15)0%   (0/3)
exceptionCaught (IoFilter$NextFilter, IoSession, Throwable): void 0%   (0/1)0%   (0/9)0%   (0/3)
filterWrite (IoFilter$NextFilter, IoSession, ByteBuffer, Object): void 0%   (0/1)0%   (0/21)0%   (0/3)
sessionClosed (IoFilter$NextFilter, IoSession): void 0%   (0/1)0%   (0/7)0%   (0/3)
sessionIdle (IoFilter$NextFilter, IoSession, IdleStatus): void 0%   (0/1)0%   (0/15)0%   (0/3)
sessionOpened (IoFilter$NextFilter, IoSession): void 0%   (0/1)0%   (0/7)0%   (0/3)

1/*
2 *   @(#) $Id: IoLoggingFilter.java 357871 2005-12-20 01:56:40Z trustin $
3 *
4 *   Copyright 2004 The Apache Software Foundation
5 *
6 *   Licensed under the Apache License, Version 2.0 (the "License");
7 *   you may not use this file except in compliance with the License.
8 *   You may obtain a copy of the License at
9 *
10 *       http://www.apache.org/licenses/LICENSE-2.0
11 *
12 *   Unless required by applicable law or agreed to in writing, software
13 *   distributed under the License is distributed on an "AS IS" BASIS,
14 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 *   See the License for the specific language governing permissions and
16 *   limitations under the License.
17 *
18 */
19package org.apache.mina.io.filter;
20 
21import org.apache.mina.common.ByteBuffer;
22import org.apache.mina.common.IdleStatus;
23import org.apache.mina.io.IoFilter;
24import org.apache.mina.io.IoSession;
25import org.apache.mina.util.SessionLog;
26import org.slf4j.Logger;
27 
28/**
29 * Logs all MINA I/O events to {@link Logger}.
30 * 
31 * @author The Apache Directory Project (dev@directory.apache.org)
32 * @version $Rev: 357871 $, $Date: 2005-12-20 10:56:40 +0900 (Tue, 20 Dec 2005) $
33 * 
34 * @see SessionLog
35 */
36public class IoLoggingFilter implements IoFilter
37{
38    /**
39     * Session attribute key: prefix string
40     */
41    public static final String PREFIX = SessionLog.PREFIX;
42 
43    /**
44     * Session attribute key: {@link Logger}
45     */
46    public static final String LOGGER = SessionLog.LOGGER;
47    
48    /**
49     * Creates a new instance.
50     */
51    public IoLoggingFilter()
52    {
53    }
54    
55    public void sessionOpened( NextFilter nextFilter, IoSession session )
56    {
57        SessionLog.info( session, "OPENED" );
58        nextFilter.sessionOpened( session );
59    }
60 
61    public void sessionClosed( NextFilter nextFilter, IoSession session )
62    {
63        SessionLog.info( session, "CLOSED" );
64        nextFilter.sessionClosed( session );
65    }
66 
67    public void sessionIdle( NextFilter nextFilter, IoSession session, IdleStatus status )
68    {
69        SessionLog.info( session, "IDLE: " + status );
70        nextFilter.sessionIdle( session, status );
71    }
72 
73    public void exceptionCaught( NextFilter nextFilter, IoSession session, Throwable cause )
74    {
75        SessionLog.error( session, "EXCEPTION: ", cause );
76        nextFilter.exceptionCaught( session, cause );
77    }
78 
79    public void dataRead( NextFilter nextFilter, IoSession session, ByteBuffer buf)
80    {
81        SessionLog.info( session, "READ: " + buf.getHexDump() );
82        nextFilter.dataRead( session, buf );
83    }
84 
85    public void dataWritten( NextFilter nextFilter, IoSession session, Object marker)
86    {
87        SessionLog.info( session, "WRITTEN: " + marker );
88        nextFilter.dataWritten( session, marker );
89    }
90 
91    public void filterWrite( NextFilter nextFilter, IoSession session, ByteBuffer buf, Object marker)
92    {
93        SessionLog.info( session, "WRITE: " + marker + ", " + buf.getHexDump() );
94        nextFilter.filterWrite( session, buf, marker );
95    }
96}

[all classes][org.apache.mina.io.filter]
EMMA 2.0.4217 (C) Vladimir Roubtsov