Package org.apache.http.impl.nio.reactor
Class ListenerEndpointImpl
- java.lang.Object
-
- org.apache.http.impl.nio.reactor.ListenerEndpointImpl
-
- All Implemented Interfaces:
ListenerEndpoint
@Contract(threading=SAFE_CONDITIONAL) public class ListenerEndpointImpl extends Object implements ListenerEndpoint
Default implementation ofListenerEndpoint.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description ListenerEndpointImpl(SocketAddress address, ListenerEndpointClosedCallback callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidclose()Closes this endpoint.voidcompleted(SocketAddress address)voidfailed(IOException exception)SocketAddressgetAddress()Returns the socket address of this endpoint.IOExceptiongetException()Returns an instance ofIOExceptionthrown during initialization of this endpoint ornull, if initialization was successful.booleanisClosed()Determines if this endpoint has been closed and is no longer listens for incoming connections.booleanisCompleted()StringtoString()voidwaitFor()Waits for completion of initialization process of this endpoint.
-
-
-
Constructor Detail
-
ListenerEndpointImpl
public ListenerEndpointImpl(SocketAddress address, ListenerEndpointClosedCallback callback)
-
-
Method Detail
-
getAddress
public SocketAddress getAddress()
Description copied from interface:ListenerEndpointReturns the socket address of this endpoint.- Specified by:
getAddressin interfaceListenerEndpoint- Returns:
- socket address.
-
isCompleted
public boolean isCompleted()
-
getException
public IOException getException()
Description copied from interface:ListenerEndpointReturns an instance ofIOExceptionthrown during initialization of this endpoint ornull, if initialization was successful.- Specified by:
getExceptionin interfaceListenerEndpoint- Returns:
- I/O exception object or
null.
-
waitFor
public void waitFor() throws InterruptedExceptionDescription copied from interface:ListenerEndpointWaits for completion of initialization process of this endpoint.- Specified by:
waitForin interfaceListenerEndpoint- Throws:
InterruptedException- in case the initialization process was interrupted.
-
completed
public void completed(SocketAddress address)
-
failed
public void failed(IOException exception)
-
cancel
public void cancel()
-
isClosed
public boolean isClosed()
Description copied from interface:ListenerEndpointDetermines if this endpoint has been closed and is no longer listens for incoming connections.- Specified by:
isClosedin interfaceListenerEndpoint- Returns:
trueif the endpoint has been closed,falseotherwise.
-
close
public void close()
Description copied from interface:ListenerEndpointCloses this endpoint. The endpoint will stop accepting incoming connection.- Specified by:
closein interfaceListenerEndpoint
-
-