Skip to content

Commit

Permalink
Issue #3663 - Remove @Deprecation's from WebSocketClient
Browse files Browse the repository at this point in the history
+ Those methods and constructors that had @Deprecation assigned
  that urged the use of HttpClient directly are no longer
  annotated as deprecated because of legitimate possibility of
  a valid LinkageError

Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed May 16, 2019
1 parent 4f90eb6 commit 0eb90e4
Showing 1 changed file with 40 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ public WebSocketClient(HttpClient httpClient, DecoratedObjectFactory objectFacto
* Create a new WebSocketClient
*
* @param sslContextFactory
* ssl context factory to use
* @deprecated use {@link #WebSocketClient(HttpClient)} instead
* ssl context factory to use on the internal {@link HttpClient}
*/
@Deprecated
public WebSocketClient(SslContextFactory sslContextFactory)
{
this(sslContextFactory,null, null);
Expand All @@ -134,8 +132,7 @@ public WebSocketClient(SslContextFactory sslContextFactory)
* Create a new WebSocketClient
*
* @param executor
* the executor to use
* @deprecated use {@link #WebSocketClient(HttpClient)} instead
* the executor to use on the internal {@link HttpClient}
*/
public WebSocketClient(Executor executor)
{
Expand All @@ -146,10 +143,8 @@ public WebSocketClient(Executor executor)
* Create a new WebSocketClient
*
* @param bufferPool
* byte buffer pool to use
* @deprecated use {@link #WebSocketClient(HttpClient)} instead
* byte buffer pool to use on the internal {@link HttpClient}
*/
@Deprecated
public WebSocketClient(ByteBufferPool bufferPool)
{
this(null, null, bufferPool);
Expand All @@ -159,12 +154,10 @@ public WebSocketClient(ByteBufferPool bufferPool)
* Create a new WebSocketClient
*
* @param sslContextFactory
* ssl context factory to use
* ssl context factory to use on the internal {@link HttpClient}
* @param executor
* the executor to use
* @deprecated use {@link #WebSocketClient(HttpClient)} instead
* the executor to use on the internal {@link HttpClient}
*/
@Deprecated
public WebSocketClient(SslContextFactory sslContextFactory, Executor executor)
{
this(sslContextFactory, executor, null);
Expand Down Expand Up @@ -561,7 +554,9 @@ public SessionFactory getSessionFactory()
}

/**
* @return the {@link SslContextFactory} that manages TLS encryption
* Get the in use {@link SslContextFactory}
*
* @return the {@link SslContextFactory} that manages TLS encryption on the internal {@link HttpClient}
* @see #WebSocketClient(SslContextFactory)
*/
@Override
Expand Down Expand Up @@ -600,7 +595,7 @@ private synchronized void init()
* Factory method for new ConnectionManager
*
* @return the ConnectionManager instance to use
* @deprecated use HttpClient instead
* @deprecated has no replacement
*/
@Deprecated
protected ConnectionManager newConnectionManager()
Expand All @@ -614,9 +609,10 @@ public void setAsyncWriteTimeout(long ms)
}

/**
* @param bindAddress the address to bind to
* @deprecated (this is a bad bad bad typo) use {@link HttpClient#setBindAddress(SocketAddress)}
* on instance passed to {@link #WebSocketClient(HttpClient)}
* @param bindAddress the address to bind to the internal {@link HttpClient}
*
* @deprecated (this is a bad bad bad typo, it has 3 {@code "d"} characters in a row) use {@link HttpClient#setBindAddress(SocketAddress)}
* to the internal {@link #WebSocketClient(HttpClient)}
*/
@Deprecated
public void setBindAdddress(SocketAddress bindAddress)
Expand All @@ -626,50 +622,47 @@ public void setBindAdddress(SocketAddress bindAddress)


/**
* @param bindAddress the address to bind to
* @deprecated Use {@link HttpClient#setBindAddress(SocketAddress)}
* on instance passed to {@link #WebSocketClient(HttpClient)}
* Sets the Bind Address on the internal {@link HttpClient}.
*
* @param bindAddress the local bind address for the internal {@link HttpClient}
*/
@Deprecated
public void setBindAddress(SocketAddress bindAddress)
{
this.httpClient.setBindAddress(bindAddress);
}

/**
* Set's the Bind Address on the internal {@link HttpClient}.
*
* @param bufferPool The buffer pool
* @deprecated Use {@link HttpClient#setByteBufferPool(ByteBufferPool)}
* on the instance passed to {@link #WebSocketClient(HttpClient)}
*/
public void setBufferPool(ByteBufferPool bufferPool)
{
this.httpClient.setByteBufferPool(bufferPool);
}

/**
* Set the timeout for connecting to the remote server.
* @param ms the timeout in millisecondspool
* @deprecated Use {@link HttpClient#setConnectTimeout(long)}
* on the instance passed to {@link #WebSocketClient(HttpClient)}
* Set the timeout for connecting to the remote server on the internal {@link HttpClient}
*
* @param ms the timeout in milliseconds
*/
public void setConnectTimeout(long ms)
{
this.httpClient.setConnectTimeout(ms);
}

/**
* Set the {@link CookieStore} to use on the internal {@link HttpClient}
*
* @param cookieStore The cookie store
* @deprecated Use {@link HttpClient#setCookieStore(CookieStore)} on the HttpClient instance passed
* to {@link #WebSocketClient(HttpClient)}
*/
@Deprecated
public void setCookieStore(CookieStore cookieStore)
{
this.httpClient.setCookieStore(cookieStore);
}

/**
* @deprecated not used, configure threading in HttpClient instead
* @deprecated not used, configure threading in {@link HttpClient} instead
* @param daemon do nothing
*/
@Deprecated
Expand All @@ -678,26 +671,29 @@ public void setDaemon(boolean daemon)
// do nothing
}

/**
* @param dispatchIO true to have IO operations be dispatched to Executor
* @deprecated no longer used, this has no replacement
*/
@Deprecated
public void setDispatchIO(boolean dispatchIO)
{
this.httpClient.setDispatchIO(dispatchIO);
}

/**
* Sets the Executor in use on the internal {@link HttpClient}
*
* @param executor The executor to use
* @deprecated Use {@link HttpClient#setExecutor(Executor)}
* on the instance passed to {@link #WebSocketClient(HttpClient)}
*/
@Deprecated
public void setExecutor(Executor executor)
{
this.httpClient.setExecutor(executor);
}

/**
* @param masker does nothing
* @deprecated not used, no replacement
* @param masker do nothing
*/
@Deprecated
public void setMasker(Masker masker)
Expand Down Expand Up @@ -728,6 +724,15 @@ public void setMaxTextMessageBufferSize(int max)
getPolicy().setMaxTextMessageBufferSize(max);
}

/**
* Get the internal {@link HttpClient}.
* <p>
* Note: this can result in a {@link LinkageError} if used within a WebApp that runs
* on a server that also has {@link HttpClient} on the server classpath.
* </p>
*
* @return the internal {@link HttpClient}
*/
public HttpClient getHttpClient()
{
return this.httpClient;
Expand Down

0 comments on commit 0eb90e4

Please sign in to comment.