EMMA Coverage Report (generated Fri Oct 21 16:16:13 KST 2005)
[all classes][org.apache.mina.protocol.filter]

COVERAGE SUMMARY FOR SOURCE FILE [ProtocolLoggingFilter.java]

nameclass, %method, %block, %line, %
ProtocolLoggingFilter.java0%   (0/1)0%   (0/9)0%   (0/91)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProtocolLoggingFilter0%   (0/1)0%   (0/9)0%   (0/91)0%   (0/25)
<static initializer> 0%   (0/1)0%   (0/5)0%   (0/2)
ProtocolLoggingFilter (): void 0%   (0/1)0%   (0/3)0%   (0/2)
exceptionCaught (ProtocolFilter$NextFilter, ProtocolSession, Throwable): void 0%   (0/1)0%   (0/9)0%   (0/3)
filterWrite (ProtocolFilter$NextFilter, ProtocolSession, Object): void 0%   (0/1)0%   (0/15)0%   (0/3)
messageReceived (ProtocolFilter$NextFilter, ProtocolSession, Object): void 0%   (0/1)0%   (0/15)0%   (0/3)
messageSent (ProtocolFilter$NextFilter, ProtocolSession, Object): void 0%   (0/1)0%   (0/15)0%   (0/3)
sessionClosed (ProtocolFilter$NextFilter, ProtocolSession): void 0%   (0/1)0%   (0/7)0%   (0/3)
sessionIdle (ProtocolFilter$NextFilter, ProtocolSession, IdleStatus): void 0%   (0/1)0%   (0/15)0%   (0/3)
sessionOpened (ProtocolFilter$NextFilter, ProtocolSession): void 0%   (0/1)0%   (0/7)0%   (0/3)

1/*
2 *   @(#) $Id: ProtocolLoggingFilter.java 327113 2005-10-21 06:59:15Z 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.protocol.filter;
20 
21import org.apache.mina.common.IdleStatus;
22import org.apache.mina.protocol.ProtocolFilter;
23import org.apache.mina.protocol.ProtocolSession;
24import org.apache.mina.util.SessionLog;
25import org.slf4j.Logger;
26 
27/**
28 * Logs all MINA protocol events to {@link Logger}.
29 * 
30 * @author The Apache Directory Project (dev@directory.apache.org)
31 * @version $Rev: 327113 $, $Date: 2005-10-21 15:59:15 +0900 $
32 * 
33 * @see SessionLog
34 */
35public class ProtocolLoggingFilter implements ProtocolFilter
36{
37    /**
38     * Session attribute key: prefix string
39     */
40    public static final String PREFIX = SessionLog.PREFIX;
41 
42    /**
43     * Session attribute key: {@link Logger}
44     */
45    public static final String LOGGER = SessionLog.LOGGER;
46    
47    /**
48     * Creates a new instance.
49     */
50    public ProtocolLoggingFilter()
51    {
52    }
53    
54    public void sessionOpened( NextFilter nextFilter, ProtocolSession session )
55    {
56        SessionLog.info( session, "OPENED" );
57        nextFilter.sessionOpened( session );
58    }
59 
60    public void sessionClosed( NextFilter nextFilter, ProtocolSession session )
61    {
62        SessionLog.info( session, "CLOSED" );
63        nextFilter.sessionClosed( session );
64    }
65 
66    public void sessionIdle( NextFilter nextFilter, ProtocolSession session, IdleStatus status )
67    {
68        SessionLog.info( session, "IDLE: " + status );
69        nextFilter.sessionIdle( session, status );
70    }
71 
72    public void exceptionCaught( NextFilter nextFilter, ProtocolSession session, Throwable cause )
73    {
74        SessionLog.error( session, "EXCEPTION:", cause );
75        nextFilter.exceptionCaught( session, cause );
76    }
77 
78    public void messageReceived( NextFilter nextFilter, ProtocolSession session, Object message )
79    {
80        SessionLog.info( session, "RECEIVED: " + message );
81        nextFilter.messageReceived( session, message );
82    }
83 
84    public void messageSent( NextFilter nextFilter, ProtocolSession session, Object message )
85    {
86        SessionLog.info( session, "SENT: " + message );
87        nextFilter.messageSent( session, message );
88    }
89 
90    public void filterWrite( NextFilter nextFilter, ProtocolSession session, Object message)
91    {
92        SessionLog.info( session, "WRITE: " + message );
93        nextFilter.filterWrite( session, message );
94    }
95}

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