Browse Source

Polishing

pull/1195/head
Juergen Hoeller 10 years ago
parent
commit
a0773aef1d
  1. 20
      spring-context/src/main/java/org/springframework/context/annotation/Bean.java
  2. 4
      spring-websocket/src/test/java/org/springframework/web/socket/TomcatWebSocketTestServer.java

20
spring-context/src/main/java/org/springframework/context/annotation/Bean.java

@ -44,12 +44,12 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -44,12 +44,12 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
*
* <h3>Bean Names</h3>
*
* <p>While a {@link #name() name} attribute is available, the default strategy for
* <p>While a {@link #name} attribute is available, the default strategy for
* determining the name of a bean is to use the name of the {@code @Bean} method.
* This is convenient and intuitive, but if explicit naming is desired, the
* {@code name} attribute may be used. Also note that {@code name} accepts an array
* of Strings. This is in order to allow for specifying multiple names (i.e., aliases)
* for a single bean.
* {@code name} attribute may be used. Also note that {@code name} accepts an
* array of Strings, allowing for multiple names (i.e. a primary bean name plus
* one or more aliases) for a single bean.
*
* <pre class="code">
* &#064;Bean(name={"b1","b2"}) // bean available as 'b1' and 'b2', but not 'myBean'
@ -78,9 +78,9 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -78,9 +78,9 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
* <h3>{@code @Bean} Methods in {@code @Configuration} Classes</h3>
*
* <p>Typically, {@code @Bean} methods are declared within {@code @Configuration}
* classes. In this case, bean methods may reference other {@code @Bean} methods
* in the same class by calling them <i>directly</i>. This ensures that references between
* beans are strongly typed and navigable. Such so-called <em>'inter-bean references'</em> are
* classes. In this case, bean methods may reference other {@code @Bean} methods in the
* same class by calling them <i>directly</i>. This ensures that references between beans
* are strongly typed and navigable. Such so-called <em>'inter-bean references'</em> are
* guaranteed to respect scoping and AOP semantics, just like {@code getBean()} lookups
* would. These are the semantics known from the original 'Spring JavaConfig' project
* which require CGLIB subclassing of each such configuration class at runtime. As a
@ -190,9 +190,9 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -190,9 +190,9 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
public @interface Bean {
/**
* The name of this bean, or if plural, aliases for this bean. If left unspecified
* the name of the bean is the name of the annotated method. If specified, the method
* name is ignored.
* The name of this bean, or if several names, a primary bean name plus aliases.
* <p>If left unspecified, the name of the bean is the name of the annotated method.
* If specified, the method name is ignored.
*/
String[] name() default {};

4
spring-websocket/src/test/java/org/springframework/web/socket/TomcatWebSocketTestServer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -95,7 +95,7 @@ public class TomcatWebSocketTestServer implements WebSocketTestServer { @@ -95,7 +95,7 @@ public class TomcatWebSocketTestServer implements WebSocketTestServer {
public void deployConfig(WebApplicationContext wac, Filter... filters) {
Assert.state(this.port != -1, "setup() was never called.");
this.context = this.tomcatServer.addContext("", System.getProperty("java.io.tmpdir"));
this.context.addApplicationListener(WsContextListener.class.getName());
this.context.addApplicationListener(WsContextListener.class.getName());
Tomcat.addServlet(this.context, "dispatcherServlet", new DispatcherServlet(wac)).setAsyncSupported(true);
this.context.addServletMapping("/", "dispatcherServlet");
for (Filter filter : filters) {

Loading…
Cancel
Save