Package com.aspectran.web.socket.jsr356
Class ServerEndpointExporter
- java.lang.Object
-
- com.aspectran.web.socket.jsr356.ServerEndpointExporter
-
public class ServerEndpointExporter extends java.lang.Object
Detects beans of typeServerEndpointConfig
and registers with the standard Java WebSocket runtime. Also detects beans annotated withServerEndpoint
and registers them as well. Although not required, it is likely annotated endpoints should have theirconfigurator
property set toAspectranConfigurator
.Created: 29/09/2019
-
-
Constructor Summary
Constructors Constructor Description ServerEndpointExporter(ActivityContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.websocket.server.ServerContainer
getServerContainer()
Return the JSR-356ServerContainer
to use for endpoint registration.void
initServletContext(javax.servlet.ServletContext servletContext)
void
registerEndpoints()
Actually register the endpoints.void
setAnnotatedEndpointClasses(java.lang.Class<?>... annotatedEndpointClasses)
Explicitly list annotated endpoint types that should be registered on startup.void
setServerContainer(javax.websocket.server.ServerContainer serverContainer)
Set the JSR-356ServerContainer
to use for endpoint registration.
-
-
-
Constructor Detail
-
ServerEndpointExporter
public ServerEndpointExporter(ActivityContext context)
-
-
Method Detail
-
getServerContainer
@Nullable public javax.websocket.server.ServerContainer getServerContainer()
Return the JSR-356ServerContainer
to use for endpoint registration.
-
setServerContainer
public void setServerContainer(@Nullable javax.websocket.server.ServerContainer serverContainer)
Set the JSR-356ServerContainer
to use for endpoint registration. If not set, the container is going to be retrieved via theServletContext
.
-
initServletContext
public void initServletContext(javax.servlet.ServletContext servletContext)
-
setAnnotatedEndpointClasses
public void setAnnotatedEndpointClasses(java.lang.Class<?>... annotatedEndpointClasses)
Explicitly list annotated endpoint types that should be registered on startup. This can be done if you wish to turn off a Servlet container's scan for endpoints, which goes through all 3rd party jars in the, and rely on Spring configuration instead.- Parameters:
annotatedEndpointClasses
-ServerEndpoint
-annotated types
-
registerEndpoints
public void registerEndpoints()
Actually register the endpoints.
-
-