org.hsqldb
Class HsqlSocketFactory

java.lang.Object
  extended byorg.hsqldb.HsqlSocketFactory
Direct Known Subclasses:
HsqlSocketFactorySecure

public class HsqlSocketFactory
extends Object

Base class for producing the Socket objects used by HSQLDB.

Since:
HSQLDB 1.7.2
Version:
1.7.2
Author:
unsaved@users.sourceforge.net, boucherb@users.sourceforge.net

Constructor Summary
protected HsqlSocketFactory()
          External construction disabled.
 
Method Summary
 void configureSocket(Socket socket)
           
 ServerSocket createServerSocket(int port)
          Returns a server socket bound to the specified port.
 ServerSocket createServerSocket(int port, String address)
          Returns a server socket bound to the specified port.
 Socket createSocket(String host, int port)
          Creates a socket and connects it to the specified remote host at the specified remote port.
static HsqlSocketFactory getInstance(boolean tls)
          Retrieves an HsqlSocketFactory whose subclass and attributes are determined by the specified argument, tls.
 boolean isSecure()
          Retrieves whether this factory produces secure sockets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HsqlSocketFactory

protected HsqlSocketFactory()
                     throws Exception
External construction disabled. New factory instances are retreived through the newHsqlSocketFactory method instead.

Method Detail

getInstance

public static HsqlSocketFactory getInstance(boolean tls)
                                     throws Exception
Retrieves an HsqlSocketFactory whose subclass and attributes are determined by the specified argument, tls.

Parameters:
tls - whether to retrieve a factory producing SSL sockets
Returns:
a new factory
Throws:
Exception - if the new factory cannot be constructed or is of the wrong type

configureSocket

public void configureSocket(Socket socket)

createServerSocket

public ServerSocket createServerSocket(int port)
                                throws Exception
Returns a server socket bound to the specified port. The socket is configured with the socket options given to this factory.

Parameters:
port - the port to which to bind the ServerSocket
Returns:
the ServerSocket
Throws:
Exception - if a network error occurs

createServerSocket

public ServerSocket createServerSocket(int port,
                                       String address)
                                throws Exception
Returns a server socket bound to the specified port. The socket is configured with the socket options given to this factory.

Parameters:
port - the port to which to bind the ServerSocket
Returns:
the ServerSocket
Throws:
Exception - if a network error occurs

createSocket

public Socket createSocket(String host,
                           int port)
                    throws Exception
Creates a socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.

Parameters:
host - the server host
port - the server port
Returns:
the socket
Throws:
Exception - if a network error occurs

isSecure

public boolean isSecure()
Retrieves whether this factory produces secure sockets.

Returns:
true if this factory produces secure sockets


Copyright © 2001 - 2004 HSQL Development Group. All Rights Reserved.