Refinement of factorymethod approach in WebSocketClient (for cometd to use)

This commit is contained in:
Joakim Erdfelt 2013-02-22 10:49:49 -07:00
parent 12814b02ed
commit dbf3662f90
2 changed files with 3 additions and 5 deletions

View File

@ -188,7 +188,7 @@ public class WebSocketClient extends ContainerLifeCycle
cookieStore = new HttpCookieStore.Empty();
}
this.connectionManager = newConnectionManager(this);
this.connectionManager = newConnectionManager();
addBean(this.connectionManager);
super.doStart();
@ -303,11 +303,9 @@ public class WebSocketClient extends ContainerLifeCycle
/**
* Factory method for new ConnectionManager (used by other projects like cometd)
*
* @param client
* the client used to create the {@link ConnectionManager}
* @return the ConnectionManager instance to use
*/
protected ConnectionManager newConnectionManager(WebSocketClient client)
protected ConnectionManager newConnectionManager()
{
return new ConnectionManager(this);
}

View File

@ -176,7 +176,7 @@ public class ConnectionManager extends ContainerLifeCycle
@Override
protected void doStart() throws Exception
{
selector = new WebSocketClientSelectorManager(client);
selector = newWebSocketClientSelectorManager(client);
selector.setSslContextFactory(client.getSslContextFactory());
selector.setConnectTimeout(client.getConnectTimeout());
addBean(selector);