sunlabs.brazil.servlet
Class BServletSocket

java.lang.Object
  extended by java.net.Socket
      extended by sunlabs.brazil.servlet.BServletSocket (view source)

public class BServletSocket
extends Socket

This is a special Socket intended for use by the Brazil Servlet Adapter. It provides dummy methods for the Socket operations used by the Brazil Toolkit. Do not use this class for anything other than it's intended use as a Socket object that is passed to the constructor of a Request object by the BServletRequest's constructor.

See Also:
Socket, BServletServerSocket, BrazilServlet, BServletRequest, Request

Constructor Summary
BServletSocket(HttpServletRequest req, HttpServletResponse res)
          Creates a BServletSocket object.
 
Method Summary
 void close()
          Closes this socket.
 InetAddress getInetAddress()
          Returns the address to which the socket is connected.
 InputStream getInputStream()
          Returns an input stream for this socket.
 boolean getKeepAlive()
          Dummy method, not implemented.
 InetAddress getLocalAddress()
          Returns the local address to which the socket is bound.
 int getLocalPort()
          Returns the local port to which this socket is bound.
 OutputStream getOutputStream()
          Returns an output stream for this socket.
 int getPort()
          Returns the remote port to which this socket is connected.
 int getReceiveBufferSize()
          Dummy method, not implemented.
 int getSendBufferSize()
          Dummy method, not implemented.
 int getSoLinger()
          Dummy method, not implemented.
 int getSoTimeout()
          Dummy method, not implemented.
 boolean getTcpNoDelay()
          Dummy method, not implemented.
 void setKeepAlive(boolean on)
          Dummy method, not implemented.
 void setReceiveBufferSize(int size)
          Dummy method, not implemented.
 void setSendBufferSize(int size)
          Dummy method, not implemented.
 void setSoLinger(boolean on, int linger)
          Dummy method, not implemented.
 void setSoTimeout(int timeout)
          Dummy method, not implemented.
 void setTcpNoDelay(boolean on)
          Dummy method, not implemented.
 void shutdownInput()
          Dummy method, not implemented.
 void shutdownOutput()
          Dummy method, not implemented.
 String toString()
          Converts this socket to a String.
 
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BServletSocket

public BServletSocket(HttpServletRequest req,
                      HttpServletResponse res)
               throws UnknownHostException,
                      IOException
Creates a BServletSocket object.

Parameters:
req - the HttpServletRequest passed to BrazilServlet by the servlet container.
res - the HttpServletResponse passed to BrazilServlet by the servlet container.
Throws:
UnknownHostException
IOException
See Also:
BrazilServlet
Method Detail

getInetAddress

public InetAddress getInetAddress()
Returns the address to which the socket is connected.

Overrides:
getInetAddress in class Socket
Returns:
the remote IP address to which this socket is connected.

getLocalAddress

public InetAddress getLocalAddress()
Returns the local address to which the socket is bound.

Overrides:
getLocalAddress in class Socket
Returns:
the local address to which the socket is bound.

getPort

public int getPort()
Returns the remote port to which this socket is connected.

Overrides:
getPort in class Socket
Returns:
the remote port number to which this socket is connected.

getLocalPort

public int getLocalPort()
Returns the local port to which this socket is bound.

Overrides:
getLocalPort in class Socket
Returns:
the local port number to which this socket is bound.

getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an input stream for this socket.

Overrides:
getInputStream in class Socket
Returns:
an input stream for reading bytes from this socket.
Throws:
IOException - if an I/O error occurs when creating the input stream.

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Returns an output stream for this socket.

Overrides:
getOutputStream in class Socket
Returns:
an output stream for writing bytes to this socket.
Throws:
IOException - if an I/O error occurs when creating the output stream.

setTcpNoDelay

public void setTcpNoDelay(boolean on)
                   throws SocketException
Dummy method, not implemented.

Overrides:
setTcpNoDelay in class Socket
Parameters:
on - doesn't do anything.
Throws:
SocketException - if method called.

getTcpNoDelay

public boolean getTcpNoDelay()
                      throws SocketException
Dummy method, not implemented.

Overrides:
getTcpNoDelay in class Socket
Returns:
false
Throws:
SocketException - if method called.

setSoLinger

public void setSoLinger(boolean on,
                        int linger)
                 throws SocketException
Dummy method, not implemented.

Overrides:
setSoLinger in class Socket
Parameters:
on - doesn't do anything.
linger - doesn't do anything.
Throws:
SocketException - if method called.

getSoLinger

public int getSoLinger()
                throws SocketException
Dummy method, not implemented.

Overrides:
getSoLinger in class Socket
Returns:
-1
Throws:
SocketException - if method called.

setSoTimeout

public void setSoTimeout(int timeout)
                  throws SocketException
Dummy method, not implemented.

Overrides:
setSoTimeout in class Socket
Parameters:
timeout - doesn't do anything.
Throws:
SocketException - if method called.

getSoTimeout

public int getSoTimeout()
                 throws SocketException
Dummy method, not implemented.

Overrides:
getSoTimeout in class Socket
Returns:
-1
Throws:
SocketException - if method called.

setSendBufferSize

public void setSendBufferSize(int size)
                       throws SocketException
Dummy method, not implemented.

Overrides:
setSendBufferSize in class Socket
Parameters:
size - doesn't do anything.
Throws:
SocketException - if method called.

getSendBufferSize

public int getSendBufferSize()
                      throws SocketException
Dummy method, not implemented.

Overrides:
getSendBufferSize in class Socket
Returns:
-1
Throws:
SocketException - if method called.

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws SocketException
Dummy method, not implemented.

Overrides:
setReceiveBufferSize in class Socket
Parameters:
size - doesn't do anything.
Throws:
SocketException - if method called.

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws SocketException
Dummy method, not implemented.

Overrides:
getReceiveBufferSize in class Socket
Returns:
-1
Throws:
SocketException - if method called.

setKeepAlive

public void setKeepAlive(boolean on)
                  throws SocketException
Dummy method, not implemented.

Overrides:
setKeepAlive in class Socket
Parameters:
on - doesn't do anything.
Throws:
SocketException - if method called.

getKeepAlive

public boolean getKeepAlive()
                     throws SocketException
Dummy method, not implemented.

Overrides:
getKeepAlive in class Socket
Returns:
false
Throws:
SocketException - if method called.

close

public void close()
           throws IOException
Closes this socket.

Overrides:
close in class Socket
Throws:
IOException - if an I/O error occurs when closing this socket.

shutdownInput

public void shutdownInput()
                   throws IOException
Dummy method, not implemented.

Overrides:
shutdownInput in class Socket
Throws:
IOException - if method called.

shutdownOutput

public void shutdownOutput()
                    throws IOException
Dummy method, not implemented.

Overrides:
shutdownOutput in class Socket
Throws:
IOException - if method called.

toString

public String toString()
Converts this socket to a String.

Overrides:
toString in class Socket
Returns:
a string representation of this socket.

Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.