Skip to content

Commit

Permalink
Suffix extensions with Attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Nov 30, 2015
1 parent c6500ad commit 51653d8
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion client/src/main/java/org/asynchttpclient/Realm.java
Expand Up @@ -101,7 +101,6 @@ public String getPassword() {
}

public AuthScheme getScheme() {

return scheme;
}

Expand Down
Expand Up @@ -60,7 +60,7 @@ public interface AsyncHandlerExtensions {
*
* @param remoteAddress the address we try to connect to
*/
void onTcpConnect(InetSocketAddress remoteAddress);
void onTcpConnectAttempt(InetSocketAddress remoteAddress);

/**
* Notify the callback after a successful connect
Expand All @@ -85,7 +85,7 @@ public interface AsyncHandlerExtensions {
/**
* Notify the callback before TLS handshake
*/
void onTlsHandshake();
void onTlsHandshakeAttempt();

/**
* Notify the callback after the TLS was successful
Expand All @@ -104,7 +104,7 @@ public interface AsyncHandlerExtensions {
/**
* Notify the callback when trying to fetch a connection from the pool.
*/
void onConnectionPool();
void onConnectionPoolAttempt();

/**
* Notify the callback when a new connection was successfully fetched from the pool.
Expand Down
Expand Up @@ -36,7 +36,7 @@ public void onHostnameResolutionFailure(String name, Throwable cause) {
}

@Override
public void onTcpConnect(InetSocketAddress address) {
public void onTcpConnectAttempt(InetSocketAddress address) {
}

@Override
Expand All @@ -48,7 +48,7 @@ public void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause
}

@Override
public void onTlsHandshake() {
public void onTlsHandshakeAttempt() {
}

@Override
Expand All @@ -60,7 +60,7 @@ public void onTlsHandshakeFailure(Throwable cause) {
}

@Override
public void onConnectionPool() {
public void onConnectionPoolAttempt() {
}

@Override
Expand Down
Expand Up @@ -90,7 +90,7 @@ public void onSuccess(Channel channel) throws Exception {
final AsyncHandlerExtensions asyncHandlerExtensions = toAsyncHandlerExtensions(future.getAsyncHandler());

if (asyncHandlerExtensions != null)
asyncHandlerExtensions.onTlsHandshake();
asyncHandlerExtensions.onTlsHandshakeAttempt();

sslHandler.handshakeFuture().addListener(new SimpleGenericFutureListener<Channel>() {

Expand Down
Expand Up @@ -48,7 +48,7 @@ public void connect(final Bootstrap bootstrap, final NettyConnectListener<?> con
final InetSocketAddress remoteAddress = remoteAddresses.get(i);

if (asyncHandlerExtensions != null)
asyncHandlerExtensions.onTcpConnect(remoteAddress);
asyncHandlerExtensions.onTcpConnectAttempt(remoteAddress);

final ChannelFuture future = localAddress != null ? bootstrap.connect(remoteAddress, localAddress) : bootstrap.connect(remoteAddress);

Expand Down
Expand Up @@ -470,7 +470,7 @@ else if (!request.getMethod().equals(GET))
private Channel pollPooledChannel(Request request, ProxyServer proxy, AsyncHandler<?> asyncHandler) {

if (asyncHandler instanceof AsyncHandlerExtensions)
AsyncHandlerExtensions.class.cast(asyncHandler).onConnectionPool();
AsyncHandlerExtensions.class.cast(asyncHandler).onConnectionPoolAttempt();

Uri uri = request.getUri();
String virtualHost = request.getVirtualHost();
Expand Down
Expand Up @@ -32,5 +32,4 @@ public SSLEngine newSslEngine(AsyncHttpClientConfig config, String peerHost, int
configureSslEngine(sslEngine, config);
return sslEngine;
}

}
Expand Up @@ -133,19 +133,19 @@ public void onHostnameResolutionSuccess(String name, List<InetSocketAddress> add
@Override
public void onHostnameResolutionFailure(String name, Throwable cause) {}
@Override
public void onTcpConnect(InetSocketAddress address) {}
public void onTcpConnectAttempt(InetSocketAddress address) {}
@Override
public void onTcpConnectSuccess(InetSocketAddress address, Channel connection) {}
@Override
public void onTcpConnectFailure(InetSocketAddress address, Throwable cause) {}
@Override
public void onTlsHandshake() {}
public void onTlsHandshakeAttempt() {}
@Override
public void onTlsHandshakeSuccess() {}
@Override
public void onTlsHandshakeFailure(Throwable cause) {}
@Override
public void onConnectionPool() {}
public void onConnectionPoolAttempt() {}
@Override
public void onConnectionPooled(Channel connection) {}
@Override
Expand Down
Expand Up @@ -95,7 +95,7 @@ public State onContentWritten() {
}

@Override
public void onTcpConnect(InetSocketAddress address) {
public void onTcpConnectAttempt(InetSocketAddress address) {
firedEvents.add(CONNECTION_OPEN_EVENT);
}

Expand Down Expand Up @@ -125,7 +125,7 @@ public void onHostnameResolutionFailure(String name, Throwable cause) {
}

@Override
public void onTlsHandshake() {
public void onTlsHandshakeAttempt() {
firedEvents.add(TLS_HANDSHAKE_EVENT);
}

Expand All @@ -140,7 +140,7 @@ public void onTlsHandshakeFailure(Throwable cause) {
}

@Override
public void onConnectionPool() {
public void onConnectionPoolAttempt() {
firedEvents.add(CONNECTION_POOL_EVENT);
}

Expand Down

0 comments on commit 51653d8

Please sign in to comment.