Sun Adapter for TCP/IP HL7

com.stc.connector.tcpip.model.factory
Class TCPIPSocketFactoryExtendedImpl

java.lang.Object
  extended by com.stc.connector.tcpip.model.factory.TCPIPSocketFactoryExtendedImpl
All Implemented Interfaces:
TCPIPSocketFactory

public class TCPIPSocketFactoryExtendedImpl
extends java.lang.Object
implements TCPIPSocketFactory

Sun Java System Application Server Enterprise Edition 8.1 2005Q2 UR2 has problem on socket. The socket input stream method available() always returns 0 even actaully there is data available. This class is to replace the default socket factory and get around that issue by use of java.io.PushbackInputStream. Actually this socket class should work with other application servers also.

Version:
cvs revision: $Revision: 1.3 $ Last Modified: $Date: 2008/03/03 15:35:59 $
Author:
Harry Liu

Nested Class Summary
 class TCPIPSocketFactoryExtendedImpl.ServerSocketWithPushbackInputStream
          Inner class for special ServerSocket.
 class TCPIPSocketFactoryExtendedImpl.SocketWithPushbackInputStream
          Inner class for special Socket.
 class TCPIPSocketFactoryExtendedImpl.TCPIPPushbackInputStream
          Inner class for PushbackInputStream
 
Field Summary
static java.lang.String version
           
 
Constructor Summary
TCPIPSocketFactoryExtendedImpl()
          Constructor
 
Method Summary
 java.net.ServerSocket createServerSocket(int port)
          Creates a ServerSocket object.
 java.net.ServerSocket createServerSocket(int port, int backlog)
          Creates a ServerSocket object.
 java.net.ServerSocket createServerSocket(int port, int backlog, java.net.InetAddress bindAddr)
          Creates a ServerSocket object.
 java.net.Socket createSocket(java.net.InetAddress address, int port)
          Creates a Socket object.
 java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort)
          Creates a Socket object.
 java.net.Socket createSocket(java.lang.String host, int port)
          Creates a Socket object.
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort)
          Creates a Socket object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
See Also:
Constant Field Values
Constructor Detail

TCPIPSocketFactoryExtendedImpl

public TCPIPSocketFactoryExtendedImpl()
Constructor

Method Detail

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port,
                                    java.net.InetAddress localAddr,
                                    int localPort)
                             throws java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a Socket object.

Specified by:
createSocket in interface TCPIPSocketFactory
Parameters:
address - The InetAddress of the host.
port - The port number.
localAddr - The InetAddress of local side.
localPort - The port number of local side.
Returns:
Socket object
Throws:
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createSocket(InetAddress, int, InetAddress, int)

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port)
                             throws java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a Socket object.

Specified by:
createSocket in interface TCPIPSocketFactory
Parameters:
address - The InetAddress of the host
port - The port number.
Returns:
Socket object
Throws:
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createSocket(InetAddress, int)

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress localAddr,
                                    int localPort)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a Socket object.

Specified by:
createSocket in interface TCPIPSocketFactory
Parameters:
host - The host name.
port - The port number.
localAddr - The InetAddress of local side.
localPort - The port number of local side.
Returns:
Socket object
Throws:
java.net.UnknownHostException - on error
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createSocket(String, int, InetAddress, int)

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a Socket object.

Specified by:
createSocket in interface TCPIPSocketFactory
Parameters:
host - The host name.
port - The port number.
Returns:
Socket object
Throws:
java.net.UnknownHostException - on error
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createSocket(String, int)

createServerSocket

public java.net.ServerSocket createServerSocket(int port,
                                                int backlog,
                                                java.net.InetAddress bindAddr)
                                         throws java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a ServerSocket object.

Specified by:
createServerSocket in interface TCPIPSocketFactory
Parameters:
port - The port number.
backlog - The backlog number.
bindAddr - The InetAddress to bind.
Returns:
ServerSocket object
Throws:
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createServerSocket(int, int, InetAddress)

createServerSocket

public java.net.ServerSocket createServerSocket(int port,
                                                int backlog)
                                         throws java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a ServerSocket object.

Specified by:
createServerSocket in interface TCPIPSocketFactory
Parameters:
port - The port number.
backlog - The backlog number.
Returns:
ServerSocket object
Throws:
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createServerSocket(int, int)

createServerSocket

public java.net.ServerSocket createServerSocket(int port)
                                         throws java.io.IOException
Description copied from interface: TCPIPSocketFactory
Creates a ServerSocket object.

Specified by:
createServerSocket in interface TCPIPSocketFactory
Parameters:
port - The port number.
Returns:
ServerSocket object
Throws:
java.io.IOException - on error
See Also:
TCPIPSocketFactory.createServerSocket(int)

Sun Adapter for TCP/IP HL7