|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.Socket
edu.emory.mathcs.util.net.SocketWrapper
Wrapper for sockets which enables to add functionality in subclasses on top of existing, connected sockets. It is useful when direct subclassing of delegate socket class is not possible, e.g. if the delegate socket is created by a library. Possible usage example is socket factory chaining. This class delegates all socket-related requests to the wrapped delegate, as of JDK 1.4.
Field Summary | |
protected java.net.Socket |
delegate
the wrapped delegate socket. |
Constructor Summary | |
protected |
SocketWrapper(java.net.Socket delegate)
Creates new socket wrapper for a given socket. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
|
java.nio.channels.SocketChannel |
getChannel()
|
int |
hashCode()
|
boolean |
isBound()
Returns true, indicating that the socket is bound. |
boolean |
isClosed()
|
boolean |
isConnected()
Returns true, indicating that the socket is connected. |
boolean |
isInputShutdown()
|
boolean |
isOutputShutdown()
|
Methods inherited from class java.net.Socket |
bind, close, connect, connect, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, sendUrgentData, setKeepAlive, setOOBInline, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final java.net.Socket delegate
Constructor Detail |
protected SocketWrapper(java.net.Socket delegate) throws java.net.SocketException
delegate
- the delegate socket to wrap
java.net.SocketException
- if the delegate socket is closed, not bound,
or not connectedMethod Detail |
public java.nio.channels.SocketChannel getChannel()
public boolean isBound()
public boolean isClosed()
public boolean isConnected()
public boolean isInputShutdown()
public boolean isOutputShutdown()
public boolean equals(java.lang.Object obj)
public int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |