/** * Strategy method used to obtain the {@link ConversionService}. By default this * method expects a bean named {@code 'webSocketConversionService'} in the * {@link #getApplicationContext() active ApplicationContext}. * @return the {@link ConversionService} (never null) */ protected ConversionService getConversionService() { ApplicationContext applicationContext = getApplicationContext(); Assert.state(applicationContext != null, "Unable to locate the Spring ApplicationContext"); try { return applicationContext.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class); } catch (BeansException ex) { throw new IllegalStateException("Unable to find ConversionService: please configure a '" + CONVERSION_SERVICE_BEAN_NAME + "' or override the getConversionService() method", ex); } }
/** * Called to initialize the encoder/decoder. * @see javax.websocket.Encoder#init(EndpointConfig) * @see javax.websocket.Decoder#init(EndpointConfig) */ public void init(EndpointConfig config) { ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null && applicationContext instanceof ConfigurableApplicationContext) { ConfigurableListableBeanFactory beanFactory = ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); beanFactory.autowireBean(this); } }
/** * Strategy method used to obtain the {@link ConversionService}. By default this * method expects a bean named {@code 'webSocketConversionService'} in the * {@link #getApplicationContext() active ApplicationContext}. * @return the {@link ConversionService} (never null) */ protected ConversionService getConversionService() { ApplicationContext applicationContext = getApplicationContext(); Assert.state(applicationContext != null, "Unable to locate the Spring ApplicationContext"); try { return applicationContext.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class); } catch (BeansException ex) { throw new IllegalStateException("Unable to find ConversionService: please configure a '" + CONVERSION_SERVICE_BEAN_NAME + "' or override the getConversionService() method", ex); } }
/** * Strategy method used to obtain the {@link ConversionService}. By default this * method expects a bean named {@code 'webSocketConversionService'} in the * {@link #getApplicationContext() active ApplicationContext}. * @return the {@link ConversionService} (never null) */ protected ConversionService getConversionService() { ApplicationContext applicationContext = getApplicationContext(); Assert.state(applicationContext != null, "Unable to locate the Spring ApplicationContext"); try { return applicationContext.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class); } catch (BeansException ex) { throw new IllegalStateException("Unable to find ConversionService: please configure a '" + CONVERSION_SERVICE_BEAN_NAME + "' or override the getConversionService() method", ex); } }
/** * @see javax.websocket.Encoder#init(EndpointConfig) * @see javax.websocket.Decoder#init(EndpointConfig) */ public void init(EndpointConfig config) { ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null && applicationContext instanceof ConfigurableApplicationContext) { ConfigurableListableBeanFactory beanFactory = ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); beanFactory.autowireBean(this); } }
/** * Called to initialize the encoder/decoder. * @see javax.websocket.Encoder#init(EndpointConfig) * @see javax.websocket.Decoder#init(EndpointConfig) */ public void init(EndpointConfig config) { ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null && applicationContext instanceof ConfigurableApplicationContext) { ConfigurableListableBeanFactory beanFactory = ((ConfigurableApplicationContext) applicationContext).getBeanFactory(); beanFactory.autowireBean(this); } }