Removing WebSocketClient.getConnection() as inappropriate
This commit is contained in:
parent
4a8a1228fc
commit
802e97e6fb
|
@ -24,7 +24,6 @@ import java.net.URI;
|
|||
import org.eclipse.jetty.util.FutureCallback;
|
||||
import org.eclipse.jetty.websocket.api.UpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.api.UpgradeResponse;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
|
||||
import org.eclipse.jetty.websocket.client.masks.Masker;
|
||||
import org.eclipse.jetty.websocket.common.events.EventDriver;
|
||||
|
@ -33,8 +32,6 @@ public interface WebSocketClient
|
|||
{
|
||||
public FutureCallback<UpgradeResponse> connect(URI websocketUri) throws IOException;
|
||||
|
||||
public WebSocketConnection getConnection();
|
||||
|
||||
public WebSocketClientFactory getFactory();
|
||||
|
||||
public Masker getMasker();
|
||||
|
|
|
@ -79,11 +79,10 @@ public class ConnectionManager extends ContainerLifeCycle
|
|||
|
||||
return new InetSocketAddress(uri.getHost(),port);
|
||||
}
|
||||
private final Queue<WebSocketClient> clients = new ConcurrentLinkedQueue<>();
|
||||
private final Queue<DefaultWebSocketClient> clients = new ConcurrentLinkedQueue<>();
|
||||
private final WebSocketClientSelectorManager selector;
|
||||
|
||||
public ConnectionManager(ByteBufferPool bufferPool, Executor executor, Scheduler scheduler, SslContextFactory sslContextFactory,
|
||||
WebSocketPolicy policy)
|
||||
public ConnectionManager(ByteBufferPool bufferPool, Executor executor, Scheduler scheduler, SslContextFactory sslContextFactory, WebSocketPolicy policy)
|
||||
{
|
||||
// TODO: configure connect timeout
|
||||
selector = new WebSocketClientSelectorManager(bufferPool,executor,scheduler,policy);
|
||||
|
@ -91,14 +90,14 @@ public class ConnectionManager extends ContainerLifeCycle
|
|||
addBean(selector);
|
||||
}
|
||||
|
||||
public void addClient(WebSocketClient client)
|
||||
public void addClient(DefaultWebSocketClient client)
|
||||
{
|
||||
clients.add(client);
|
||||
}
|
||||
|
||||
private void closeConnections()
|
||||
{
|
||||
for (WebSocketClient client : clients)
|
||||
for (DefaultWebSocketClient client : clients)
|
||||
{
|
||||
if (client.getConnection() != null)
|
||||
{
|
||||
|
@ -144,7 +143,7 @@ public class ConnectionManager extends ContainerLifeCycle
|
|||
super.doStop();
|
||||
}
|
||||
|
||||
public Collection<WebSocketClient> getClients()
|
||||
public Collection<DefaultWebSocketClient> getClients()
|
||||
{
|
||||
return Collections.unmodifiableCollection(clients);
|
||||
}
|
||||
|
|
|
@ -139,12 +139,6 @@ public class DefaultWebSocketClient extends FutureCallback<UpgradeResponse> impl
|
|||
return upgradeRequest;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jetty.websocket.client.internal.WebSocketClient#getConnection()
|
||||
*/
|
||||
@Override
|
||||
public WebSocketConnection getConnection()
|
||||
{
|
||||
return this.connection;
|
||||
|
|
Loading…
Reference in New Issue