EMMA Coverage Report (generated Sat Sep 03 11:42:34 KST 2005)
[all classes][org.apache.mina.protocol.io]

COVERAGE SUMMARY FOR SOURCE FILE [IoProtocolSession.java]

nameclass, %method, %block, %line, %
IoProtocolSession.java0%   (0/1)0%   (0/28)0%   (0/153)0%   (0/40)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class IoProtocolSession0%   (0/1)0%   (0/28)0%   (0/153)0%   (0/40)
IoProtocolSession (ProtocolSessionManagerFilterChain, IoSession, IoAdapter$Se... 0%   (0/1)0%   (0/40)0%   (0/10)
close (): void 0%   (0/1)0%   (0/4)0%   (0/2)
close (boolean): void 0%   (0/1)0%   (0/5)0%   (0/2)
getAttachment (): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getAttribute (String): Object 0%   (0/1)0%   (0/5)0%   (0/1)
getAttributeKeys (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
getConfig (): SessionConfig 0%   (0/1)0%   (0/4)0%   (0/1)
getDecoder (): ProtocolDecoder 0%   (0/1)0%   (0/3)0%   (0/1)
getEncoder (): ProtocolEncoder 0%   (0/1)0%   (0/3)0%   (0/1)
getFilterChain (): ProtocolFilterChain 0%   (0/1)0%   (0/3)0%   (0/1)
getHandler (): ProtocolHandler 0%   (0/1)0%   (0/4)0%   (0/1)
getIoSession (): IoSession 0%   (0/1)0%   (0/3)0%   (0/1)
getLastIoTime (): long 0%   (0/1)0%   (0/4)0%   (0/1)
getLastReadTime (): long 0%   (0/1)0%   (0/4)0%   (0/1)
getLastWriteTime (): long 0%   (0/1)0%   (0/4)0%   (0/1)
getLocalAddress (): SocketAddress 0%   (0/1)0%   (0/4)0%   (0/1)
getReadBytes (): long 0%   (0/1)0%   (0/4)0%   (0/1)
getRemoteAddress (): SocketAddress 0%   (0/1)0%   (0/4)0%   (0/1)
getScheduledWriteRequests (): int 0%   (0/1)0%   (0/4)0%   (0/1)
getTransportType (): TransportType 0%   (0/1)0%   (0/4)0%   (0/1)
getWrittenBytes (): long 0%   (0/1)0%   (0/4)0%   (0/1)
getWrittenWriteRequests (): long 0%   (0/1)0%   (0/4)0%   (0/1)
isConnected (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
isIdle (IdleStatus): boolean 0%   (0/1)0%   (0/5)0%   (0/1)
removeAttribute (String): Object 0%   (0/1)0%   (0/5)0%   (0/1)
setAttachment (Object): Object 0%   (0/1)0%   (0/5)0%   (0/1)
setAttribute (String, Object): Object 0%   (0/1)0%   (0/6)0%   (0/1)
write (Object): void 0%   (0/1)0%   (0/6)0%   (0/2)

1/**
2 * 
3 */
4package org.apache.mina.protocol.io;
5 
6import java.net.SocketAddress;
7import java.util.Set;
8 
9import org.apache.mina.common.IdleStatus;
10import org.apache.mina.common.SessionConfig;
11import org.apache.mina.common.TransportType;
12import org.apache.mina.io.IoSession;
13import org.apache.mina.protocol.ProtocolDecoder;
14import org.apache.mina.protocol.ProtocolEncoder;
15import org.apache.mina.protocol.ProtocolHandler;
16import org.apache.mina.protocol.ProtocolFilterChain;
17import org.apache.mina.protocol.ProtocolSession;
18import org.apache.mina.protocol.ProtocolSessionFilterChain;
19import org.apache.mina.protocol.ProtocolSessionManagerFilterChain;
20import org.apache.mina.protocol.SimpleProtocolDecoderOutput;
21import org.apache.mina.protocol.SimpleProtocolEncoderOutput;
22import org.apache.mina.protocol.io.IoAdapter.SessionHandlerAdapter;
23import org.apache.mina.util.Queue;
24 
25/**
26 * A {@link ProtocolSession} that is backed by {@link IoSession}.
27 * 
28 * @author Trustin Lee (trustin@apache.org)
29 * @version $Rev: 264677 $, $Date: 2005-08-30 11:44:35 +0900 $
30 */
31public class IoProtocolSession implements ProtocolSession
32{
33    private final ProtocolSessionFilterChain filterChain;
34 
35    final IoSession session;
36 
37    final SessionHandlerAdapter shAdapter;
38 
39    final Queue writeQueue = new Queue();
40    
41    final ProtocolEncoder encoder;
42    
43    final ProtocolDecoder decoder;
44 
45    final SimpleProtocolEncoderOutput encOut;
46 
47    final SimpleProtocolDecoderOutput decOut;
48 
49    IoProtocolSession( ProtocolSessionManagerFilterChain managerFilterChain,
50                       IoSession session, SessionHandlerAdapter shAdapter )
51    {
52        this.filterChain = new ProtocolSessionFilterChain( managerFilterChain );
53        this.session = session;
54        this.shAdapter = shAdapter;
55        this.encoder = shAdapter.codecFactory.newEncoder();
56        this.decoder = shAdapter.codecFactory.newDecoder();
57        this.encOut = new SimpleProtocolEncoderOutput();
58        this.decOut = new SimpleProtocolDecoderOutput();
59    }
60    
61    /**
62     * Returns the {@link IoSession} this session is backed by.
63     */
64    public IoSession getIoSession()
65    {
66        return session;   
67    }
68    
69    public ProtocolFilterChain getFilterChain()
70    {
71        return filterChain;
72    }
73 
74    public ProtocolHandler getHandler()
75    {
76        return shAdapter.handler;
77    }
78 
79    public ProtocolEncoder getEncoder()
80    {
81        return encoder;
82    }
83 
84    public ProtocolDecoder getDecoder()
85    {
86        return decoder;
87    }
88 
89    public void close()
90    {
91        session.close();
92    }
93    
94    public void close( boolean wait )
95    {
96        session.close( wait );
97    }
98 
99    public Object getAttachment()
100    {
101        return session.getAttachment();
102    }
103 
104    public Object setAttachment( Object attachment )
105    {
106        return session.setAttachment( attachment );
107    }
108 
109    public Object getAttribute( String key )
110    {
111        return session.getAttribute( key );
112    }
113 
114    public Object setAttribute( String key, Object value )
115    {
116        return session.setAttribute( key, value );
117    }
118    
119    public Object removeAttribute( String key )
120    {
121        return session.removeAttribute( key );
122    }
123 
124    public Set getAttributeKeys()
125    {
126        return session.getAttributeKeys();
127    }
128 
129    public void write( Object message )
130    {
131        filterChain.filterWrite( this, message );
132    }
133 
134    public long getWrittenWriteRequests()
135    {
136        return session.getWrittenWriteRequests();
137    }
138 
139    public int getScheduledWriteRequests()
140    {
141        return session.getScheduledWriteRequests();
142    }
143 
144    public TransportType getTransportType()
145    {
146        return session.getTransportType();
147    }
148 
149    public boolean isConnected()
150    {
151        return session.isConnected();
152    }
153 
154    public SessionConfig getConfig()
155    {
156        return session.getConfig();
157    }
158 
159    public SocketAddress getRemoteAddress()
160    {
161        return session.getRemoteAddress();
162    }
163 
164    public SocketAddress getLocalAddress()
165    {
166        return session.getLocalAddress();
167    }
168 
169    public long getReadBytes()
170    {
171        return session.getReadBytes();
172    }
173 
174    public long getWrittenBytes()
175    {
176        return session.getWrittenBytes();
177    }
178 
179    public long getLastIoTime()
180    {
181        return session.getLastIoTime();
182    }
183 
184    public long getLastReadTime()
185    {
186        return session.getLastReadTime();
187    }
188 
189    public long getLastWriteTime()
190    {
191        return session.getLastWriteTime();
192    }
193 
194    public boolean isIdle( IdleStatus status )
195    {
196        return session.isIdle( status );
197    }
198}

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