|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.Socket
org.jboss.remoting.transport.multiplex.VirtualSocket
public class VirtualSocket
VirtualSocket
represents an endpoint on a virtual connection created by the
Multiplex system. It extends java.net.Socket
and reimplements nearly all of
the methods in java.net.Socket
. For information about method behavior, please
see the java.net.Socket
javadoc. For more information about the nature of
virtual sockets, please see the Multiplex documentation at the labs.jboss.org
web site.
Copyright (c) 2005
Nested Class Summary | |
---|---|
static interface |
VirtualSocket.DisconnectListener
A class that implements DisconnectListener can register to
be notified if the remote peer of this VirtualSocket has
disconnected. |
protected class |
VirtualSocket.PendingClose
|
protected class |
VirtualSocket.PendingRemoteDisconnect
|
Field Summary | |
---|---|
protected static java.lang.Thread |
closingThread
|
protected static org.jboss.logging.Logger |
log
|
Constructor Summary | |
---|---|
VirtualSocket()
See superclass javadoc. |
|
VirtualSocket(java.net.InetAddress address,
int port)
See superclass javadoc. |
|
VirtualSocket(java.net.InetAddress host,
int port,
boolean stream)
See superclass javadoc. |
|
VirtualSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort)
See superclass javadoc. |
|
VirtualSocket(java.util.Map configuration)
|
|
VirtualSocket(MultiplexingManager manager,
SocketId remoteSocketId,
java.util.Map configuration)
|
|
VirtualSocket(java.net.SocketImpl impl)
This constuctor is not implemented. |
|
VirtualSocket(java.lang.String host,
int port)
See superclass javadoc. |
|
VirtualSocket(java.lang.String host,
int port,
boolean stream)
See superclass javadoc. |
|
VirtualSocket(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
See superclass javadoc. |
Method Summary | |
---|---|
void |
addDisconnectListener(VirtualSocket.DisconnectListener listener)
|
void |
bind(java.net.SocketAddress address)
See superclass javadoc. |
void |
close()
See superclass javadoc. |
void |
connect(java.net.SocketAddress socketAddress)
See superclass javadoc. |
void |
connect(java.net.SocketAddress socketAddress,
int timeout)
See superclass javadoc. |
void |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
int timeout)
|
protected void |
doClose()
|
protected java.net.Socket |
getActualSocket()
|
java.nio.channels.SocketChannel |
getChannel()
See superclass javadoc. |
java.net.InetAddress |
getInetAddress()
See superclass javadoc. |
java.io.InputStream |
getInputStream()
See superclass javadoc. |
boolean |
getKeepAlive()
See superclass javadoc. |
java.net.InetAddress |
getLocalAddress()
See superclass javadoc. |
int |
getLocalPort()
See superclass javadoc. |
java.net.SocketAddress |
getLocalSocketAddress()
See superclass javadoc. |
SocketId |
getLocalSocketId()
|
int |
getLocalVirtualPort()
|
protected MultiplexingManager |
getManager()
|
MultiplexingManager |
getMultiplexingManager()
|
boolean |
getOOBInline()
See superclass javadoc. |
java.io.OutputStream |
getOutputStream()
See superclass javadoc. |
int |
getPort()
See superclass javadoc. |
protected Protocol |
getProtocol()
|
java.net.Socket |
getRealSocket()
|
int |
getReceiveBufferSize()
See superclass javadoc. |
java.net.SocketAddress |
getRemoteSocketAddress()
See superclass javadoc. |
SocketId |
getRemoteSocketId()
|
boolean |
getReuseAddress()
See superclass javadoc. |
int |
getSendBufferSize()
See superclass javadoc. |
int |
getSoLinger()
See superclass javadoc. |
int |
getSoTimeout()
See superclass javadoc. |
boolean |
getTcpNoDelay()
See superclass javadoc. |
int |
getTrafficClass()
See superclass javadoc. |
int |
getVirtualPort()
|
protected void |
handleRemoteDisconnect()
|
protected void |
handleRemoteOutputShutDown()
|
protected boolean |
hasReceivedDisconnectMessage()
|
boolean |
isBound()
See superclass javadoc. |
boolean |
isClosed()
See superclass javadoc. |
boolean |
isConnected()
See superclass javadoc. |
boolean |
isFunctional()
Returns true if and only if has not received notification of error state on actual connection. |
boolean |
isInputShutdown()
See superclass javadoc. |
boolean |
isOutputShutdown()
See superclass javadoc. |
protected void |
notifyOfException()
Indicate error condition on actual connection. |
void |
removeDisconnectListener(VirtualSocket.DisconnectListener listener)
|
void |
sendUrgentData(int data)
This method is not implemented. |
protected void |
setActualSocket(java.net.Socket actualSocket)
|
protected void |
setBound(boolean bound)
|
protected void |
setClosed(boolean closed)
|
void |
setConfiguration(java.util.Map configuration)
|
protected void |
setConnected(boolean connected)
|
protected void |
setInputShutdown(boolean inputShutdown)
|
protected void |
setInputStream(MultiplexingInputStream inputStream)
|
void |
setKeepAlive(boolean on)
See superclass javadoc. |
protected void |
setLocalSocketId(SocketId localSocketId)
|
protected void |
setManager(MultiplexingManager manager)
|
void |
setOOBInline(boolean on)
|
protected void |
setOutputShutdown(boolean outputShutdown)
|
protected void |
setOutputStream(MultiplexingOutputStream outputStream)
|
protected void |
setProtocol(Protocol protocol)
|
void |
setReceiveBufferSize(int size)
See superclass javadoc. |
protected void |
setReceivedDisconnectMessage(boolean receivedDisconnectMessage)
|
protected void |
setRemoteSocketId(SocketId remoteSocketId)
|
void |
setReuseAddress(boolean on)
See superclass javadoc. |
void |
setSendBufferSize(int size)
See superclass javadoc. |
void |
setSoLinger(boolean on,
int linger)
See superclass javadoc. |
void |
setSoTimeout(int timeout)
See superclass javadoc. |
void |
setTcpNoDelay(boolean on)
See superclass javadoc. |
void |
setTrafficClass(int tc)
See superclass javadoc. |
void |
shutdownInput()
See superclass javadoc. |
void |
shutdownOutput()
See superclass javadoc. |
java.lang.String |
toString()
See superclass javadoc. |
Methods inherited from class java.net.Socket |
---|
setPerformancePreferences, setSocketImplFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.jboss.logging.Logger log
protected static java.lang.Thread closingThread
Constructor Detail |
---|
public VirtualSocket(MultiplexingManager manager, SocketId remoteSocketId, java.util.Map configuration) throws java.io.IOException
java.io.IOException
public VirtualSocket(java.util.Map configuration)
public VirtualSocket()
public VirtualSocket(java.lang.String host, int port) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public VirtualSocket(java.lang.String host, int port, boolean stream) throws java.io.IOException
host
- port
- stream
-
java.io.IOException
public VirtualSocket(java.net.InetAddress address, int port) throws java.io.IOException
address
- port
-
java.io.IOException
public VirtualSocket(java.net.InetAddress host, int port, boolean stream) throws java.io.IOException
host
- port
- stream
-
java.io.IOException
public VirtualSocket(java.net.SocketImpl impl) throws java.net.SocketException
impl
-
java.net.SocketException
- in all casespublic VirtualSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort) throws java.io.IOException
host
- port
- localAddr
- localPort
-
java.io.IOException
public VirtualSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort) throws java.io.IOException
address
- port
- localAddr
- localPort
-
java.io.IOException
Method Detail |
---|
public void bind(java.net.SocketAddress address) throws java.io.IOException
bind
in class java.net.Socket
java.io.IOException
public void close() throws java.io.IOException
close
in class java.net.Socket
java.io.IOException
public void connect(java.net.SocketAddress socketAddress) throws java.io.IOException
connect
in class java.net.Socket
java.io.IOException
public void connect(java.net.SocketAddress socketAddress, int timeout) throws java.io.IOException
connect
in class java.net.Socket
java.io.IOException
public java.nio.channels.SocketChannel getChannel()
getChannel
in class java.net.Socket
public java.net.InetAddress getInetAddress()
getInetAddress
in class java.net.Socket
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class java.net.Socket
java.io.IOException
public boolean getKeepAlive() throws java.net.SocketException
getKeepAlive
in class java.net.Socket
java.net.SocketException
public java.net.InetAddress getLocalAddress()
Socket.getLocalAddress()
returns "wildcard" address for an unbound socket.
getLocalAddress
in class java.net.Socket
public int getLocalPort()
getLocalPort
in class java.net.Socket
public java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress
in class java.net.Socket
public boolean getOOBInline() throws java.net.SocketException
getOOBInline
in class java.net.Socket
java.net.SocketException
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in class java.net.Socket
java.io.IOException
public int getPort()
getPort
in class java.net.Socket
public int getReceiveBufferSize() throws java.net.SocketException
getReceiveBufferSize
in class java.net.Socket
java.net.SocketException
public java.net.SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class java.net.Socket
public boolean getReuseAddress() throws java.net.SocketException
getReuseAddress
in class java.net.Socket
java.net.SocketException
public int getSendBufferSize() throws java.net.SocketException
getSendBufferSize
in class java.net.Socket
java.net.SocketException
public int getSoLinger() throws java.net.SocketException
getSoLinger
in class java.net.Socket
java.net.SocketException
public int getSoTimeout() throws java.net.SocketException
getSoTimeout
in class java.net.Socket
java.net.SocketException
public boolean getTcpNoDelay() throws java.net.SocketException
getTcpNoDelay
in class java.net.Socket
java.net.SocketException
public int getTrafficClass() throws java.net.SocketException
getTrafficClass
in class java.net.Socket
java.net.SocketException
public boolean isBound()
isBound
in class java.net.Socket
public boolean isClosed()
isClosed
in class java.net.Socket
public boolean isConnected()
isConnected
in class java.net.Socket
public boolean isInputShutdown()
isInputShutdown
in class java.net.Socket
public boolean isOutputShutdown()
isOutputShutdown
in class java.net.Socket
public void sendUrgentData(int data) throws java.io.IOException
See superclass javadoc.
sendUrgentData
in class java.net.Socket
java.io.IOException
public void setKeepAlive(boolean on) throws java.net.SocketException
setKeepAlive
in class java.net.Socket
java.net.SocketException
public void setOOBInline(boolean on) throws java.net.SocketException
setOOBInline
in class java.net.Socket
java.net.SocketException
public void setReceiveBufferSize(int size) throws java.net.SocketException
setReceiveBufferSize
in class java.net.Socket
java.net.SocketException
public void setReuseAddress(boolean on) throws java.net.SocketException
setReuseAddress
in class java.net.Socket
java.net.SocketException
public void setSendBufferSize(int size) throws java.net.SocketException
setSendBufferSize
in class java.net.Socket
java.net.SocketException
public void setSoLinger(boolean on, int linger) throws java.net.SocketException
setSoLinger
in class java.net.Socket
java.net.SocketException
public void setSoTimeout(int timeout) throws java.net.SocketException
setSoTimeout
in class java.net.Socket
java.net.SocketException
public void setTcpNoDelay(boolean on) throws java.net.SocketException
setTcpNoDelay
in class java.net.Socket
java.net.SocketException
public void setTrafficClass(int tc) throws java.net.SocketException
setTrafficClass
in class java.net.Socket
java.net.SocketException
public void shutdownInput() throws java.io.IOException
shutdownInput
in class java.net.Socket
java.io.IOException
public void shutdownOutput() throws java.io.IOException
shutdownOutput
in class java.net.Socket
java.io.IOException
public java.lang.String toString()
toString
in class java.net.Socket
public void addDisconnectListener(VirtualSocket.DisconnectListener listener)
public void connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, int timeout) throws java.io.IOException
java.io.IOException
public MultiplexingManager getMultiplexingManager()
public int getVirtualPort()
public int getLocalVirtualPort()
public SocketId getLocalSocketId()
public java.net.Socket getRealSocket()
public SocketId getRemoteSocketId()
public boolean isFunctional()
public void removeDisconnectListener(VirtualSocket.DisconnectListener listener)
listener
- public void setConfiguration(java.util.Map configuration)
configuration
- protected java.net.Socket getActualSocket()
protected void setActualSocket(java.net.Socket actualSocket)
actualSocket
- The actualSocket to set.protected void setBound(boolean bound)
bound
- The bound to set.protected void setClosed(boolean closed)
closed
- The closed to set.protected void setConnected(boolean connected)
connected
- The connected to set.protected void setInputShutdown(boolean inputShutdown)
inputShutdown
- The inputShutdown to set.protected void setInputStream(MultiplexingInputStream inputStream)
inputStream
- The inputStream to set.protected void setLocalSocketId(SocketId localSocketId)
localSocketId
- The localSocketId to set.protected MultiplexingManager getManager()
protected void setManager(MultiplexingManager manager)
manager
- The manager to set.protected void setOutputShutdown(boolean outputShutdown)
outputShutdown
- The outputShutdown to set.protected void setOutputStream(MultiplexingOutputStream outputStream)
outputStream
- The outputStream to set.protected Protocol getProtocol()
protected void setProtocol(Protocol protocol)
protocol
- The protocol to set.protected boolean hasReceivedDisconnectMessage()
protected void setReceivedDisconnectMessage(boolean receivedDisconnectMessage)
receivedDisconnectMessage
- protected void setRemoteSocketId(SocketId remoteSocketId)
remoteSocketId
- The remoteSocketId to set.protected void doClose()
protected void handleRemoteOutputShutDown() throws java.io.IOException
java.io.IOException
protected void handleRemoteDisconnect() throws java.io.IOException
java.io.IOException
protected void notifyOfException()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |