Class SSLClient
- java.lang.Object
- 
- org.eclipse.ecf.provider.comm.tcp.SSLClient
 
- 
- All Implemented Interfaces:
- org.eclipse.core.runtime.IAdaptable,- IAsynchConnection,- IConnection,- ISynchAsynchConnection,- ISynchConnection
 
 public final class SSLClient extends Object implements ISynchAsynchConnection - Since:
- 4.3
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected longcloseTimeoutprotected IDcontainerIDstatic longDEFAULT_CLOSE_TIMEOUTstatic intDEFAULT_MAX_BUFFER_MSGstatic intDEFAULT_RCVR_PRIORITYstatic intDEFAULT_SNDR_PRIORITYstatic intDEFAULT_WAIT_INTERVALprotected ISynchAsynchEventHandlerhandlerprotected ObjectInputStreaminputStreamprotected booleanisClosingprotected intkeepAliveprotected ThreadkeepAliveThreadprotected ObjectOutputStreamoutputStreamprotected ObjectoutputStreamLockprotected PingMessagepingprotected ObjectpingLockprotected PingResponseMessagepingRespprotected Mappropertiesstatic StringPROTOCOLprotected SimpleFIFOQueuequeueprotected ThreadrcvThreadprotected ThreadsendThreadprotected Socketsocketprotected booleanwaitForPing
 - 
Constructor SummaryConstructors Constructor Description SSLClient(Socket aSocket, ObjectInputStream iStream, ObjectOutputStream oStream, ISynchAsynchEventHandler handler)SSLClient(Socket aSocket, ObjectInputStream iStream, ObjectOutputStream oStream, ISynchAsynchEventHandler handler, int maxmsgs)SSLClient(ISynchAsynchEventHandler handler, int keepAlive)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(IConnectionListener l)Add comm layer event listenerObjectconnect(ID remote, Object data, int timeout)Connect to a remote processprotected voiddebug(String msg)voiddisconnect()DisconnectObjectgetAdapter(Class clazz)IDgetLocalID()Get local ID for this connectionMapgetProperties()Get properties for this connectionbooleanisConnected()booleanisStarted()voidqueueObject(ID recipient, Serializable obj)voidremoveListener(IConnectionListener l)remove comm layer event listenervoidsendAsynch(ID recipient, byte[] obj)Send data asynchronously.voidsendAsynch(ID recipient, Object obj)SerializablesendObject(ID recipient, Serializable obj)ObjectsendSynch(ID rec, byte[] obj)Send data synchronously, blocking until a result is receivedObjectsendSynch(ID rec, Object obj)voidsetCloseTimeout(long t)voidsetProperties(Map props)voidstart()Start connectionvoidstop()Stop connectionprotected voidtraceStack(String msg, Throwable e)
 
- 
- 
- 
Field Detail- 
PROTOCOLpublic static final String PROTOCOL - See Also:
- Constant Field Values
 
 - 
DEFAULT_SNDR_PRIORITYpublic static final int DEFAULT_SNDR_PRIORITY - See Also:
- Constant Field Values
 
 - 
DEFAULT_RCVR_PRIORITYpublic static final int DEFAULT_RCVR_PRIORITY - See Also:
- Constant Field Values
 
 - 
DEFAULT_CLOSE_TIMEOUTpublic static final long DEFAULT_CLOSE_TIMEOUT - See Also:
- Constant Field Values
 
 - 
DEFAULT_MAX_BUFFER_MSGpublic static final int DEFAULT_MAX_BUFFER_MSG - See Also:
- Constant Field Values
 
 - 
DEFAULT_WAIT_INTERVALpublic static final int DEFAULT_WAIT_INTERVAL - See Also:
- Constant Field Values
 
 - 
socketprotected Socket socket 
 - 
outputStreamprotected ObjectOutputStream outputStream 
 - 
inputStreamprotected ObjectInputStream inputStream 
 - 
handlerprotected ISynchAsynchEventHandler handler 
 - 
queueprotected SimpleFIFOQueue queue 
 - 
keepAliveprotected int keepAlive 
 - 
sendThreadprotected Thread sendThread 
 - 
rcvThreadprotected Thread rcvThread 
 - 
keepAliveThreadprotected Thread keepAliveThread 
 - 
isClosingprotected boolean isClosing 
 - 
waitForPingprotected boolean waitForPing 
 - 
pingprotected PingMessage ping 
 - 
pingRespprotected PingResponseMessage pingResp 
 - 
closeTimeoutprotected long closeTimeout 
 - 
propertiesprotected Map properties 
 - 
