/** * Set the {@link BeanWiringInfoResolver} to use. * <p>The default behavior is to look for a bean with the same name as the class. * As an alternative, consider using annotation-driven bean wiring. * @see ClassNameBeanWiringInfoResolver * @see org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver */ public void setBeanWiringInfoResolver(BeanWiringInfoResolver beanWiringInfoResolver) { Assert.notNull(beanWiringInfoResolver, "BeanWiringInfoResolver must not be null"); this.beanWiringInfoResolver = beanWiringInfoResolver; }
/** * A constructor accepting a {@link WebSocketServerFactory}. * @param factory the pre-configured factory to use */ public JettyRequestUpgradeStrategy(WebSocketServerFactory factory) { Assert.notNull(factory, "WebSocketServerFactory must not be null"); this.factory = factory; }
/** * Construct a new ReplaceOverride. * @param methodName the name of the method to override * @param methodReplacerBeanName the bean name of the MethodReplacer */ public ReplaceOverride(String methodName, String methodReplacerBeanName) { super(methodName); Assert.notNull(methodName, "Method replacer bean name must not be null"); this.methodReplacerBeanName = methodReplacerBeanName; }
/** * Construct a qualifier to match against an annotation of the * given type name. * <p>The type name may match the fully-qualified class name of * the annotation or the short class name (without the package). * @param typeName the name of the annotation type */ public AutowireCandidateQualifier(String typeName) { Assert.notNull(typeName, "Type name must not be null"); this.typeName = typeName; }
/** * Constructor accepting an existing {@link WebSocketContainer} instance. * <p>For XML configuration, see {@link WebSocketContainerFactoryBean}. For Java * configuration, use {@code ContainerProvider.getWebSocketContainer()} to obtain * the {@code WebSocketContainer} instance. */ public StandardWebSocketClient(WebSocketContainer webSocketContainer) { Assert.notNull(webSocketContainer, "WebSocketContainer must not be null"); this.webSocketContainer = webSocketContainer; }
public JettyWebSocketHandlerAdapter(WebSocketHandler webSocketHandler, JettyWebSocketSession wsSession) { Assert.notNull(webSocketHandler, "WebSocketHandler must not be null"); Assert.notNull(wsSession, "WebSocketSession must not be null"); this.webSocketHandler = webSocketHandler; this.wsSession = wsSession; }
/** * A scheduler instance to use for scheduling SockJS heart-beats. */ public SockJsServiceRegistration setTaskScheduler(TaskScheduler scheduler) { Assert.notNull(scheduler, "TaskScheduler is required"); this.scheduler = scheduler; return this; }
public EndpointConnectionManager(Endpoint endpoint, String uriTemplate, Object... uriVariables) { super(uriTemplate, uriVariables); Assert.notNull(endpoint, "endpoint must not be null"); this.endpoint = endpoint; this.endpointProvider = null; }
@Override public void addEmbeddedValueResolver(StringValueResolver valueResolver) { Assert.notNull(valueResolver, "StringValueResolver must not be null"); this.embeddedValueResolvers.add(valueResolver); }
public WebMvcStompWebSocketEndpointRegistration( String[] paths, WebSocketHandler webSocketHandler, TaskScheduler sockJsTaskScheduler) { Assert.notEmpty(paths, "No paths specified"); Assert.notNull(webSocketHandler, "WebSocketHandler must not be null"); this.paths = paths; this.webSocketHandler = webSocketHandler; this.sockJsTaskScheduler = sockJsTaskScheduler; }
@Override public boolean containsBeanDefinition(String beanName) { Assert.notNull(beanName, "Bean name must not be null"); return this.beanDefinitionMap.containsKey(beanName); }
/** * Create a new {@code DefaultNamespaceHandlerResolver} using the * supplied mapping file location. * @param classLoader the {@link ClassLoader} instance used to load mapping resources * may be {@code null}, in which case the thread context ClassLoader will be used) * @param handlerMappingsLocation the mapping file location */ public DefaultNamespaceHandlerResolver(@Nullable ClassLoader classLoader, String handlerMappingsLocation) { Assert.notNull(handlerMappingsLocation, "Handler mappings location must not be null"); this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); this.handlerMappingsLocation = handlerMappingsLocation; }
@Override @Nullable public Scope getRegisteredScope(String scopeName) { Assert.notNull(scopeName, "Scope identifier must not be null"); return this.scopes.get(scopeName); }
protected ServerContainer getContainer(HttpServletRequest request) { ServletContext servletContext = request.getServletContext(); String attrName = "javax.websocket.server.ServerContainer"; ServerContainer container = (ServerContainer) servletContext.getAttribute(attrName); Assert.notNull(container, "No 'javax.websocket.server.ServerContainer' ServletContext attribute. " + "Are you running in a Servlet container that supports JSR-356?"); return container; }
@Override public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException { Assert.hasText(beanName, "'beanName' must not be empty"); Assert.notNull(beanDefinition, "BeanDefinition must not be null"); this.beanDefinitionMap.put(beanName, beanDefinition); }
public EndpointConnectionManager(Class<? extends Endpoint> endpointClass, String uriTemplate, Object... uriVars) { super(uriTemplate, uriVars); Assert.notNull(endpointClass, "endpointClass must not be null"); this.endpoint = null; this.endpointProvider = new BeanCreatingHandlerProvider<>(endpointClass); }
@Override public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException { Assert.notNull(locations, "Location array must not be null"); int count = 0; for (String location : locations) { count += loadBeanDefinitions(location); } return count; }
@Override public WebSocketHandlerRegistration addHandler(WebSocketHandler handler, String... paths) { Assert.notNull(handler, "WebSocketHandler must not be null"); Assert.notEmpty(paths, "Paths must not be empty"); this.handlerMap.put(handler, Arrays.asList(paths)); return this; }
@Override public ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVars) { Assert.notNull(uriTemplate, "'uriTemplate' must not be null"); URI uri = UriComponentsBuilder.fromUriString(uriTemplate).buildAndExpand(uriVars).encode().toUri(); return doHandshake(webSocketHandler, null, uri); }
@Override public ListenableFuture<WebSocketSession> doHandshake( WebSocketHandler handler, String uriTemplate, Object... uriVars) { Assert.notNull(uriTemplate, "uriTemplate must not be null"); URI uri = UriComponentsBuilder.fromUriString(uriTemplate).buildAndExpand(uriVars).encode().toUri(); return doHandshake(handler, null, uri); }