public abstract class SocketMuxer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
SocketMuxer.SingletonMaker |
protected class |
SocketMuxer.TimerListenerImpl |
Modifier and Type | Field and Description |
---|---|
protected static long |
DELAYPOLLWAKEUP |
private static java.lang.String |
DELAYPOLLWAKEUPPROP |
private static int |
EOS |
private static boolean |
isAix |
private static boolean |
isAvailable |
private static boolean |
isLinux |
private static java.lang.Object |
ISPRESENT |
private static java.lang.String |
osName |
protected static int |
rdrThreads |
private static int |
sockCreateTimeout |
private static java.lang.String |
sockCreateTimeoutProp |
protected static java.lang.String |
SOCKET_READERS_QUEUE_NAME |
protected java.util.concurrent.ConcurrentHashMap<weblogic.socket.MuxableSocket,java.lang.Object> |
sockets |
private static int |
TIMER_MANAGER_INTERVAL |
private static java.lang.String |
TIMER_MANAGER_NAME |
Modifier | Constructor and Description |
---|---|
protected |
SocketMuxer() |
Modifier and Type | Method and Description |
---|---|
protected void |
cancelIo(weblogic.socket.MuxableSocket ms) |
private static java.lang.String |
chooseMuxerClassBySettings() |
(package private) void |
cleanupSocket(weblogic.socket.MuxableSocket ms,
weblogic.socket.SocketInfo info)
Performs cleanup for muxable socket, which is only done once for
each muxable socket.
|
void |
closeSocket(weblogic.socket.MuxableSocket ms)
Called to close the MuxableSocket.
|
protected void |
closeSocket(java.net.Socket s) |
private void |
closeSocket(java.net.Socket s,
boolean shouldCloseSocket) |
(package private) boolean |
completeIO(weblogic.socket.MuxableSocket ms,
weblogic.socket.SocketInfo info)
This is called by muxer subclasses after the pending IO for the
muxable socket is available, i.e.
|
protected weblogic.timers.TimerListener |
createTimeoutTrigger() |
void |
deliverEndOfStream(weblogic.socket.MuxableSocket ms)
Deliver an idle timeout to the muxable socket.
|
private void |
deliverExceptionAndCleanup(weblogic.socket.MuxableSocket ms,
java.lang.Throwable ex)
Deliver the exception to the muxable socket, and performing cleanup
if possible (i.e.
|
void |
deliverHasException(weblogic.socket.MuxableSocket ms,
java.lang.Throwable ex)
Deliver an exception to the muxable socket.
|
void |
finishExceptionHandling(weblogic.socket.MuxableSocket ms)
If the muxable socket returns false on timeout, the muxer will
not clean up the socket immediately and will wait for the muxable
socket to call this method to inform the muxer that exception
handling is finished.
|
private static java.lang.String |
getLinkError(java.lang.String muxerClassName) |
static SocketMuxer |
getMuxer() |
private static java.lang.String |
getNativeMuxerClassName() |
int |
getNumberOfReaders() |
int |
getNumSockets()
Returns the current number of registered sockets.
|
weblogic.socket.MuxableSocket[] |
getSockets()
Returns an array of all of the current MuxableSocket.
|
java.util.Iterator<weblogic.socket.MuxableSocket> |
getSocketsIterator()
Return an iterator of MuxableSockets for use in timing out.
|
protected void |
handleReadTimeout(weblogic.socket.MuxableSocket ms) |
(package private) boolean |
initiateIO(weblogic.socket.SocketInfo info)
This is called by muxer subclasses before initiating IO for
the muxable socket.
|
private static long |
initMuxerDelayPollProp() |
private static java.lang.String |
initOSNameProp() |
private static int |
initSockCreateTimeoutProp() |
(package private) static void |
initSocket(java.net.Socket sock) |
protected java.net.Socket |
initSocket(java.net.Socket sock,
java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectTimeoutMillis) |
(package private) static SocketMuxer |
initSocketMuxerOnServer() |
protected void |
initSocketReaderThreads(int defaultNumberOfReaders,
java.lang.String queueName,
java.lang.String oldQueueName)
Deprecated.
|
protected static void |
initThreadCount(int defaultNumberOfReaders,
java.lang.String queueName,
java.lang.String oldQueueName) |
protected void |
internalWrite(weblogic.socket.AsyncOutputStream s) |
boolean |
isAsyncMuxer() |
static boolean |
isAvailable() |
private static SocketMuxer |
makeTheMuxer() |
java.net.Socket |
newClientSocket(java.net.InetAddress host,
int port) |
java.net.Socket |
newClientSocket(java.net.InetAddress host,
int port,
java.net.InetAddress localHost,
int localPort,
int timeout) |
java.net.Socket |
newClientSocket(java.net.InetAddress host,
int port,
int timeout) |
java.net.Socket |
newProxySocket(java.net.InetAddress host,
int port,
java.net.InetAddress localAddr,
int localPort,
java.net.InetAddress proxyHost,
int proxyPort,
int connectTimeoutMillis)
Create a new, tunneled, socket through a Squid-type proxy.
|
java.net.Socket |
newSDPSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectTimeoutMillis) |
java.net.Socket |
newSocket(java.net.InetAddress address,
int port) |
java.net.Socket |
newSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectTimeoutMillis)
Create and initialize a new Socket, binding to some local address
and port.
|
java.net.Socket |
newSocket(java.net.InetAddress address,
int port,
int timeout) |
java.net.Socket |
newSSLClientSocket(java.net.InetAddress host,
int port) |
java.net.Socket |
newSSLClientSocket(java.net.InetAddress host,
int port,
java.net.InetAddress localHost,
int localPort,
int timeout) |
java.net.Socket |
newSSLClientSocket(java.net.InetAddress host,
int port,
int timeout) |
java.net.Socket |
newWeblogicSocket(java.net.Socket sock) |
protected abstract void |
processSockets()
The main method in the SocketMuxer where the reading occurs.
|
abstract void |
read(java.util.Collection<weblogic.socket.MuxableSocket> muxableSockets) |
abstract void |
read(weblogic.socket.MuxableSocket ms)
Attempts to read data for a MuxableSocket that has been
registered.
|
protected void |
readCompleted(weblogic.socket.MuxableSocket ms) |
protected int |
readFromSocket(weblogic.socket.MuxableSocket ms) |
(package private) void |
readReadySocket(weblogic.socket.MuxableSocket ms,
weblogic.socket.SocketInfo info,
long timeoutMillis)
Read on a socket that is ready for IO.
|
private boolean |
readReadySocketOnce(weblogic.socket.MuxableSocket ms,
weblogic.socket.SocketInfo info)
Returns true if more needs to be read
|
void |
register(java.util.Collection<weblogic.socket.MuxableSocket> muxableSockets) |
void |
register(weblogic.socket.MuxableSocket ms)
Register a MuxableSocket, but do not begin IO.
|
void |
reRegister(weblogic.socket.MuxableSocket oldSock,
weblogic.socket.MuxableSocket newSock)
Changes the implementation of muxable socket for Raw socket
A Socket MUST be registered before re-register
Currently muxers return silently if socket is found to be
not registered with muxer when re-register is called
This is used by Dispatch of MuxableRawSocket
For Protocol Discrimination a MuxableRawSocker is registered
with muxer, when protocol discrimination is complete and
the incoming protocol jas been established, MuxableRawSocket
should be replaced by Protocol Specific Muxable Socket
Generally Muxers maintain a map from Raw Socket or FD to Muxable
Socket.
|
protected void |
startSocketReaderThreads(java.lang.String queueName) |
void |
write(weblogic.socket.AsyncOutputStream s) |
private static final java.lang.String TIMER_MANAGER_NAME
private static final int TIMER_MANAGER_INTERVAL
private static final java.lang.String DELAYPOLLWAKEUPPROP
protected static final long DELAYPOLLWAKEUP
private static final int EOS
private static final java.lang.String sockCreateTimeoutProp
private static final int sockCreateTimeout
protected static final java.lang.String SOCKET_READERS_QUEUE_NAME
protected final java.util.concurrent.ConcurrentHashMap<weblogic.socket.MuxableSocket,java.lang.Object> sockets
private static final java.lang.Object ISPRESENT
private static boolean isAvailable
private static final java.lang.String osName
private static final boolean isLinux
private static final boolean isAix
protected static int rdrThreads
protected SocketMuxer() throws java.io.IOException
java.io.IOException
private static int initSockCreateTimeoutProp()
private static long initMuxerDelayPollProp()
private static java.lang.String initOSNameProp()
public static SocketMuxer getMuxer()
public static boolean isAvailable()
static SocketMuxer initSocketMuxerOnServer() throws ServiceFailureException
ServiceFailureException
private static SocketMuxer makeTheMuxer()
private static java.lang.String getNativeMuxerClassName()
private static java.lang.String chooseMuxerClassBySettings() throws java.lang.SecurityException
java.lang.SecurityException
private static java.lang.String getLinkError(java.lang.String muxerClassName)
@Deprecated protected void initSocketReaderThreads(int defaultNumberOfReaders, java.lang.String queueName, java.lang.String oldQueueName)
defaultNumberOfReaders
- queueName
- oldQueueName
- public int getNumberOfReaders()
protected static void initThreadCount(int defaultNumberOfReaders, java.lang.String queueName, java.lang.String oldQueueName)
defaultNumberOfReaders
- queueName
- oldQueueName
- protected void startSocketReaderThreads(java.lang.String queueName)
public boolean isAsyncMuxer()
public java.net.Socket newSocket(java.net.InetAddress address, int port) throws java.io.IOException
java.io.IOException
public java.net.Socket newSocket(java.net.InetAddress address, int port, int timeout) throws java.io.IOException
java.io.IOException
public java.net.Socket newClientSocket(java.net.InetAddress host, int port, int timeout) throws java.io.IOException
java.io.IOException
public java.net.Socket newClientSocket(java.net.InetAddress host, int port, java.net.InetAddress localHost, int localPort, int timeout) throws java.io.IOException
java.io.IOException
public java.net.Socket newClientSocket(java.net.InetAddress host, int port) throws java.io.IOException
java.io.IOException
public java.net.Socket newSSLClientSocket(java.net.InetAddress host, int port, int timeout) throws java.io.IOException
java.io.IOException
public java.net.Socket newSSLClientSocket(java.net.InetAddress host, int port, java.net.InetAddress localHost, int localPort, int timeout) throws java.io.IOException
java.io.IOException
public java.net.Socket newSSLClientSocket(java.net.InetAddress host, int port) throws java.io.IOException
java.io.IOException
public java.net.Socket newSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, int connectTimeoutMillis) throws java.io.IOException
java.io.IOException
public java.net.Socket newSDPSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, int connectTimeoutMillis) throws java.io.IOException
java.io.IOException
protected java.net.Socket initSocket(java.net.Socket sock, java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, int connectTimeoutMillis) throws java.io.IOException
java.io.IOException
public java.net.Socket newProxySocket(java.net.InetAddress host, int port, java.net.InetAddress localAddr, int localPort, java.net.InetAddress proxyHost, int proxyPort, int connectTimeoutMillis) throws java.io.IOException
java.io.IOException
public java.net.Socket newWeblogicSocket(java.net.Socket sock) throws java.io.IOException
java.io.IOException
static void initSocket(java.net.Socket sock) throws SocketOptionException
SocketOptionException
protected void closeSocket(java.net.Socket s)
private void closeSocket(java.net.Socket s, boolean shouldCloseSocket)
public void register(weblogic.socket.MuxableSocket ms) throws java.io.IOException
java.io.IOException
MuxableSocket
public void register(java.util.Collection<weblogic.socket.MuxableSocket> muxableSockets)
public void reRegister(weblogic.socket.MuxableSocket oldSock, weblogic.socket.MuxableSocket newSock)
public abstract void read(weblogic.socket.MuxableSocket ms)
ExecuteThread
,
MuxableSocket
,
SocketResetException
public abstract void read(java.util.Collection<weblogic.socket.MuxableSocket> muxableSockets)
public final void closeSocket(weblogic.socket.MuxableSocket ms)
MuxableSocket
protected abstract void processSockets()
Kernel
,
KernelMBean
,
SocketReaderRequest
public final int getNumSockets()
public final java.util.Iterator<weblogic.socket.MuxableSocket> getSocketsIterator()
public final weblogic.socket.MuxableSocket[] getSockets()
final boolean initiateIO(weblogic.socket.SocketInfo info)
final boolean completeIO(weblogic.socket.MuxableSocket ms, weblogic.socket.SocketInfo info)
public final void finishExceptionHandling(weblogic.socket.MuxableSocket ms)
weblogic.socket.MuxableSocket.hasException
,
weblogic.socket.MuxableSocket.timeout
,
weblogic.socket.SocketMuxer.completeIO
public final void deliverEndOfStream(weblogic.socket.MuxableSocket ms)
public final void deliverHasException(weblogic.socket.MuxableSocket ms, java.lang.Throwable ex)
private void deliverExceptionAndCleanup(weblogic.socket.MuxableSocket ms, java.lang.Throwable ex)
weblogic.socket.MuxableSocket.hasException
,
weblogic.socket.MuxableSocket.timeout
,
weblogic.socket.SocketMuxer.finishExceptionHandling
protected void cancelIo(weblogic.socket.MuxableSocket ms)
void cleanupSocket(weblogic.socket.MuxableSocket ms, weblogic.socket.SocketInfo info)
final void readReadySocket(weblogic.socket.MuxableSocket ms, weblogic.socket.SocketInfo info, long timeoutMillis)
private final boolean readReadySocketOnce(weblogic.socket.MuxableSocket ms, weblogic.socket.SocketInfo info)
protected int readFromSocket(weblogic.socket.MuxableSocket ms) throws java.io.IOException
java.io.IOException
protected void handleReadTimeout(weblogic.socket.MuxableSocket ms)
protected void readCompleted(weblogic.socket.MuxableSocket ms)
public final void write(weblogic.socket.AsyncOutputStream s)
protected void internalWrite(weblogic.socket.AsyncOutputStream s)
protected weblogic.timers.TimerListener createTimeoutTrigger()