Package org.apache.sshd.common.io.nio2
Class Nio2Connector.DefaultIoConnectFuture
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.future.AbstractSshFuture<T>
-
- org.apache.sshd.common.future.DefaultSshFuture<IoConnectFuture>
-
- org.apache.sshd.common.io.nio2.Nio2Connector.DefaultIoConnectFuture
-
- All Implemented Interfaces:
SshFuture<IoConnectFuture>
,WaitableFuture
,IoConnectFuture
- Enclosing class:
- Nio2Connector
public static class Nio2Connector.DefaultIoConnectFuture extends DefaultSshFuture<IoConnectFuture> implements IoConnectFuture
-
-
Field Summary
-
Fields inherited from class org.apache.sshd.common.future.AbstractSshFuture
CANCELED
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description DefaultIoConnectFuture(java.lang.Object id, java.lang.Object lock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getException()
Returns the cause of the connection failure.IoSession
getSession()
boolean
isConnected()
void
setException(java.lang.Throwable exception)
Sets the exception caught due to connection failure and notifies all threads waiting for this future.void
setSession(IoSession session)
Sets the newly connected session and notifies all threads waiting for this future.-
Methods inherited from class org.apache.sshd.common.future.DefaultSshFuture
addListener, await0, cancel, getNumRegisteredListeners, getValue, isCanceled, isDone, notifyListeners, removeListener, setValue, toString
-
Methods inherited from class org.apache.sshd.common.future.AbstractSshFuture
asListener, asT, await, awaitUninterruptibly, formatExceptionMessage, getId, notifyListener, verifyResult
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.io.IoConnectFuture
cancel, isCanceled
-
Methods inherited from interface org.apache.sshd.common.future.SshFuture
addListener, removeListener
-
Methods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
-
-
-
-
Method Detail
-
getSession
public IoSession getSession()
- Specified by:
getSession
in interfaceIoConnectFuture
- Returns:
- The current
IoSession
- may benull
if connect operation not finished yet or attempt has failed - See Also:
IoConnectFuture.getException()
-
getException
public java.lang.Throwable getException()
Description copied from interface:IoConnectFuture
Returns the cause of the connection failure.- Specified by:
getException
in interfaceIoConnectFuture
- Returns:
null
if the connect operation is not finished yet, or if the connection attempt is successful.- See Also:
IoConnectFuture.getSession()
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceIoConnectFuture
- Returns:
- true if the connect operation is finished successfully.
-
setSession
public void setSession(IoSession session)
Description copied from interface:IoConnectFuture
Sets the newly connected session and notifies all threads waiting for this future. This method is invoked by SSHD internally. Please do not call this method directly.- Specified by:
setSession
in interfaceIoConnectFuture
- Parameters:
session
- The connectedIoSession
-
setException
public void setException(java.lang.Throwable exception)
Description copied from interface:IoConnectFuture
Sets the exception caught due to connection failure and notifies all threads waiting for this future. This method is invoked by SSHD internally. Please do not call this method directly.- Specified by:
setException
in interfaceIoConnectFuture
- Parameters:
exception
- The caughtThrowable
-
-