Package com.aspectran.websocket.jsr356
Class ServerEndpointExporter
- java.lang.Object
-
- com.aspectran.websocket.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 jakarta.websocket.server.ServerContainer
getServerContainer()
Return the JSR-356ServerContainer
to use for endpoint registration.boolean
hasServerContainer()
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(jakarta.servlet.ServletContext servletContext)
void
setServerContainer(jakarta.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 jakarta.websocket.server.ServerContainer getServerContainer()
Return the JSR-356ServerContainer
to use for endpoint registration.
-
hasServerContainer
public boolean hasServerContainer()
-
setServerContainer
public void setServerContainer(@Nullable jakarta.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
.
-
setServerContainer
public void setServerContainer(jakarta.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.
-
-