KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > channel > TCPAcceptSocketAttributeController


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact : dream@objectweb.org
20  *
21  * Initial developer(s): Matthieu Leclercq
22  * Contributor(s): Vivien Quema
23  */

24
25 package org.objectweb.dream.channel;
26
27 import org.objectweb.fractal.api.control.AttributeController;
28 import org.objectweb.fractal.api.control.IllegalLifeCycleException;
29
30 /**
31  * Attribute controller for IP Accept Socket, It defines the listening port.
32  */

33 public interface TCPAcceptSocketAttributeController extends AttributeController
34 {
35   /** Default value of <code>openRetry</code> attribute. */
36   int OPEN_RETRY_DEFAULT = 5;
37
38   /**
39    * Returns the listening port.
40    *
41    * @return the <code>listeningPort</code> attribute's value.
42    */

43   int getListeningPort();
44
45   /**
46    * Sets the <code>listeningPort</code> attribute's value.
47    *
48    * @param port the new <code>listeningPort</code> attribute's value.
49    * @throws IllegalLifeCycleException cannot change port number if the
50    * component is started.
51    * @see #getListeningPort()
52    */

53   void setListeningPort(int port) throws IllegalLifeCycleException;
54
55   /**
56    * Returns the number of attempts to open a {@link java.net.ServerSocket }
57    * before aborting.
58    *
59    * @return the <code>openRetry</code> attribute's value.
60    */

61   int getOpenRetry();
62
63   /**
64    * Sets the <code>openRetry</code> attribute's value.
65    *
66    * @param retry the new <code>openRetry</code> attribute's value.
67    * @see #getOpenRetry()
68    */

69   void setOpenRetry(int retry);
70
71   /**
72    * Returns <code>true</code> if the Nagle's algorithm is disabled on created
73    * sockets.
74    *
75    * @return the <code>tcpNoDelay</code> attribute's value.
76    * @see java.net.Socket#setTcpNoDelay(boolean)
77    */

78   boolean getTcpNoDelay();
79
80   /**
81    * Sets the <code>tcpNoDelay</code> attribute's value.
82    *
83    * @param tcpNoDelay the new <code>tcpNoDelay</code> attribute's value.
84    * @see #getTcpNoDelay()
85    */

86   void setTcpNoDelay(boolean tcpNoDelay);
87
88   /**
89    * Returns the <code>SO_TIMEOUT</code> parameter setted on created sockets.
90    *
91    * @return the <code>soTimeout</code> attribute's value.
92    * @see java.net.Socket#setSoTimeout(int)
93    */

94   int getSoTimeout();
95
96   /**
97    * Sets the <code>soTimeout</code> attribute's value.
98    *
99    * @param timeout the new <code>soTimeout</code> attribute's value.
100    * @see #getSoTimeout()
101    */

102   void setSoTimeout(int timeout);
103
104   /**
105    * Returns the <code>SO_LINGER</code> parameter setted on created sockets. A
106    * negative value disable the linger on close.
107    *
108    * @return the <code>soLinger</code> attribute's value.
109    * @see java.net.Socket#setSoLinger(boolean, int)
110    */

111   int getSoLinger();
112
113   /**
114    * Sets the <code>soLinger</code> attribute's value.
115    *
116    * @param timeout the new <code>soLinger</code> attribute's value.
117    */

118   void setSoLinger(int timeout);
119 }
Popular Tags