org.jboss.remoting.transport.multiplex
Class VirtualServerSocket

java.lang.Object
  extended by java.net.ServerSocket
      extended by org.jboss.remoting.transport.multiplex.VirtualServerSocket
All Implemented Interfaces:
java.io.Serializable

public class VirtualServerSocket
extends java.net.ServerSocket
implements java.io.Serializable

Copyright (c) 2005

Author:
Ron Sigal
See Also:
Serialized Form

Nested Class Summary
protected  class VirtualServerSocket.PendingClose
           
 
Constructor Summary
VirtualServerSocket()
           
VirtualServerSocket(java.net.InetSocketAddress remoteAddress, java.net.InetSocketAddress localAddress, int timeout)
          Create a new VirtualServerSocket.
VirtualServerSocket(int port)
          Create a new VirtualServerSocket.
VirtualServerSocket(int port, int backlog)
           
VirtualServerSocket(int port, int backlog, java.net.InetAddress bindAddr)
           
VirtualServerSocket(VirtualSocket socket)
           
 
Method Summary
 java.net.Socket accept()
           
 void bind(java.net.SocketAddress socketAddress)
           
 void bind(java.net.SocketAddress socketAddress, int backlog)
           
 void close()
           
 void connect(java.net.SocketAddress remoteAddress)
          Connects this socket to the server.
 void connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
          Connects this socket to the server.
 void connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, int timeout)
          Connects this socket to the server with a specified timeout value.
protected  void doClose()
           
 java.nio.channels.ServerSocketChannel getChannel()
           
 java.net.InetAddress getInetAddress()
           
 int getLocalPort()
           
 java.net.SocketAddress getLocalSocketAddress()
           
 MultiplexingManager getMultiplexingManager()
           
 int getReceiveBufferSize()
           
 java.net.InetAddress getRemoteAddress()
           
 int getRemotePort()
           
 boolean getReuseAddress()
           
 javax.net.SocketFactory getSocketFactory()
           
 int getSoTimeout()
           
 boolean isBound()
           
 boolean isClosed()
           
 boolean isConnected()
          Returns the connected state of the socket.
 void setReceiveBufferSize(int size)
           
 void setReuseAddress(boolean on)
           
 void setSocketFactory(javax.net.SocketFactory socketFactory)
           
 void setSoTimeout(int timeout)
           
 java.lang.String toString()
           
 
Methods inherited from class java.net.ServerSocket
implAccept, setPerformancePreferences, setSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualServerSocket

public VirtualServerSocket()
                    throws java.io.IOException
Throws:
java.io.IOException

VirtualServerSocket

public VirtualServerSocket(int port)
                    throws java.io.IOException
Create a new VirtualServerSocket.

Parameters:
port -
Throws:
java.io.IOException

VirtualServerSocket

public VirtualServerSocket(int port,
                           int backlog)
                    throws java.io.IOException
Parameters:
port -
backlog -
Throws:
java.io.IOException

VirtualServerSocket

public VirtualServerSocket(int port,
                           int backlog,
                           java.net.InetAddress bindAddr)
                    throws java.io.IOException
Parameters:
port -
backlog -
bindAddr -
Throws:
java.io.IOException

VirtualServerSocket

public VirtualServerSocket(VirtualSocket socket)
                    throws java.io.IOException
Throws:
java.io.IOException

VirtualServerSocket

public VirtualServerSocket(java.net.InetSocketAddress remoteAddress,
                           java.net.InetSocketAddress localAddress,
                           int timeout)
                    throws java.io.IOException
Create a new VirtualServerSocket.

Parameters:
timeout - TODO
port -
Throws:
java.io.IOException
Method Detail

accept

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

bind

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

bind

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

close

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

getInetAddress

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

getLocalPort

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

getChannel

public java.nio.channels.ServerSocketChannel getChannel()
Overrides:
getChannel in class java.net.ServerSocket

getLocalSocketAddress

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

getReceiveBufferSize

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

getReuseAddress

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

getSoTimeout

public int getSoTimeout()
                 throws java.net.SocketException
Overrides:
getSoTimeout in class java.net.ServerSocket
Throws:
java.net.SocketException

isBound

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

isClosed

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

setReceiveBufferSize

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

setReuseAddress

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

setSoTimeout

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

toString

public java.lang.String toString()
Overrides:
toString in class java.net.ServerSocket

connect

public void connect(java.net.SocketAddress remoteAddress)
             throws java.io.IOException
Connects this socket to the server.

Parameters:
socketAddress - the SocketAddress
Throws:
java.io.IOException - if an error occurs during the connection
java.lang.IllegalArgumentException - if endpoint is null or is a SocketAddress subclass not supported by this socket

connect

public void connect(java.net.SocketAddress remoteAddress,
                    java.net.SocketAddress localAddress)
             throws java.io.IOException
Connects this socket to the server.

Parameters:
socketAddress - the SocketAddress
Throws:
java.io.IOException - if an error occurs during the connection
java.lang.IllegalArgumentException - if endpoint is null or is a SocketAddress subclass not supported by this socket

connect

public void connect(java.net.SocketAddress remoteAddress,
                    java.net.SocketAddress localAddress,
                    int timeout)
             throws java.io.IOException
Connects this socket to the server with a specified timeout value. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs.

Parameters:
remoteAddress - the SocketAddress
localAddress - TODO
timeout - the timeout value to be used in milliseconds.
Throws:
java.io.IOException - if an error occurs during the connection
java.net.SocketTimeoutException - if timeout expires before connecting
java.lang.IllegalArgumentException - if endpoint is null or is a SocketAddress subclass not supported by this socket

getMultiplexingManager

public MultiplexingManager getMultiplexingManager()
Returns:

isConnected

public boolean isConnected()
Returns the connected state of the socket.


getRemoteAddress

public java.net.InetAddress getRemoteAddress()
Returns:

getRemotePort

public int getRemotePort()
Returns:

getSocketFactory

public javax.net.SocketFactory getSocketFactory()
Returns:

setSocketFactory

public void setSocketFactory(javax.net.SocketFactory socketFactory)
Parameters:
socketFactory -

doClose

protected void doClose()


Copyright ? 1998-2005 JBoss Inc . All Rights Reserved.