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 java.lang.Object implements ListenerEndpoint
Default implementation ofListenerEndpoint
.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description ListenerEndpointImpl(java.net.SocketAddress address, ListenerEndpointClosedCallback callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
void
close()
Closes this endpoint.void
completed(java.net.SocketAddress address)
void
failed(java.io.IOException exception)
java.net.SocketAddress
getAddress()
Returns the socket address of this endpoint.java.io.IOException
getException()
Returns an instance ofIOException
thrown during initialization of this endpoint ornull
, if initialization was successful.boolean
isClosed()
Determines if this endpoint has been closed and is no longer listens for incoming connections.boolean
isCompleted()
java.lang.String
toString()
void
waitFor()
Waits for completion of initialization process of this endpoint.
-
-
-
Constructor Detail
-
ListenerEndpointImpl
public ListenerEndpointImpl(java.net.SocketAddress address, ListenerEndpointClosedCallback callback)
-
-
Method Detail
-
getAddress
public java.net.SocketAddress getAddress()
Description copied from interface:ListenerEndpoint
Returns the socket address of this endpoint.- Specified by:
getAddress
in interfaceListenerEndpoint
- Returns:
- socket address.
-
isCompleted
public boolean isCompleted()
-
getException
public java.io.IOException getException()
Description copied from interface:ListenerEndpoint
Returns an instance ofIOException
thrown during initialization of this endpoint ornull
, if initialization was successful.- Specified by:
getException
in interfaceListenerEndpoint
- Returns:
- I/O exception object or
null
.
-
waitFor
public void waitFor() throws java.lang.InterruptedException
Description copied from interface:ListenerEndpoint
Waits for completion of initialization process of this endpoint.- Specified by:
waitFor
in interfaceListenerEndpoint
- Throws:
java.lang.InterruptedException
- in case the initialization process was interrupted.
-
completed
public void completed(java.net.SocketAddress address)
-
failed
public void failed(java.io.IOException exception)
-
cancel
public void cancel()
-
isClosed
public boolean isClosed()
Description copied from interface:ListenerEndpoint
Determines if this endpoint has been closed and is no longer listens for incoming connections.- Specified by:
isClosed
in interfaceListenerEndpoint
- Returns:
true
if the endpoint has been closed,false
otherwise.
-
close
public void close()
Description copied from interface:ListenerEndpoint
Closes this endpoint. The endpoint will stop accepting incoming connection.- Specified by:
close
in interfaceListenerEndpoint
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-