From ba87743087d12306ea3d74b4f50d13a13bed3614 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 29 Apr 2013 10:17:57 -0400 Subject: [PATCH] Polish (minor) --- .../adapter/WebSocketHandlerInvoker.java | 1 - .../support/BeanCreatingHandlerProvider.java | 22 ++++++++----------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/spring-websocket/src/main/java/org/springframework/websocket/adapter/WebSocketHandlerInvoker.java b/spring-websocket/src/main/java/org/springframework/websocket/adapter/WebSocketHandlerInvoker.java index d67bce9c07..f2090b5d6c 100644 --- a/spring-websocket/src/main/java/org/springframework/websocket/adapter/WebSocketHandlerInvoker.java +++ b/spring-websocket/src/main/java/org/springframework/websocket/adapter/WebSocketHandlerInvoker.java @@ -61,7 +61,6 @@ public class WebSocketHandlerInvoker implements WebSocketHandler { } try { Assert.isTrue(this.sessionCount.compareAndSet(0, 1), "Unexpected new session"); - this.handler.afterConnectionEstablished(session); } catch (Throwable ex) { diff --git a/spring-websocket/src/main/java/org/springframework/websocket/support/BeanCreatingHandlerProvider.java b/spring-websocket/src/main/java/org/springframework/websocket/support/BeanCreatingHandlerProvider.java index c4c5b1b7da..4ed2092447 100644 --- a/spring-websocket/src/main/java/org/springframework/websocket/support/BeanCreatingHandlerProvider.java +++ b/spring-websocket/src/main/java/org/springframework/websocket/support/BeanCreatingHandlerProvider.java @@ -34,14 +34,14 @@ public class BeanCreatingHandlerProvider implements BeanFactoryAware { private static final Log logger = LogFactory.getLog(BeanCreatingHandlerProvider.class); - private final Class handlerClass; + private final Class handlerType; private AutowireCapableBeanFactory beanFactory; - public BeanCreatingHandlerProvider(Class handlerClass) { - Assert.notNull(handlerClass, "handlerClass is required"); - this.handlerClass = handlerClass; + public BeanCreatingHandlerProvider(Class handlerType) { + Assert.notNull(handlerType, "handlerType is required"); + this.handlerType = handlerType; } @@ -52,24 +52,20 @@ public class BeanCreatingHandlerProvider implements BeanFactoryAware { } } - public boolean isSingleton() { - return false; - } - public Class getHandlerType() { - return this.handlerClass; + return this.handlerType; } public T getHandler() { if (logger.isTraceEnabled()) { - logger.trace("Creating instance for handler type " + this.handlerClass); + logger.trace("Creating instance for handler type " + this.handlerType); } if (this.beanFactory == null) { logger.warn("No BeanFactory available, attempting to use default constructor"); - return BeanUtils.instantiate(this.handlerClass); + return BeanUtils.instantiate(this.handlerType); } else { - return this.beanFactory.createBean(this.handlerClass); + return this.beanFactory.createBean(this.handlerType); } } @@ -84,7 +80,7 @@ public class BeanCreatingHandlerProvider implements BeanFactoryAware { @Override public String toString() { - return "BeanCreatingHandlerProvider [handlerClass=" + handlerClass + "]"; + return "BeanCreatingHandlerProvider [handlerClass=" + handlerType + "]"; } }