ca.uhn.hl7v2.protocol.impl
Class ServerSocketStreamSource

java.lang.Object
  extended by ca.uhn.hl7v2.protocol.impl.SocketStreamSource
      extended by ca.uhn.hl7v2.protocol.impl.ServerSocketStreamSource
All Implemented Interfaces:
StreamSource

public class ServerSocketStreamSource
extends SocketStreamSource

A StreamSource that gets streams from ServerSockets. This allows you to communicate over sockets that are established by the remote party (ie as a TCP/IP server).

Version:
$Revision: 1.4 $ updated on $Date: 2009/12/19 20:01:20 $ by $Author: jamesagnew $
Author:
Bryan Tripp

Constructor Summary
ServerSocketStreamSource(java.net.ServerSocket theServerSocket, java.lang.String theExpectedAddress)
           
 
Method Summary
 void connect()
          Accepts new connections on underlying ServerSocket, replacing any existing socket with the new one, blocking until a connection is available.
 java.net.Socket getSocket()
           
 
Methods inherited from class ca.uhn.hl7v2.protocol.impl.SocketStreamSource
disconnect, getInboundStream, getOutboundStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerSocketStreamSource

public ServerSocketStreamSource(java.net.ServerSocket theServerSocket,
                                java.lang.String theExpectedAddress)
                         throws TransportException
Parameters:
theServerSocket - a ServerSocket at which to listen for incoming connections
theExpectedAddress - the IP address from which to accept connections (null means accept from any address)
Throws:
TransportException
Method Detail

getSocket

public java.net.Socket getSocket()
Specified by:
getSocket in class SocketStreamSource
Returns:
a socket from which input and output streams for message exchages are to be obtained
See Also:
SocketStreamSource.getSocket()

connect

public void connect()
             throws TransportException
Accepts new connections on underlying ServerSocket, replacing any existing socket with the new one, blocking until a connection is available. See DualTransportConnector for a method of connecting two TransportLayers in a way that avoids deadlock.

Specified by:
connect in interface StreamSource
Specified by:
connect in class SocketStreamSource
Throws:
TransportException
See Also:
StreamSource.connect()


Copyright © 2001-2011 University Health Network. All Rights Reserved.