From cae79aabc522c715120a64946906f212cbb67517 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 10 Oct 2012 11:12:00 -0700 Subject: [PATCH] Fixing naming --- .../client/WebSocketClientFactory.java | 17 +++-------------- .../client/internal/ConnectionManager.java | 2 +- ...tClient.java => DefaultWebSocketClient.java} | 6 +++--- .../internal/io/WebSocketClientConnection.java | 8 ++++---- .../io/WebSocketClientSelectorManager.java | 6 +++--- 5 files changed, 14 insertions(+), 25 deletions(-) rename jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/{IWebSocketClient.java => DefaultWebSocketClient.java} (96%) diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java index a6eb29e605e..8d696bceb52 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClientFactory.java @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.TimerScheduler; import org.eclipse.jetty.websocket.client.internal.ConnectionManager; -import org.eclipse.jetty.websocket.client.internal.IWebSocketClient; +import org.eclipse.jetty.websocket.client.internal.DefaultWebSocketClient; import org.eclipse.jetty.websocket.core.api.Extension; import org.eclipse.jetty.websocket.core.api.ExtensionRegistry; import org.eclipse.jetty.websocket.core.api.WebSocketPolicy; @@ -127,7 +127,7 @@ public class WebSocketClientFactory extends ContainerLifeCycle /** * The address to bind local physical (outgoing) TCP Sockets to. - * + * * @return the address to bind the socket channel to * @see #setBindAddress(SocketAddress) */ @@ -190,7 +190,7 @@ public class WebSocketClientFactory extends ContainerLifeCycle { LOG.debug("Creating new WebSocket for {}",websocketPojo); EventDriver websocket = eventDriverFactory.wrap(websocketPojo); - return new IWebSocketClient(this,websocket); + return new DefaultWebSocketClient(this,websocket); } public boolean sessionClosed(WebSocketSession session) @@ -204,17 +204,6 @@ public class WebSocketClientFactory extends ContainerLifeCycle { LOG.debug("Session Opened: {}",session); } - // FIXME: what is going on? - // if (!isRunning()) - // { - // LOG.debug("Factory.isRunning: {}",this.isRunning()); - // LOG.debug("Factory.isStarted: {}",this.isStarted()); - // LOG.debug("Factory.isStarting: {}",this.isStarting()); - // LOG.debug("Factory.isStopped: {}",this.isStopped()); - // LOG.debug("Factory.isStopping: {}",this.isStopping()); - // LOG.warn("Factory is not running"); - // return false; - // } boolean ret = sessions.offer(session); session.onConnect(); return ret; diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/ConnectionManager.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/ConnectionManager.java index 1dfedf8bf6d..0cb7c902bca 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/ConnectionManager.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/ConnectionManager.java @@ -107,7 +107,7 @@ public class ConnectionManager extends ContainerLifeCycle } } - public FutureCallback connectPhysical(IWebSocketClient client) throws IOException + public FutureCallback connectPhysical(DefaultWebSocketClient client) throws IOException { SocketChannel channel = SocketChannel.open(); SocketAddress bindAddress = client.getFactory().getBindAddress(); diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/IWebSocketClient.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/DefaultWebSocketClient.java similarity index 96% rename from jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/IWebSocketClient.java rename to jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/DefaultWebSocketClient.java index 19947262baa..609b49b570d 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/IWebSocketClient.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/DefaultWebSocketClient.java @@ -38,9 +38,9 @@ import org.eclipse.jetty.websocket.core.io.event.EventDriver; /** * WebSocketClient for working with Upgrade (request and response), and establishing connections to the websocket URI of your choice. */ -public class IWebSocketClient extends FutureCallback implements WebSocketClient +public class DefaultWebSocketClient extends FutureCallback implements WebSocketClient { - private static final Logger LOG = Log.getLogger(IWebSocketClient.class); + private static final Logger LOG = Log.getLogger(DefaultWebSocketClient.class); private final WebSocketClientFactory factory; private final WebSocketPolicy policy; @@ -57,7 +57,7 @@ public class IWebSocketClient extends FutureCallback implements private ClientUpgradeResponse upgradeResponse; private Masker masker; - public IWebSocketClient(WebSocketClientFactory factory, EventDriver websocket) + public DefaultWebSocketClient(WebSocketClientFactory factory, EventDriver websocket) { this.factory = factory; LOG.debug("factory.isRunning(): {}",factory.isRunning()); diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientConnection.java index 5eb378d1192..79ed5233425 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientConnection.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientConnection.java @@ -23,7 +23,7 @@ import java.util.concurrent.Executor; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.websocket.client.WebSocketClientFactory; -import org.eclipse.jetty.websocket.client.internal.IWebSocketClient; +import org.eclipse.jetty.websocket.client.internal.DefaultWebSocketClient; import org.eclipse.jetty.websocket.client.masks.Masker; import org.eclipse.jetty.websocket.core.io.AbstractWebSocketConnection; import org.eclipse.jetty.websocket.core.protocol.WebSocketFrame; @@ -34,11 +34,11 @@ import org.eclipse.jetty.websocket.core.protocol.WebSocketFrame; public class WebSocketClientConnection extends AbstractWebSocketConnection { private final WebSocketClientFactory factory; - private final IWebSocketClient client; + private final DefaultWebSocketClient client; private final Masker masker; private boolean connected; - public WebSocketClientConnection(EndPoint endp, Executor executor, IWebSocketClient client) + public WebSocketClientConnection(EndPoint endp, Executor executor, DefaultWebSocketClient client) { super(endp,executor,client.getFactory().getScheduler(),client.getPolicy(),client.getFactory().getBufferPool()); this.client = client; @@ -47,7 +47,7 @@ public class WebSocketClientConnection extends AbstractWebSocketConnection this.masker = client.getMasker(); } - public IWebSocketClient getClient() + public DefaultWebSocketClient getClient() { return client; } diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientSelectorManager.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientSelectorManager.java index 44b2bb1feb2..70a28cb7b45 100644 --- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientSelectorManager.java +++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/internal/io/WebSocketClientSelectorManager.java @@ -35,7 +35,7 @@ import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.websocket.client.WebSocketClientFactory; -import org.eclipse.jetty.websocket.client.internal.IWebSocketClient; +import org.eclipse.jetty.websocket.client.internal.DefaultWebSocketClient; import org.eclipse.jetty.websocket.core.api.WebSocketPolicy; public class WebSocketClientSelectorManager extends SelectorManager @@ -61,7 +61,7 @@ public class WebSocketClientSelectorManager extends SelectorManager public Connection newConnection(final SocketChannel channel, EndPoint endPoint, final Object attachment) throws IOException { LOG.debug("newConnection({},{},{})",channel,endPoint,attachment); - IWebSocketClient client = (IWebSocketClient)attachment; + DefaultWebSocketClient client = (DefaultWebSocketClient)attachment; try { @@ -118,7 +118,7 @@ public class WebSocketClientSelectorManager extends SelectorManager return engine; } - public UpgradeConnection newUpgradeConnection(SocketChannel channel, EndPoint endPoint, IWebSocketClient client) + public UpgradeConnection newUpgradeConnection(SocketChannel channel, EndPoint endPoint, DefaultWebSocketClient client) { WebSocketClientFactory factory = client.getFactory(); Executor executor = factory.getExecutor();