TPTP 4.4.0 Platform Project
Public API Specification

org.eclipse.hyades.execution.core.file.socket
Class SocketChannelFactory

java.lang.Object
  extended byorg.eclipse.hyades.execution.core.file.socket.SocketChannelFactory
All Implemented Interfaces:
ISocketChannelFactory

public class SocketChannelFactory
extends java.lang.Object
implements ISocketChannelFactory

Factory to create the local socket channel abstraction, this factory offers a default instance to use for normal unsecure socket establishment but other factories can be implemented that implement the socket channel factory interface and used where socket channel factories are applicable and required


Constructor Summary
protected SocketChannelFactory()
          Limit instantiation to factory extenders
 
Method Summary
 ISocketChannel create(java.net.InetSocketAddress address)
          Creates a local socket channel abstraction over a new socket to be established at the given internet socket address, basically connects to the address given, establishes a socket to the other side and returns back an abstraction to manipulate the connection with -- this method creates a new connection at the given address or returns back an existing connection that is not in use (with no contention with another client possible)
 ISocketChannel create(java.net.InetSocketAddress address, int timeout)
          Creates a local socket channel abstraction over a new socket to be established at the given internet socket address, basically connects to the address given, establishes a socket to the other side and returns back an abstraction to manipulate the connection with -- this method creates a new connection at the given address or returns back an existing connection that is not in use (with no contention with another client possible)
 ISocketChannel create(java.net.Socket socket)
          Creates a local socket channel abstraction for the given socket, this does not create a new connection, simply wraps a java.nio channel with a local abstraction
 ISocketChannel create(java.nio.channels.SocketChannel realChannel)
          Creates a local socket channel abstraction for the given standard channel, this does not create a new connection, simply wraps a java.nio channel with a local abstraction
static ISocketChannelFactory getInstance()
          Default instance accessor method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketChannelFactory

protected SocketChannelFactory()
Limit instantiation to factory extenders

Method Detail

getInstance

public static ISocketChannelFactory getInstance()
Default instance accessor method

Returns:
the default socket channel factory, another implementation is possible by implementing the socket channel factory interface

create

public ISocketChannel create(java.net.InetSocketAddress address)
                      throws java.io.IOException
Description copied from interface: ISocketChannelFactory
Creates a local socket channel abstraction over a new socket to be established at the given internet socket address, basically connects to the address given, establishes a socket to the other side and returns back an abstraction to manipulate the connection with -- this method creates a new connection at the given address or returns back an existing connection that is not in use (with no contention with another client possible)

Specified by:
create in interface ISocketChannelFactory
Parameters:
address - the address to establish a connection to
Returns:
a new socket channel to use
Throws:
java.io.IOException - throws an IO exception if socket problems arise

create

public ISocketChannel create(java.net.InetSocketAddress address,
                             int timeout)
                      throws java.io.IOException
Description copied from interface: ISocketChannelFactory
Creates a local socket channel abstraction over a new socket to be established at the given internet socket address, basically connects to the address given, establishes a socket to the other side and returns back an abstraction to manipulate the connection with -- this method creates a new connection at the given address or returns back an existing connection that is not in use (with no contention with another client possible)

Specified by:
create in interface ISocketChannelFactory
Parameters:
address - the address to establish a connection to
timeout - timeout to use for the connection
Returns:
a new socket channel to use
Throws:
java.io.IOException - throws an IO exception if socket problems arise

create

public ISocketChannel create(java.nio.channels.SocketChannel realChannel)
Description copied from interface: ISocketChannelFactory
Creates a local socket channel abstraction for the given standard channel, this does not create a new connection, simply wraps a java.nio channel with a local abstraction

Specified by:
create in interface ISocketChannelFactory
Parameters:
realChannel - the standard Java abstraction
Returns:
the local socket channel interface, abstracting the real socket channel and associated socket

create

public ISocketChannel create(java.net.Socket socket)
                      throws java.io.IOException
Description copied from interface: ISocketChannelFactory
Creates a local socket channel abstraction for the given socket, this does not create a new connection, simply wraps a java.nio channel with a local abstraction

Specified by:
create in interface ISocketChannelFactory
Parameters:
socket - the socket to seed this socket channel
Returns:
the local socket channel interface abstacting an already existing socket
Throws:
java.io.IOException

TPTP 4.4.0 Platform Project
Public API Specification