org.sapia.ubik.net.mplex
Class ServerSocketAdapter

java.lang.Object
  extended by java.net.ServerSocket
      extended by org.sapia.ubik.net.mplex.ServerSocketAdapter

public class ServerSocketAdapter
extends java.net.ServerSocket

This utility class adapts a MultiplexSocketConnector to a java.net.ServerSocket. That means that a socket connector, that was previously created with a multiplex server socket, can be used as a traditionnal server socket. This adapter can be useful when integrating the multiplex module into existing code that rely on the java.net.ServerSocket object.

Note that the following methods are not supported:

Calling any of these methods will result in an UnsupportedOperationException beign thrown.

Author:
Jean-Cedric Desrochers
Copyright:
Copyright © 2002-2004 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
ServerSocketAdapter(MultiplexSocketConnector anInterceptor)
          Creates a new ServerSocketAdapter instance.
 
Method Summary
 java.net.Socket accept()
           
 void bind(java.net.SocketAddress endpoint)
           
 void bind(java.net.SocketAddress endpoint, int backlog)
           
 void close()
           
 java.net.InetAddress getInetAddress()
           
 int getLocalPort()
           
 java.net.SocketAddress getLocalSocketAddress()
           
 int getReceiveBufferSize()
           
 boolean getReuseAddress()
           
 int getSoTimeout()
           
 boolean isBound()
           
 boolean isClosed()
           
 void setReceiveBufferSize(int size)
           
 void setReuseAddress(boolean on)
           
 void setSoTimeout(int timeout)
           
 
Methods inherited from class java.net.ServerSocket
getChannel, implAccept, setPerformancePreferences, setSocketFactory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerSocketAdapter

public ServerSocketAdapter(MultiplexSocketConnector anInterceptor)
                    throws java.io.IOException
Creates a new ServerSocketAdapter instance.

Throws:
java.io.IOException
Method Detail

bind

public void bind(java.net.SocketAddress endpoint)
          throws java.io.IOException
Overrides:
bind in class java.net.ServerSocket
Throws:
java.io.IOException
See Also:
ServerSocket.bind(java.net.SocketAddress)

bind

public void bind(java.net.SocketAddress endpoint,
                 int backlog)
          throws java.io.IOException
Overrides:
bind in class java.net.ServerSocket
Throws:
java.io.IOException
See Also:
ServerSocket.bind(java.net.SocketAddress, int)

getInetAddress

public java.net.InetAddress getInetAddress()
Overrides:
getInetAddress in class java.net.ServerSocket
See Also:
ServerSocket.getInetAddress()

getLocalPort

public int getLocalPort()
Overrides:
getLocalPort in class java.net.ServerSocket
See Also:
ServerSocket.getLocalPort()

getLocalSocketAddress

public java.net.SocketAddress getLocalSocketAddress()
Overrides:
getLocalSocketAddress in class java.net.ServerSocket
See Also:
ServerSocket.getLocalSocketAddress()

accept

public java.net.Socket accept()
                       throws java.io.IOException
Overrides:
accept in class java.net.ServerSocket
Throws:
java.io.IOException
See Also:
ServerSocket.accept()

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.net.ServerSocket
Throws:
java.io.IOException
See Also:
ServerSocket.close()

isBound

public boolean isBound()
Overrides:
isBound in class java.net.ServerSocket
See Also:
ServerSocket.isBound()

isClosed

public boolean isClosed()
Overrides:
isClosed in class java.net.ServerSocket
See Also:
ServerSocket.isClosed()

setSoTimeout

public void setSoTimeout(int timeout)
                  throws java.net.SocketException
Overrides:
setSoTimeout in class java.net.ServerSocket
Throws:
java.net.SocketException
See Also:
ServerSocket.setSoTimeout(int)

getSoTimeout

public int getSoTimeout()
                 throws java.io.IOException
Overrides:
getSoTimeout in class java.net.ServerSocket
Throws:
java.io.IOException
See Also:
ServerSocket.getSoTimeout()

setReuseAddress

public void setReuseAddress(boolean on)
                     throws java.net.SocketException
Overrides:
setReuseAddress in class java.net.ServerSocket
Throws:
java.net.SocketException
See Also:
ServerSocket.setReuseAddress(boolean)

getReuseAddress

public boolean getReuseAddress()
                        throws java.net.SocketException
Overrides:
getReuseAddress in class java.net.ServerSocket
Throws:
java.net.SocketException
See Also:
ServerSocket.getReuseAddress()

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws java.net.SocketException
Overrides:
setReceiveBufferSize in class java.net.ServerSocket
Throws:
java.net.SocketException
See Also:
ServerSocket.setReceiveBufferSize(int)

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws java.net.SocketException
Overrides:
getReceiveBufferSize in class java.net.ServerSocket
Throws:
java.net.SocketException
See Also:
ServerSocket.getReceiveBufferSize()


Copyright © 2010 Sapia OSS. All Rights Reserved.