|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
io.AbstractDriver
io.AbstractSocketDriver
public abstract class AbstractSocketDriver
An abstract driver that is based on a client socket connection. Provides methods for opening the socket and changing the timeout.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
private static long |
DEFCLOSETIMEOUT
Defaults to no wait before closing. |
private InputStream |
in
On open, the input stream opened. |
static String |
KEY_CLOSETIMEOUT
Wait before close. |
static String |
KEY_SOCKETPORT
Port of the server. |
static String |
KEY_SOCKETSERVER
Key to the host. |
static String |
KEY_SOCKETTIMEOUT
Timeout. |
private OutputStream |
out
On open, the output stream opened. |
private Socket |
socket
This is the connected socket. |
| Fields inherited from class io.AbstractDriver |
|---|
KEY_DRIVERNAME |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
protected |
AbstractSocketDriver(Map prop)
Creates a new socket server. |
| Method Summary | |
|---|---|
protected boolean |
authenticate()
Authenticates at the remote host. |
boolean |
close()
Disconnect from remote host. |
void |
exit()
On exit we always close. |
protected InputStream |
getInputStream()
Returns the input stream for this socket driver. |
protected OutputStream |
getOutputStream()
Returns the output stream for this socket driver. |
protected Socket |
getSocket()
Returns the socket. |
void |
init()
On init, we check if we have all the required properties set. |
boolean |
isOpen()
Returns true if the connection is open. |
boolean |
open()
Connect to remote host. |
void |
setTimeout(int mils)
Set default timeout for socket reads |
| Methods inherited from class io.AbstractDriver |
|---|
createDriver, equals, getDriverName, hashCode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_SOCKETSERVER
public static final String KEY_SOCKETPORT
public static final String KEY_SOCKETTIMEOUT
public static final String KEY_CLOSETIMEOUT
private static final long DEFCLOSETIMEOUT
private Socket socket
private InputStream in
private OutputStream out
| Constructor Detail |
|---|
protected AbstractSocketDriver(Map prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyContainerpublic void exit()
exit in interface ExitCleaning
public void setTimeout(int mils)
throws SocketException
mils - timeout in msec for socket reads
SocketException
public boolean open()
throws IOException
open in interface DriverIOException - Exception to throw on connection error
protected boolean authenticate()
throws IOException
IOExceptionpublic boolean isOpen()
isOpen in interface Driver
public boolean close()
throws IOException
close in interface Driverforce - force a disconnect, even in persistent mode
IOException - Exception to throw on disconnection errorprotected InputStream getInputStream()
protected OutputStream getOutputStream()
protected Socket getSocket()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||