containerIDprotected ID containerID 
 - 
pingLockprotected Object pingLock 
 - 
outputStreamLockprotected final Object outputStreamLock 
 
- 
 - 
Constructor Detail- 
SSLClientpublic SSLClient(Socket aSocket, ObjectInputStream iStream, ObjectOutputStream oStream, ISynchAsynchEventHandler handler) throws IOException - Throws:
- IOException
 
 - 
SSLClientpublic SSLClient(Socket aSocket, ObjectInputStream iStream, ObjectOutputStream oStream, ISynchAsynchEventHandler handler, int maxmsgs) throws IOException - Throws:
- IOException
 
 - 
SSLClientpublic SSLClient(ISynchAsynchEventHandler handler, int keepAlive) 
 
- 
 - 
Method Detail- 
getLocalIDpublic ID getLocalID() Description copied from interface:IConnectionGet local ID for this connection- Specified by:
- getLocalIDin interface- IConnection
- Returns:
- ID associated with local instance
 
 - 
removeListenerpublic void removeListener(IConnectionListener l) Description copied from interface:IConnectionremove comm layer event listener- Specified by:
- removeListenerin interface- IConnection
- Parameters:
- l- the listener to remove
 
 - 
addListenerpublic void addListener(IConnectionListener l) Description copied from interface:IConnectionAdd comm layer event listener- Specified by:
- addListenerin interface- IConnection
- Parameters:
- l- the listener to add
 
 - 
isConnectedpublic boolean isConnected() - Specified by:
- isConnectedin interface- IConnection
- Returns:
- true if the implementing class has been previously connected, false if not connected
 
 - 
isStartedpublic boolean isStarted() - Specified by:
- isStartedin interface- IConnection
- Returns:
- true if connection is started, false otherwise
 
 - 
connectpublic Object connect(ID remote, Object data, int timeout) throws ECFException Description copied from interface:IConnectionConnect to a remote process- Specified by:
- connectin interface- IConnection
- Parameters:
- remote- 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 occur
- Returns:
- a result object that is of type specific to provider implementation
- Throws:
- ECFException- thrown if some problem with connect
 
 - 
setCloseTimeoutpublic void setCloseTimeout(long t) 
 - 
startpublic void start() Description copied from interface:IConnectionStart connection- Specified by:
- startin interface- IConnection
 
 - 
stoppublic void stop() Description copied from interface:IConnectionStop connection- Specified by:
- stopin interface- IConnection
 
 - 
disconnectpublic void disconnect() Description copied from interface:IConnectionDisconnect- Specified by:
- disconnectin interface- IConnection
 
 - 
sendAsynchpublic void sendAsynch(ID recipient, byte[] obj) throws IOException Description copied from interface:IAsynchConnectionSend data asynchronously. Implementing classes should not block on sending the given data and return immediately.- Specified by:
- sendAsynchin interface- IAsynchConnection
- Parameters:
- recipient- the ID of the intended receiver
- obj- the data to send
- Throws:
- IOException- thrown if data cannot be sent (e.g. disconnected)
 
 - 
sendAsynchpublic void sendAsynch(ID recipient, Object obj) throws IOException - Throws:
- IOException
 
 - 
queueObjectpublic void queueObject(ID recipient, Serializable obj) throws IOException - Throws:
- IOException
 
 - 
sendObjectpublic Serializable sendObject(ID recipient, Serializable obj) throws IOException - Throws:
- IOException
 
 - 
sendSynchpublic Object sendSynch(ID rec, Object obj) throws IOException - Throws:
- IOException
 
 - 
sendSynchpublic Object sendSynch(ID rec, byte[] obj) throws IOException Description copied from interface:ISynchConnectionSend data synchronously, blocking until a result is received- Specified by:
- sendSynchin interface- ISynchConnection
- Parameters:
- rec- the receiver to receive the synchronous request
- obj- the data to send
- Returns:
- the data received. The return type will be specific to the provider implementation.
- Throws:
- IOException- thrown if sending cannot occur (e.g. not connected)
 
 - 
getPropertiespublic Map getProperties() Description copied from interface:IConnectionGet properties for this connection- Specified by:
- getPropertiesin interface- IConnection
- Returns:
- Map the properties associated with this connection. May be null.
 
 - 
getAdapterpublic Object getAdapter(Class clazz) - Specified by:
- getAdapterin interface- org.eclipse.core.runtime.IAdaptable
 
 - 
debugprotected void debug(String msg) 
 - 
setPropertiespublic void setProperties(Map props) 
 
- 
 
-