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

COVERAGE SUMMARY FOR SOURCE FILE [SocketSessionConfig.java]

nameclass, %method, %block, %line, %
SocketSessionConfig.java100% (1/1)26%  (5/19)24%  (32/135)36%  (12/33)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SocketSessionConfig100% (1/1)26%  (5/19)24%  (32/135)36%  (12/33)
getKeepAlive (): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
getOOBInline (): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
getReceiveBufferSize (): int 0%   (0/1)0%   (0/6)0%   (0/1)
getReuseAddress (): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
getSendBufferSize (): int 0%   (0/1)0%   (0/6)0%   (0/1)
getSoLinger (): int 0%   (0/1)0%   (0/6)0%   (0/1)
getTcpNoDelay (): boolean 0%   (0/1)0%   (0/6)0%   (0/1)
getTrafficClass (): int 0%   (0/1)0%   (0/6)0%   (0/1)
setOOBInline (boolean): void 0%   (0/1)0%   (0/7)0%   (0/2)
setReceiveBufferSize (int): void 0%   (0/1)0%   (0/7)0%   (0/2)
setSendBufferSize (int): void 0%   (0/1)0%   (0/7)0%   (0/2)
setSoLinger (boolean, int): void 0%   (0/1)0%   (0/8)0%   (0/2)
setTcpNoDelay (boolean): void 0%   (0/1)0%   (0/7)0%   (0/2)
setTrafficClass (int): void 0%   (0/1)0%   (0/7)0%   (0/2)
setSessionReceiveBufferSize (int): void 100% (1/1)33%  (6/18)75%  (3/4)
SocketSessionConfig (SocketSession): void 100% (1/1)100% (9/9)100% (4/4)
getSessionReceiveBufferSize (): int 100% (1/1)100% (3/3)100% (1/1)
setKeepAlive (boolean): void 100% (1/1)100% (7/7)100% (2/2)
setReuseAddress (boolean): void 100% (1/1)100% (7/7)100% (2/2)

1/*
2 *   @(#) $Id: SocketSessionConfig.java 264677 2005-08-30 02:44:35Z 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.socket;
20 
21import java.net.SocketException;
22 
23import org.apache.mina.common.BaseSessionConfig;
24import org.apache.mina.common.SessionConfig;
25import org.apache.mina.io.IoSession;
26import org.apache.mina.protocol.ProtocolSession;
27 
28/**
29 * A {@link SessionConfig} for socket transport (TCP/IP).
30 * You can downcast {@link SessionConfig} instance returned by
31 * {@link IoSession#getConfig()} or {@link ProtocolSession#getConfig()}
32 * if you've created datagram session using {@link SocketAcceptor} or 
33 * {@link SocketConnector}.
34 * 
35 * @author Trustin Lee (trustin@apache.org)
36 * @version $Rev: 264677 $, $Date: 2005-08-30 11:44:35 +0900 $,
37 */
38public class SocketSessionConfig extends BaseSessionConfig
39{
40    private static final int DEFAULT_READ_BUFFER_SIZE = 1024;
41 
42    private final SocketSession session;
43    
44    private int readBufferSize = DEFAULT_READ_BUFFER_SIZE;
45 
46    SocketSessionConfig( SocketSession session )
47    {
48        this.session = session;
49    }
50 
51    public boolean getKeepAlive() throws SocketException
52    {
53        return session.getChannel().socket().getKeepAlive();
54    }
55 
56    public void setKeepAlive( boolean on ) throws SocketException
57    {
58        session.getChannel().socket().setKeepAlive( on );
59    }
60 
61    public boolean getOOBInline() throws SocketException
62    {
63        return session.getChannel().socket().getOOBInline();
64    }
65 
66    public void setOOBInline( boolean on ) throws SocketException
67    {
68        session.getChannel().socket().setOOBInline( on );
69    }
70 
71    public boolean getReuseAddress() throws SocketException
72    {
73        return session.getChannel().socket().getReuseAddress();
74    }
75 
76    public void setReuseAddress( boolean on ) throws SocketException
77    {
78        session.getChannel().socket().setReuseAddress( on );
79    }
80 
81    public int getSoLinger() throws SocketException
82    {
83        return session.getChannel().socket().getSoLinger();
84    }
85 
86    public void setSoLinger( boolean on, int linger ) throws SocketException
87    {
88        session.getChannel().socket().setSoLinger( on, linger );
89    }
90 
91    public boolean getTcpNoDelay() throws SocketException
92    {
93        return session.getChannel().socket().getTcpNoDelay();
94    }
95 
96    public void setTcpNoDelay( boolean on ) throws SocketException
97    {
98        session.getChannel().socket().setTcpNoDelay( on );
99    }
100 
101    public int getTrafficClass() throws SocketException
102    {
103        return session.getChannel().socket().getTrafficClass();
104    }
105 
106    public void setTrafficClass( int tc ) throws SocketException
107    {
108        session.getChannel().socket().setTrafficClass( tc );
109    }
110 
111    public int getSendBufferSize() throws SocketException
112    {
113        return session.getChannel().socket().getSendBufferSize();
114    }
115 
116    public void setSendBufferSize( int size ) throws SocketException
117    {
118        session.getChannel().socket().setSendBufferSize( size );
119    }
120 
121    public int getReceiveBufferSize() throws SocketException
122    {
123        return session.getChannel().socket().getReceiveBufferSize();
124    }
125 
126    public void setReceiveBufferSize( int size ) throws SocketException
127    {
128        session.getChannel().socket().setReceiveBufferSize( size );
129    }
130    
131    public int getSessionReceiveBufferSize()
132    {
133        return readBufferSize;
134    }
135    
136    public void setSessionReceiveBufferSize( int size )
137    {
138        if( size <= 0 )
139        {
140            throw new IllegalArgumentException( "Invalid session receive buffer size: " + size );
141        }
142        
143        this.readBufferSize = size;
144    }
145}

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