Update package structure
This commit is contained in:
parent
715018fe75
commit
741927664c
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket.support;
|
||||
package org.springframework.websocket.endpoint;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket.support;
|
||||
package org.springframework.websocket.endpoint;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
/**
|
||||
*
|
||||
* Support for working with standard Java WebSocket Endpoint's.
|
||||
*
|
||||
*/
|
||||
package org.springframework.websocket.endpoint;
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket;
|
||||
package org.springframework.websocket.server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket;
|
||||
package org.springframework.websocket.server;
|
||||
|
||||
import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.websocket.support;
|
||||
package org.springframework.websocket.server.endpoint;
|
||||
|
||||
import javax.websocket.DeploymentException;
|
||||
import javax.websocket.server.ServerContainer;
|
||||
|
|
@ -28,16 +28,17 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
|
|||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* BeanPostProcessor that registers {@link javax.websocket.server.ServerEndpointConfig}
|
||||
* beans with a standard Java WebSocket runtime and also configures the underlying
|
||||
* BeanPostProcessor that detects beans of type
|
||||
* {@link javax.websocket.server.ServerEndpointConfig} and registers them with a standard
|
||||
* Java WebSocket runtime and also configures the underlying
|
||||
* {@link javax.websocket.server.ServerContainer}.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
public class ServerEndpointPostProcessor implements BeanPostProcessor, InitializingBean {
|
||||
public class ServerEndpointExporter implements BeanPostProcessor, InitializingBean {
|
||||
|
||||
private static Log logger = LogFactory.getLog(ServerEndpointPostProcessor.class);
|
||||
private static Log logger = LogFactory.getLog(ServerEndpointExporter.class);
|
||||
|
||||
private Long maxSessionIdleTimeout;
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket.support;
|
||||
package org.springframework.websocket.server.endpoint;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -36,6 +36,7 @@ import org.springframework.beans.factory.BeanFactoryAware;
|
|||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.websocket.WebSocketHandler;
|
||||
import org.springframework.websocket.endpoint.StandardWebSocketHandlerAdapter;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +46,7 @@ import org.springframework.websocket.WebSocketHandler;
|
|||
* which case it will be adapted via {@link StandardWebSocketHandlerAdapter}.
|
||||
*
|
||||
* <p>
|
||||
* Beans of this type are detected by {@link ServerEndpointPostProcessor} and
|
||||
* Beans of this type are detected by {@link ServerEndpointExporter} and
|
||||
* registered with a Java WebSocket runtime at startup.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
|
@ -14,13 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket.servlet;
|
||||
package org.springframework.websocket.server.endpoint;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.apache.tomcat.websocket.server.WsServerContainer;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
import org.springframework.websocket.support.ServerEndpointPostProcessor;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +27,7 @@ import org.springframework.websocket.support.ServerEndpointPostProcessor;
|
|||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
public class ServletServerEndpointPostProcessor extends ServerEndpointPostProcessor implements ServletContextAware {
|
||||
public class ServletServerEndpointExporter extends ServerEndpointExporter implements ServletContextAware {
|
||||
|
||||
private ServletContext servletContext;
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.websocket.servlet;
|
||||
package org.springframework.websocket.server.endpoint;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
|
|
@ -31,17 +31,16 @@ import org.springframework.http.server.ServerHttpResponse;
|
|||
import org.springframework.http.server.ServletServerHttpRequest;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.websocket.AbstractHandshakeRequestHandler;
|
||||
import org.springframework.websocket.WebSocketHandler;
|
||||
import org.springframework.websocket.support.ServerEndpointRegistration;
|
||||
import org.springframework.websocket.support.StandardWebSocketHandlerAdapter;
|
||||
import org.springframework.websocket.endpoint.StandardWebSocketHandlerAdapter;
|
||||
import org.springframework.websocket.server.AbstractHandshakeRequestHandler;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
*/
|
||||
public class TomcatHandshakeRequestHandler extends AbstractHandshakeRequestHandler {
|
||||
|
||||
private final Endpoint endpoint;
|
||||
|
|
@ -50,13 +49,12 @@ public class TomcatHandshakeRequestHandler extends AbstractHandshakeRequestHandl
|
|||
|
||||
|
||||
public TomcatHandshakeRequestHandler(WebSocketHandler webSocketHandler) {
|
||||
this.endpoint = new StandardWebSocketHandlerAdapter(webSocketHandler);
|
||||
this.endpointConfig = new ServerEndpointRegistration("/shouldnotmatter", this.endpoint);
|
||||
this(new StandardWebSocketHandlerAdapter(webSocketHandler));
|
||||
}
|
||||
|
||||
public TomcatHandshakeRequestHandler(Endpoint endpoint) {
|
||||
this.endpoint = endpoint;
|
||||
this.endpointConfig = new ServerEndpointRegistration("/shouldnotmatter", this.endpoint);
|
||||
this.endpointConfig = new ServerEndpointRegistration("/dummy", this.endpoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
/**
|
||||
*
|
||||
* Server-specific support for working with standard Java WebSocket Endpoint's.
|
||||
*
|
||||
*/
|
||||
package org.springframework.websocket.server.endpoint;
|
||||
|
||||
Loading…
Reference in New Issue