public final class SSLClient extends Object implements ISynchAsynchConnection
| Modifier and Type | Field and Description |
|---|---|
protected long |
closeTimeout |
protected ID |
containerID |
static long |
DEFAULT_CLOSE_TIMEOUT |
static int |
DEFAULT_MAX_BUFFER_MSG |
static int |
DEFAULT_RCVR_PRIORITY |
static int |
DEFAULT_SNDR_PRIORITY |
static int |
DEFAULT_WAIT_INTERVAL |
protected ISynchAsynchEventHandler |
handler |
protected ObjectInputStream |
inputStream |
protected boolean |
isClosing |
protected int |
keepAlive |
protected Thread |
keepAliveThread |
protected ObjectOutputStream |
outputStream |
protected Object |
outputStreamLock |
protected PingMessage |
ping |
protected Object |
pingLock |
protected PingResponseMessage |
pingResp |
protected Map |
properties |
static String |
PROTOCOL |
protected SimpleFIFOQueue |
queue |
protected Thread |
rcvThread |
protected Thread |
sendThread |
protected Socket |
socket |
protected boolean |
waitForPing |
| Constructor and Description |
|---|
SSLClient(ISynchAsynchEventHandler handler,
int keepAlive) |
SSLClient(Socket aSocket,
ObjectInputStream iStream,
ObjectOutputStream oStream,
ISynchAsynchEventHandler handler) |
SSLClient(Socket aSocket,
ObjectInputStream iStream,
ObjectOutputStream oStream,
ISynchAsynchEventHandler handler,
int maxmsgs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IConnectionListener l)
Add comm layer event listener
|
Object |
connect(ID remote,
Object data,
int timeout)
Connect to a remote process
|
protected void |
debug(String msg) |
void |
disconnect()
Disconnect
|
Object |
getAdapter(Class clazz) |
ID |
getLocalID()
Get local ID for this connection
|
Map |
getProperties()
Get properties for this connection
|
boolean |
isConnected() |
boolean |
isStarted() |
void |
queueObject(ID recipient,
Serializable obj) |
void |
removeListener(IConnectionListener l)
remove comm layer event listener
|
void |
sendAsynch(ID recipient,
byte[] obj)
Send data asynchronously.
|
void |
sendAsynch(ID recipient,
Object obj) |
Serializable |
sendObject(ID recipient,
Serializable obj) |
Object |
sendSynch(ID rec,
byte[] obj)
Send data synchronously, blocking until a result is received
|
Object |
sendSynch(ID rec,
Object obj) |
void |
setCloseTimeout(long t) |
void |
setProperties(Map props) |
void |
start()
Start connection
|
void |
stop()
Stop connection
|
protected void |
traceStack(String msg,
Throwable e) |
public static final String PROTOCOL
public static final int DEFAULT_SNDR_PRIORITY
public static final int DEFAULT_RCVR_PRIORITY
public static final long DEFAULT_CLOSE_TIMEOUT
public static final int DEFAULT_MAX_BUFFER_MSG
public static final int DEFAULT_WAIT_INTERVAL
protected Socket socket
protected ObjectOutputStream outputStream
protected ObjectInputStream inputStream
protected ISynchAsynchEventHandler handler
protected SimpleFIFOQueue queue
protected int keepAlive
protected Thread sendThread
protected Thread rcvThread
protected Thread keepAliveThread
protected boolean isClosing
protected boolean waitForPing
protected PingMessage ping
protected PingResponseMessage pingResp
protected long closeTimeout
protected Map properties
protected ID containerID
protected Object pingLock
protected final Object outputStreamLock
public SSLClient(Socket aSocket, ObjectInputStream iStream, ObjectOutputStream oStream, ISynchAsynchEventHandler handler) throws IOException
IOExceptionpublic SSLClient(Socket aSocket, ObjectInputStream iStream, ObjectOutputStream oStream, ISynchAsynchEventHandler handler, int maxmsgs) throws IOException
IOExceptionpublic SSLClient(ISynchAsynchEventHandler handler, int keepAlive)
public ID getLocalID()
IConnectiongetLocalID in interface IConnectionpublic void removeListener(IConnectionListener l)
IConnectionremoveListener in interface IConnectionl - the listener to removepublic void addListener(IConnectionListener l)
IConnectionaddListener in interface IConnectionl - the listener to addpublic boolean isConnected()
isConnected in interface IConnectionpublic boolean isStarted()
isStarted in interface IConnectionpublic Object connect(ID remote, Object data, int timeout) throws ECFException
IConnectionconnect in interface IConnectionremote - the identity of the remote to connect to. Must not be null.data - any data to send with the connection request (e.g. password or
other authentication data)timeout - the timeout (in ms) for the connection to occurECFException - thrown if some problem with connectpublic void setCloseTimeout(long t)
public void start()
IConnectionstart in interface IConnectionpublic void stop()
IConnectionstop in interface IConnectionpublic void disconnect()
IConnectiondisconnect in interface IConnectionpublic void sendAsynch(ID recipient, byte[] obj) throws IOException
IAsynchConnectionsendAsynch in interface IAsynchConnectionrecipient - the ID of the intended receiverobj - the data to sendIOException - thrown if data cannot be sent (e.g. disconnected)public void sendAsynch(ID recipient, Object obj) throws IOException
IOExceptionpublic void queueObject(ID recipient, Serializable obj) throws IOException
IOExceptionpublic Serializable sendObject(ID recipient, Serializable obj) throws IOException
IOExceptionpublic Object sendSynch(ID rec, Object obj) throws IOException
IOExceptionpublic Object sendSynch(ID rec, byte[] obj) throws IOException
ISynchConnectionsendSynch in interface ISynchConnectionrec - the receiver to receive the synchronous requestobj - the data to sendIOException - thrown if sending cannot occur (e.g. not connected)public Map getProperties()
IConnectiongetProperties in interface IConnectionpublic Object getAdapter(Class clazz)
getAdapter in interface org.eclipse.core.runtime.IAdaptableprotected void debug(String msg)
public void setProperties(Map props)
Copyright © 2004–2020 Eclipse Foundation. All rights reserved.