com.epam.common.transport.client.tcp
Class NIOTCPTransport

java.lang.Object
  extended by com.epam.common.transport.NIOSocketTransport
      extended by com.epam.common.transport.client.tcp.NIOTCPTransport
All Implemented Interfaces:
ClientTransport, Transport

public class NIOTCPTransport
extends NIOSocketTransport
implements ClientTransport

TCP socket transport implementation.


Field Summary
 
Fields inherited from class com.epam.common.transport.NIOSocketTransport
BLOCKING_SOCKETS_FLAG, is, isBlocking, os, readSelectionKey, readSelector, socket, SOCKET_READ_SIZE, socketChannel, SPINNING_READ_FLAG, useSpinningReadSelect, writeSelectionKey, writeSelector
 
Constructor Summary
NIOTCPTransport()
          Creates transport.
NIOTCPTransport(String host, int port)
          Creates transport.
NIOTCPTransport(String host, int port, boolean enableTcpNoDelay, HashMap<String,Object> connectivityParams)
          Creates transport.
 
Method Summary
 void close()
          Close the transport.
 boolean isOpen()
          Returns true if, transport is open.
 void open()
          Open the transport.
 void setAddress(String host)
          Setter for address.
 void setPort(int port)
          Setter for port.
 void setSocketFactory(SocketFactory socketFactory)
          Setter for socket factory transport.
 
Methods inherited from class com.epam.common.transport.NIOSocketTransport
getAddress, getPort, isBlockingSocket, read, read, read, read, setSessionConnectivityParams, waitUntilReadyToWrite, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.epam.common.transport.client.ClientTransport
read, read, write, write
 
Methods inherited from interface com.epam.common.transport.Transport
getAddress, getPort, isBlockingSocket, read, read, waitUntilReadyToWrite, write, write
 

Constructor Detail

NIOTCPTransport

public NIOTCPTransport()
Creates transport.


NIOTCPTransport

public NIOTCPTransport(String host,
                       int port)
Creates transport.

Parameters:
host - the transport host
port - the transport port

NIOTCPTransport

public NIOTCPTransport(String host,
                       int port,
                       boolean enableTcpNoDelay,
                       HashMap<String,Object> connectivityParams)
Creates transport.

Parameters:
host - the transport host
port - the transpot port
enableTcpNoDelay - enable/disable nagle sockets algorithm
Method Detail

setSocketFactory

public void setSocketFactory(SocketFactory socketFactory)
Setter for socket factory transport.

Specified by:
setSocketFactory in interface ClientTransport
Parameters:
socketFactory - the socket factory

setAddress

public void setAddress(String host)
Description copied from interface: ClientTransport
Setter for address.

Specified by:
setAddress in interface ClientTransport
See Also:
ClientTransport.setAddress(String)

setPort

public void setPort(int port)
Description copied from interface: ClientTransport
Setter for port.

Specified by:
setPort in interface ClientTransport
See Also:
ClientTransport.setPort(int)

open

public void open()
          throws IOException
Description copied from interface: Transport
Open the transport.

Specified by:
open in interface Transport
Specified by:
open in class NIOSocketTransport
Throws:
IOException - - throws if error occurred
See Also:
Transport.open()

close

public void close()
           throws IOException
Description copied from interface: Transport
Close the transport.

Specified by:
close in interface Transport
Overrides:
close in class NIOSocketTransport
Throws:
IOException - - throws if error occurred
See Also:
Transport.close()

isOpen

public boolean isOpen()
Description copied from interface: Transport
Returns true if, transport is open.

Specified by:
isOpen in interface Transport
Overrides:
isOpen in class NIOSocketTransport
See Also:
Transport.isOpen()


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.