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 + "]"; } }